mirror of
https://github.com/Tria-plc/emaui.git
synced 2026-09-07 11:55:43 +00:00
fix(exam): print real MCQ options, evaluation-method-aware cutting point check
Print showed blank A/B/C/D fill-in lines for every CHOICE question instead of the real options — the detail page never fetched option data at all (GET /exams/:id?i=questions, no nested options), and the print template hardcoded the blanks regardless. Now requests ?i=questions,questions.options and prints the real option text, falling back to blank lines only when a question genuinely has none on record. Also fixed the print-time cutting-point guard: it compared raw point sum to cutting point regardless of evaluationMethod, wrongly blocking valid low-point-sum PERCENTAGE papers from printing. Now branches the same way RecordResultModal's grading preview already does, and surfaces the matching backend validation error (paper_cannot_reach_cutting_point) added server-side for the same reason. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This commit is contained in:
@@ -20,7 +20,9 @@ const examApi = baseApi.injectEndpoints({
|
||||
providesTags: ['Api'],
|
||||
}),
|
||||
getExam: builder.query<Exam, string>({
|
||||
query: (id) => `/exams/${id}?i=questions`,
|
||||
// Nested relation so CHOICE questions carry their options here too —
|
||||
// needed to print real answer choices instead of blank A/B/C/D lines.
|
||||
query: (id) => `/exams/${id}?i=questions,questions.options`,
|
||||
providesTags: ['Api'],
|
||||
}),
|
||||
createExam: builder.mutation<Exam, CreateExamPayload>({
|
||||
|
||||
Reference in New Issue
Block a user