From c34da6941e976b1b999f22ef5ae964a6aa87b06e Mon Sep 17 00:00:00 2001 From: Elijah Date: Sun, 28 Jun 2026 08:34:30 -0700 Subject: [PATCH] fix: Re-shuffle options when retaking a quiz from the results screen --- src/components/quizzes/QuizViewer.tsx | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/components/quizzes/QuizViewer.tsx b/src/components/quizzes/QuizViewer.tsx index 869d99f..da91fa8 100644 --- a/src/components/quizzes/QuizViewer.tsx +++ b/src/components/quizzes/QuizViewer.tsx @@ -250,6 +250,13 @@ export function QuizViewer({ quiz, retakeIds, isShared = false, onFinished }: Qu setAnswers({}); setSubmittedAnswers([]); setResultsData(null); + + // Re-shuffle options for the new attempt + const newShuffledOpts: Record = {}; + for (const q of quiz.questions) { + newShuffledOpts[q.id] = [...q.options].sort(() => Math.random() - 0.5); + } + setShuffledOptions(newShuffledOpts); }} onClose={onFinished} />