Merge pull request #902 from pateljannat/quiz-limit
feat: limit questions in quiz
This commit is contained in:
@@ -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)
|
||||
}
|
||||
},
|
||||
})
|
||||
|
||||
|
||||
Reference in New Issue
Block a user