diff --git a/apps/backoffice/src/app/features/exam/pages/ExamDetailPage.tsx b/apps/backoffice/src/app/features/exam/pages/ExamDetailPage.tsx index 8e9037840..5ce7a4ab5 100644 --- a/apps/backoffice/src/app/features/exam/pages/ExamDetailPage.tsx +++ b/apps/backoffice/src/app/features/exam/pages/ExamDetailPage.tsx @@ -121,18 +121,25 @@ export function ExamDetailPage() { // Only approved bank items may go on a paper (US-EXAM-003), so the picker // must not offer drafts or retired questions either. + // + // Form restriction mirrors the backend's assertUsable: ONLINE exams are + // CHOICE-only (auto-grading needs it), OFFLINE exams have no form + // restriction at all — mixing ESSAY and CHOICE by hand (exam.form + // "BOTH") is the sanctioned, only way to build a mixed paper. Matching + // `q.form === exam.form` here used to hide every question once "BOTH" + // became a real exam.form value, since no question itself is "BOTH". const eligibleQuestions = useMemo(() => { if (!exam) return []; return allQuestions .filter( (q) => q.certificationId === exam.certificationId && - q.form === exam.form && - q.status === 'APPROVED', + q.status === 'APPROVED' && + (exam.administrationMethod !== 'ONLINE' || q.form === 'CHOICE'), ) .map((q) => ({ id: q.id, title: q.title, form: q.form, points: q.points })); // eslint-disable-next-line react-hooks/exhaustive-deps - }, [allQuestions, exam?.certificationId, exam?.form]); + }, [allQuestions, exam?.certificationId, exam?.administrationMethod]); if (isLoading) return ;