1 class WordMultichoice extends WordQuiz {
3 if (this.words.length < 4) return;
4 let word = this.words.shift();
5 let form = put(this.form,
6 '+img[src=$]+ul', word.thumb()
9 let answers = [word, this.words[0], this.words[1], this.words[2]]
11 this.log('ask', word.id, answers.map(w => w.id));
12 answers.forEach(suggest => {
13 let option = put(form, 'li', suggest.label, {onclick: () => {
14 this.log('pick', suggest.id, null, word.id);
15 if (suggest.label != word.label) {
17 put(option, '.wrong');
21 window.setTimeout(() => this.next(), 500);