function QuizScore(quiz) {
this.quiz = quiz;
- this.logQuestions = [];
- // Le score global du quiz
- this.score = 0;
- this.maxScore = 0;
- this.questionStatus = [];
- this.answers = [];
- this.lastAnsweredQuestion = -1;
+ this.reset();
}
QuizScore.prototype = {
this.updateScore();
},
+ reset: function () {
+ this.logQuestions = [];
+ // Le score global du quiz
+ this.score = 0;
+ this.maxScore = 0;
+ this.questionStatus = [];
+ this.answers = [];
+ this.lastAnsweredQuestion = -1;
+ },
+
/**
*
* @param questionIndex integer
return {
q: this.lastAnsweredQuestion, a: this.answers
};
- },
- execAction: function (action) {
+ }, execAction: function (action) {
if (action === undefined || action === null || action === '' || !action) {
return;
}