Fixing possible wrong declared questions
This commit is contained in:
		| @ -7,7 +7,7 @@ | ||||
|     $: options = Object.keys(question.options).map(e => ({ key: e, value: question.options[e] })); | ||||
|  | ||||
|     let selected = []; | ||||
|     $: isCorrect = selected.every(val => question.correct[val]); | ||||
|     $: isCorrect = selected.length === question.correct.length && selected.every(val => question.correct[val]); | ||||
|  | ||||
|     $: console.log("Selected:", selected, "showResult:", showResult, "isCorrect", isCorrect); | ||||
|  | ||||
|  | ||||
		Reference in New Issue
	
	Block a user
	 Fabian Stamm
					Fabian Stamm