word: language includes for general use
[sheet.git] / word / multichoice.js
index 649d19a5d9460e0ae549f15576870b18ea1c97bb..761b966dd3cc3976e9affc468e3c661bfc611824 100644 (file)
@@ -2,15 +2,15 @@ class WordMultiChoice extends WordQuiz {
        next() {
                let word = this.words.shift();
                let form = put(this.form,
-                       '+img[src=$]+ul', `/data/word/en/${word[0]}.jpg`,
+                       '+img[src=$]+ul', `/data/word/en/${word[2]}.jpg`,
                );
 
-               let answers = [word[2], this.words[0][2], this.words[1][2], this.words[2][2]]
+               let answers = [word[0], this.words[0][0], this.words[1][0], this.words[2][0]]
                        .shuffle()
                answers.forEach(suggest => {
                        let label = suggest.replace(/\/.*/, '');
                        let option = put(form, 'li', label, {onclick: () => {
-                               if (suggest != word[2]) {
+                               if (suggest != word[0]) {
                                        // incorrect
                                        put(option, '.wrong');
                                        return;