Add state for last skipped question in QuizRunner

This commit is contained in:
2026-01-08 01:21:12 +01:00
parent 47e036b076
commit 69630e62ec

View File

@@ -224,6 +224,7 @@ export default function QuizRunner({ defaultMode = 'all', defaultEntryId, autoSt
const [response, setResponse] = useState<any>(null); const [response, setResponse] = useState<any>(null);
const [showResult, setShowResult] = useState(false); const [showResult, setShowResult] = useState(false);
const [lastCorrect, setLastCorrect] = useState(false); const [lastCorrect, setLastCorrect] = useState(false);
const [lastSkipped, setLastSkipped] = useState(false);
const [showExplanation, setShowExplanation] = useState(false); const [showExplanation, setShowExplanation] = useState(false);
const [error, setError] = useState<string | null>(null); const [error, setError] = useState<string | null>(null);
@@ -248,6 +249,7 @@ export default function QuizRunner({ defaultMode = 'all', defaultEntryId, autoSt
setResponse(null); setResponse(null);
setShowResult(false); setShowResult(false);
setLastCorrect(false); setLastCorrect(false);
setLastSkipped(false);
setShowExplanation(false); setShowExplanation(false);
}; };
@@ -319,6 +321,7 @@ export default function QuizRunner({ defaultMode = 'all', defaultEntryId, autoSt
setScore((s) => s + 1); setScore((s) => s + 1);
} }
setLastCorrect(correct); setLastCorrect(correct);
setLastSkipped(skip);
setShowResult(true); setShowResult(true);
setShowExplanation(!correct); setShowExplanation(!correct);
}; };