X-Git-Url: http://git.shiar.nl/sheet.git/blobdiff_plain/7bbf129e06d190145d0a4d9a7d4c7399d2112f88..a93c5c61b18192c5f74256e3cb18e7f1cd2034d5:/word/multichoice.js diff --git a/word/multichoice.js b/word/multichoice.js index 61a7b5a..f0520f9 100644 --- a/word/multichoice.js +++ b/word/multichoice.js @@ -1,16 +1,19 @@ class WordMultiChoice extends WordQuiz { next() { + if (this.words.length < 4) return; let word = this.words.shift(); if (!word[2]) return this.next(); let form = put(this.form, - '+img[src=$]+ul', `/data/word/en/${word[2]}.jpg`, + '+img[src=$]+ul', `/data/word/32/${word[2]}.jpg`, ); let answers = [word[0], this.words[0][0], this.words[1][0], this.words[2][0]] .shuffle() + this.log('ask', word[2], answers); answers.forEach(suggest => { let label = suggest.replace(/\/.*/, ''); let option = put(form, 'li', label, {onclick: () => { + this.log('pick', suggest, null, word[0]); if (suggest != word[0]) { // incorrect put(option, '.wrong');