this.answers.indices = indices.concat( _.shuffle(remainingIndices) );
}
this.answers.index = !!paper ? paper.inputs.length : 0;
- Vue.nextTick(statementsLibsRefresh);
+ this.answers.displayAll = assessment.display == "all";
+ this.answers.showSolution = false;
this.stage = 2;
};
if (assessment.mode == "open")
}, 1000);
},
// stage 2
- sendAnswer: function() {
+ sendOneAnswer: function() {
const realIndex = this.answers.indices[this.answers.index];
let gotoNext = () => {
if (this.answers.index == assessment.questions.length - 1)
},
});
},
+ // TODO: I don't like that + sending should not be definitive in exam mode with display = all
+ sendAnswer: function() {
+ if (assessment.display == "one")
+ this.sendOneAnswer();
+ else
+ assessment.questions.forEach(this.sendOneAnswer);
+ },
// stage 2 --> 3 (or 4)
// from a message by statements component, or time over
endAssessment: function() {
if (assessment.mode == "open")
{
this.stage = 4;
+ this.answers.showSolution = true;
return;
}
$.ajax("/end/assessment", {
setAnswers: function(m) {
for (let i=0; i<m.answers.length; i++)
assessment.questions[i].answer = m.answers[i];
+ this.answers.showSolution = true;
this.stage = 4;
},
},