Merge pull request #902 from pateljannat/quiz-limit

feat: limit questions in quiz
This commit is contained in:
Jannat Patel
2024-06-28 12:48:10 +05:30
committed by GitHub
8 changed files with 36 additions and 71 deletions

View File

@@ -270,6 +270,9 @@ const quiz = createResource({
if (data.shuffle_questions) {
data.questions = data.questions.sort(() => Math.random() - 0.5)
}
if (data.limit_questions_to) {
data.questions = data.questions.slice(0, data.limit_questions_to)
}
},
})