feat: Add i18n support, new content block types, course export, and lesson interaction tracking.
This commit is contained in:
@@ -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'
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user