]> _ Git - fluidbook-toolbox-quiz.git/commitdiff
wip #6619 @1
authorVincent Vanwaelscappel <vincent@cubedesigners.com>
Wed, 10 Jan 2024 11:21:58 +0000 (12:21 +0100)
committerVincent Vanwaelscappel <vincent@cubedesigners.com>
Wed, 10 Jan 2024 11:21:58 +0000 (12:21 +0100)
js/quiz.score.js
js/quiz.scorm.js

index 7ff62e657fa7169a20004852350ed796f50b7898..e115c88ae4994af8542fff9a6a770b41d1137055 100644 (file)
@@ -97,7 +97,7 @@ QuizScore.prototype = {
                 this_score = 0;
                 for (let answerIndex in question.answers) {
                     const answer = question.answers[answerIndex];
-                    console.log("answer.drop_area",answer.drop_area,"userAnswers[answerIndex]",userAnswers[answerIndex])
+                    console.log("answer.drop_area", answer.drop_area, "userAnswers[answerIndex]", userAnswers[answerIndex])
                     this_score += ((answer.drop_area === userAnswers[answerIndex]) ? answer.score : 0);
                 }
                 ok = this_score >= min_score ? 'ok' : 'nok';
@@ -176,7 +176,7 @@ QuizScore.prototype = {
         }
     },
 
-    updateScore: function (saveState) {
+    updateScore: function () {
         this.maxScore = 0;
         this.score = 0;
         this.logQuestions = [];
@@ -201,7 +201,7 @@ QuizScore.prototype = {
             }
             return res;
         }
-        this.quiz.data.questions.length;
+        return this.quiz.data.questions.length;
     },
 
     hasScore: function () {
index 96c1c5ca4e1a527802ad42c70b1c0ee7fb3e0fb9..e82cb80911fe19eef86da128f9a98b8a816470a1 100644 (file)
@@ -9,7 +9,6 @@ function QuizScorm(quiz) {
     this.defaultState = {q: -1, a: []};
     //this.defaultState = {q: 0, a: [[1,1,2,1,2]]};
     this.skipSaveState = false;
-
     this.init();
 }
 
@@ -34,7 +33,7 @@ QuizScorm.prototype = {
         }, 50)
     },
 
-    completed: function (passed) {
+    completed: function () {
         cubeSCORM.scormMarkAsComplete();
         cubeSCORM.setScormValue('success_status', this.quiz.score.isPassed() ? 'passed' : 'failed');
         cubeSCORM.setSCORMScore(this.quiz.score.getNormalizedScore(true), 100, 0, this.quiz.score.getNormalizedScore());