diff --git a/src/pages/student/practice/Test.tsx b/src/pages/student/practice/Test.tsx index c0924f3..3f0f3db 100644 --- a/src/pages/student/practice/Test.tsx +++ b/src/pages/student/practice/Test.tsx @@ -41,6 +41,7 @@ import { useExamNavigationGuard } from "../../../hooks/useExamNavGuard"; export const Test = () => { const blocker = useExamNavigationGuard(); + const [eliminated, setEliminated] = useState>>({}); const [showExitDialog, setShowExitDialog] = useState(false); @@ -223,37 +224,61 @@ export const Test = () => { // ✅ MCQ if (question.options && question.options.length > 0) { + const eliminatedSet = eliminated[question.id] ?? new Set(); return (
{question.options.map((option, index) => { const isSelected = currentAnswer === option.id; + const isEliminated = eliminatedSet.has(option.id); return ( - + ✕ + + +
); })} @@ -278,6 +303,14 @@ export const Test = () => { ); }; + const toggleEliminate = (questionId: string, optionId: string) => { + setEliminated((prev) => { + const current = new Set(prev[questionId] ?? []); + current.has(optionId) ? current.delete(optionId) : current.add(optionId); + return { ...prev, [questionId]: current }; + }); + }; + switch (phase) { case "IDLE": return (