Compare commits

...

3 Commits

Author SHA1 Message Date
Fabian Stamm
b130482e21 Fixing wrong check 2019-09-11 16:59:02 +02:00
Fabian Stamm
a4a8fe6781 Fixing wrong correct check 2019-09-11 16:36:29 +02:00
Fabian Stamm
4545915711 Fixing possible wrong declared questions 2019-09-11 16:33:57 +02:00

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.every(val => question.correct[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);