feat: Implement student notes functionality for lessons, including API endpoints, database schema, and frontend UI.

This commit is contained in:
2026-02-16 02:13:50 -03:00
parent 82b346294c
commit 3ae1ae6fd6
11 changed files with 302 additions and 18 deletions
+18
View File
@@ -198,6 +198,15 @@ export interface Module {
lessons: Lesson[];
}
export interface StudentNote {
id: string;
user_id: string;
lesson_id: string;
content: string;
created_at: string;
updated_at: string;
}
// Discussion Forums Types
export interface DiscussionThread {
id: string;
@@ -577,5 +586,14 @@ export const lmsApi = {
return apiFetch(`/announcements/${id}`, {
method: 'DELETE'
});
},
async getNote(lessonId: string): Promise<StudentNote | null> {
return apiFetch(`/lessons/${lessonId}/notes`);
},
async saveNote(lessonId: string, content: string): Promise<StudentNote> {
return apiFetch(`/lessons/${lessonId}/notes`, {
method: 'PUT',
body: JSON.stringify({ content })
});
}
};