feat: complete exam lifecycle — AI generation, submission, student session, and results
- Backend: AI generation fallbacks when OpenAI not configured, full exam submission saving all params (difficulty, rubric, entity, grading system, approval workflow) and creating linked question records per section - Backend: new exam session controller with get_session, autosave, submit, status, and results endpoints; student attempt/answer/score models - Backend: new controllers for entities, approval workflows, exam schedules - Frontend: exam session split-layout with passage panel, question types (MCQ, T/F/NG, gap-fill, writing, speaking), timer, and review dialog - Frontend: results page with percentage score, per-answer breakdown table - Frontend: generation page dynamic dropdowns, full payload submission - Frontend: updated types for ExamSessionSection, ExamQuestion options Made-with: Cursor
This commit is contained in:
@@ -40,10 +40,30 @@ export const examsService = {
|
||||
return api.post<Rubric>("/rubrics", data);
|
||||
},
|
||||
|
||||
async updateRubric(id: number, data: Partial<Rubric>): Promise<Rubric> {
|
||||
return api.put<Rubric>(`/rubrics/${id}`, data);
|
||||
},
|
||||
|
||||
async deleteRubric(id: number): Promise<ApiSuccessResponse> {
|
||||
return api.delete<ApiSuccessResponse>(`/rubrics/${id}`);
|
||||
},
|
||||
|
||||
async listRubricGroups(params?: PaginationParams): Promise<PaginatedResponse<RubricGroup>> {
|
||||
return api.get<PaginatedResponse<RubricGroup>>("/rubric-groups", params as Record<string, string | number | boolean | undefined>);
|
||||
},
|
||||
|
||||
async createRubricGroup(data: { name: string; rubric_ids: number[] }): Promise<RubricGroup> {
|
||||
return api.post<RubricGroup>("/rubric-groups", data);
|
||||
},
|
||||
|
||||
async updateRubricGroup(id: number, data: { name?: string; rubric_ids?: number[] }): Promise<RubricGroup> {
|
||||
return api.put<RubricGroup>(`/rubric-groups/${id}`, data);
|
||||
},
|
||||
|
||||
async deleteRubricGroup(id: number): Promise<ApiSuccessResponse> {
|
||||
return api.delete<ApiSuccessResponse>(`/rubric-groups/${id}`);
|
||||
},
|
||||
|
||||
async listStructures(params?: PaginationParams & { entity_id?: number }): Promise<PaginatedResponse<ExamStructure>> {
|
||||
return api.get<PaginatedResponse<ExamStructure>>("/exam-structures", params as Record<string, string | number | boolean | undefined>);
|
||||
},
|
||||
@@ -52,10 +72,23 @@ export const examsService = {
|
||||
return api.post<ExamStructure>("/exam-structures", data);
|
||||
},
|
||||
|
||||
async updateStructure(id: number, data: Partial<ExamStructure>): Promise<ExamStructure> {
|
||||
return api.put<ExamStructure>(`/exam-structures/${id}`, data);
|
||||
},
|
||||
|
||||
async deleteStructure(id: number): Promise<ApiSuccessResponse> {
|
||||
return api.delete<ApiSuccessResponse>(`/exam-structures/${id}`);
|
||||
},
|
||||
|
||||
async suggestRubricCriteria(data: {
|
||||
name?: string;
|
||||
skill: string;
|
||||
exam_type: string;
|
||||
levels: string[];
|
||||
}): Promise<{ criteria: string[]; suggested_levels?: string[] }> {
|
||||
return api.post("/ai/suggest-rubric-criteria", data);
|
||||
},
|
||||
|
||||
async getAvatars(): Promise<{ id: number; name: string; thumbnail: string }[]> {
|
||||
return api.get("/exam/avatars");
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user