From: Vincent Vanwaelscappel Date: Wed, 10 Jan 2024 11:21:58 +0000 (+0100) Subject: wip #6619 @1 X-Git-Url: http://git.cubedesigners.com/?a=commitdiff_plain;h=597c3d00d1f377867cbbbd52ddf96ab062940bb2;p=fluidbook-toolbox-quiz.git wip #6619 @1 --- diff --git a/js/quiz.score.js b/js/quiz.score.js index 7ff62e6..e115c88 100644 --- a/js/quiz.score.js +++ b/js/quiz.score.js @@ -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 () { diff --git a/js/quiz.scorm.js b/js/quiz.scorm.js index 96c1c5c..e82cb80 100644 --- a/js/quiz.scorm.js +++ b/js/quiz.scorm.js @@ -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());