]> _ Git - fluidbook-toolbox-quiz.git/commitdiff
wait #6589 @0:10
authorsoufiane <soufiane@cubedesigners.com>
Wed, 27 Dec 2023 13:03:59 +0000 (14:03 +0100)
committersoufiane <soufiane@cubedesigners.com>
Wed, 27 Dec 2023 13:03:59 +0000 (14:03 +0100)
js/quiz.score.js

index 596684ca869f1a24758df4641f80d1ab7e4ca712..7ff62e657fa7169a20004852350ed796f50b7898 100644 (file)
@@ -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';