From 5695114d21c9da79fd0f4b875271e814ce226c22 Mon Sep 17 00:00:00 2001 From: soufiane Date: Wed, 27 Dec 2023 14:03:59 +0100 Subject: [PATCH] wait #6589 @0:10 --- js/quiz.score.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/js/quiz.score.js b/js/quiz.score.js index 596684c..7ff62e6 100644 --- a/js/quiz.score.js +++ b/js/quiz.score.js @@ -98,7 +98,7 @@ QuizScore.prototype = { for (let answerIndex in question.answers) { const answer = question.answers[answerIndex]; console.log("answer.drop_area",answer.drop_area,"userAnswers[answerIndex]",userAnswers[answerIndex]) - this_score += ((answer.drop_area === userAnswers[answerIndex]) ? 1 : 0); + this_score += ((answer.drop_area === userAnswers[answerIndex]) ? answer.score : 0); } ok = this_score >= min_score ? 'ok' : 'nok'; @@ -108,7 +108,7 @@ QuizScore.prototype = { this_score = 0; for (let k in userAnswers) { if (parseInt(k) === parseInt(userAnswers[k])) { - this_score++; + this_score = userAnswers[k].score } } ok = this_score >= min_score ? 'ok' : 'nok'; -- 2.39.5