Fixing wrong check

This commit is contained in:
Fabian Stamm 2019-09-11 16:59:02 +02:00
parent a4a8fe6781
commit b130482e21

View File

@ -7,7 +7,7 @@
$: options = Object.keys(question.options).map(e => ({ key: e, value: question.options[e] })); $: options = Object.keys(question.options).map(e => ({ key: e, value: question.options[e] }));
let selected = []; let selected = [];
$: isCorrect = selected.length === question.correct.length && selected.every(val => question.correct.find(val)); $: isCorrect = selected.length === question.correct.length && selected.every(val => question.correct.find(v => v === val));
$: console.log("Selected:", selected, "showResult:", showResult, "isCorrect", isCorrect); $: console.log("Selected:", selected, "showResult:", showResult, "isCorrect", isCorrect);