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';
}
},
- updateScore: function (saveState) {
+ updateScore: function () {
this.maxScore = 0;
this.score = 0;
this.logQuestions = [];
}
return res;
}
- this.quiz.data.questions.length;
+ return this.quiz.data.questions.length;
},
hasScore: function () {
this.defaultState = {q: -1, a: []};
//this.defaultState = {q: 0, a: [[1,1,2,1,2]]};
this.skipSaveState = false;
-
this.init();
}
}, 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());