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', `/data/word/32/${word[2]}.jpg`,
9 let answers = [word[0], this.words[0][0], this.words[1][0], this.words[2][0]]
11 this.log('ask', word[2], answers);
12 answers.forEach(suggest => {
13 let label = suggest.replace(/\/.*/, '');
14 let option = put(form, 'li', label, {onclick: () => {
15 this.log('pick', suggest, null, word[0]);
16 if (suggest != word[0]) {
18 put(option, '.wrong');
22 window.setTimeout(() => this.next(), 500);