// Full questions tree is rendered, but some parts hidden depending on display settings
render(h) {
// TODO: render nothing if answers is empty
- let domTree = this.questions.map( (q,i) => {
+ let domTree = (this.questions || [ ]).map( (q,i) => {
let questionContent = [ ];
questionContent.push(
h(
"class": {
option: true,
choiceCorrect: this.answers.showSolution && this.questions[i].answer.includes(idx),
- choiceWrong: this.answers.showSolution && this.inputs[i][idx] && !q.answer.includes(idx),
+ choiceWrong: this.answers.showSolution && this.answers.inputs[i][idx] && !q.answer.includes(idx),
},
},
option
{
"class": {
"question": true,
- "hide": !this.answers.displayAll && this.answers.index != i,
+ "hide": !this.answers.displayAll && this.answers.indices[this.answers.index] != i,
},
},
questionContent
id: "statements",
},
},
- questions
+ domTree
);
},
updated: function() {