fix: attempts should be reloaded when quiz data changes (#790)
This commit is contained in:
committed by
GitHub
parent
e7d7cffbc5
commit
180140c13f
@@ -253,8 +253,6 @@ const quiz = createResource({
|
||||
if (data.shuffle_questions) {
|
||||
data.questions = data.questions.sort(() => Math.random() - 0.5)
|
||||
}
|
||||
attempts.reload()
|
||||
resetQuiz()
|
||||
},
|
||||
})
|
||||
|
||||
@@ -286,6 +284,16 @@ const attempts = createResource({
|
||||
},
|
||||
})
|
||||
|
||||
watch(
|
||||
() => quiz.data,
|
||||
() => {
|
||||
if (quiz.data) {
|
||||
attempts.reload()
|
||||
resetQuiz()
|
||||
}
|
||||
}
|
||||
)
|
||||
|
||||
const quizSubmission = createResource({
|
||||
url: 'lms.lms.doctype.lms_quiz.lms_quiz.quiz_summary',
|
||||
makeParams(values) {
|
||||
|
||||
Reference in New Issue
Block a user