fix: Re-shuffle options when retaking a quiz from the results screen
All checks were successful
Automated Container Build / build-and-push (push) Successful in 51s
All checks were successful
Automated Container Build / build-and-push (push) Successful in 51s
This commit is contained in:
parent
b7165aba44
commit
c34da6941e
1 changed files with 7 additions and 0 deletions
|
|
@ -250,6 +250,13 @@ export function QuizViewer({ quiz, retakeIds, isShared = false, onFinished }: Qu
|
||||||
setAnswers({});
|
setAnswers({});
|
||||||
setSubmittedAnswers([]);
|
setSubmittedAnswers([]);
|
||||||
setResultsData(null);
|
setResultsData(null);
|
||||||
|
|
||||||
|
// Re-shuffle options for the new attempt
|
||||||
|
const newShuffledOpts: Record<string, Option[]> = {};
|
||||||
|
for (const q of quiz.questions) {
|
||||||
|
newShuffledOpts[q.id] = [...q.options].sort(() => Math.random() - 0.5);
|
||||||
|
}
|
||||||
|
setShuffledOptions(newShuffledOpts);
|
||||||
}}
|
}}
|
||||||
onClose={onFinished}
|
onClose={onFinished}
|
||||||
/>
|
/>
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue