feat: quiz shuffle

This commit is contained in:
Jannat Patel
2024-04-24 12:51:01 +05:30
parent 804fc8e391
commit c3390b9005
2 changed files with 23 additions and 7 deletions

View File

@@ -247,6 +247,9 @@ const quiz = createResource({
cache: ['quiz', props.quizName],
auto: true,
onSuccess(data) {
if (data.shuffle_questions) {
data.questions = data.questions.sort(() => Math.random() - 0.5)
}
attempts.reload()
resetQuiz()
},