From: soufiane Date: Wed, 27 Dec 2023 13:03:59 +0000 (+0100) Subject: wait #6589 @0:10 X-Git-Url: http://git.cubedesigners.com/?a=commitdiff_plain;h=5695114d21c9da79fd0f4b875271e814ce226c22;p=fluidbook-toolbox-quiz.git wait #6589 @0:10 --- 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';