word/quiz: common js function to shuffle arrays
[sheet.git] / word / multichoice.js
index aa018d015294ec5f031d58c8112542795b031178..649d19a5d9460e0ae549f15576870b18ea1c97bb 100644 (file)
@@ -5,8 +5,8 @@ class WordMultiChoice extends WordQuiz {
                        '+img[src=$]+ul', `/data/word/en/${word[0]}.jpg`,
                );
 
-               let answers = [word[2], this.words[1][2], this.words[2][2], this.words[3][2]]
-                       .sort(() => {return .5 - Math.random()}) // shuffle
+               let answers = [word[2], this.words[0][2], this.words[1][2], this.words[2][2]]
+                       .shuffle()
                answers.forEach(suggest => {
                        let label = suggest.replace(/\/.*/, '');
                        let option = put(form, 'li', label, {onclick: () => {