Add 'Back' button to QuizRunner component

This commit is contained in:
2026-01-08 02:26:15 +01:00
parent 446dab7d49
commit 55005aba1f

View File

@@ -445,11 +445,18 @@ export default function QuizRunner({ defaultMode = 'all', defaultEntryId, autoSt
}
if (status === 'finished') {
const lastIndex = questions.length ? questions.length - 1 : 0;
return (
<div className="quiz-finished">
<h2>Nice work!</h2>
<p className="muted">You scored {score} out of {questions.length}.</p>
<div className="actions">
<button className="button button--ghost" onClick={() => {
setStatus('running');
setCurrentIndex(lastIndex);
}}>
Back
</button>
<button className="button" onClick={startQuiz}>
Play again
</button>