feat: Add i18n support, new content block types, course export, and lesson interaction tracking.

This commit is contained in:
2026-01-17 02:19:39 -03:00
parent b166387a48
commit 05faa20993
50 changed files with 3368 additions and 388 deletions
+36 -2
View File
@@ -32,8 +32,8 @@ export interface QuizQuestion {
export interface Block {
id: string;
type: 'description' | 'media' | 'quiz' | 'fill-in-the-blanks' | 'matching' | 'ordering' | 'short-answer';
title?: string;
type: 'description' | 'media' | 'quiz' | 'fill-in-the-blanks' | 'matching' | 'ordering' | 'short-answer' | 'code' | 'hotspot' | 'memory-match' | 'document';
title: string;
content?: string;
url?: string;
media_type?: 'video' | 'audio';
@@ -45,6 +45,9 @@ export interface Block {
items?: string[];
prompt?: string;
correctAnswers?: string[];
instructions?: string;
initialCode?: string;
metadata?: any;
}
export interface Lesson {
@@ -104,6 +107,16 @@ export interface User {
language?: string;
}
export interface Notification {
id: string;
title: string;
message: string;
notification_type: string;
is_read: boolean;
link_url?: string;
created_at: string;
}
export interface AuthResponse {
user: User;
token: string;
@@ -242,5 +255,26 @@ export const lmsApi = {
},
body: formData
}).then(res => res.json());
},
async recordInteraction(lessonId: string, payload: { video_timestamp?: number, event_type: string, metadata?: any }): Promise<void> {
return apiFetch(`/lessons/${lessonId}/interactions`, {
method: 'POST',
body: JSON.stringify(payload)
});
},
async getHeatmap(lessonId: string): Promise<{ second: number, count: number }[]> {
return apiFetch(`/lessons/${lessonId}/heatmap`);
},
async getNotifications(): Promise<Notification[]> {
return apiFetch('/notifications');
},
async markNotificationAsRead(id: string): Promise<void> {
return apiFetch(`/notifications/${id}/read`, {
method: 'POST'
});
}
};
+30
View File
@@ -0,0 +1,30 @@
{
"common": {
"loading": "Loading...",
"back": "Back",
"next": "Next",
"finish": "Finish",
"error": "Error",
"retry": "Retry"
},
"nav": {
"catalog": "Catalog",
"myLearning": "My Learning",
"profile": "Profile",
"signOut": "Sign Out"
},
"course": {
"modules": "Modules",
"lessons": "Lessons",
"progress": "Progress",
"calendar": "Timeline",
"start": "Start",
"continue": "Continue"
},
"lesson": {
"summary": "AI Summary",
"transcription": "Transcription",
"complete": "Mark as Completed",
"nextLesson": "Next Lesson"
}
}
+30
View File
@@ -0,0 +1,30 @@
{
"common": {
"loading": "Cargando...",
"back": "Volver",
"next": "Siguiente",
"finish": "Finalizar",
"error": "Error",
"retry": "Reintentar"
},
"nav": {
"catalog": "Catálogo",
"myLearning": "Mi Aprendizaje",
"profile": "Perfil",
"signOut": "Cerrar Sesión"
},
"course": {
"modules": "Módulos",
"lessons": "Lecciones",
"progress": "Progreso",
"calendar": "Cronología",
"start": "Comenzar",
"continue": "Continuar"
},
"lesson": {
"summary": "Resumen AI",
"transcription": "Transcripción",
"complete": "Marcar como Completado",
"nextLesson": "Siguiente Lección"
}
}
+30
View File
@@ -0,0 +1,30 @@
{
"common": {
"loading": "Carregando...",
"back": "Voltar",
"next": "Próximo",
"finish": "Finalizar",
"error": "Erro",
"retry": "Repetir"
},
"nav": {
"catalog": "Catálogo",
"myLearning": "Meu Aprendizado",
"profile": "Perfil",
"signOut": "Sair"
},
"course": {
"modules": "Módulos",
"lessons": "Lições",
"progress": "Progresso",
"calendar": "Cronologia",
"start": "Começar",
"continue": "Continuar"
},
"lesson": {
"summary": "Resumo IA",
"transcription": "Transcrição",
"complete": "Marcar como Concluído",
"nextLesson": "Próxima Lição"
}
}