word/multichoice: stop when answers run out
authorMischa POSLAWSKY <perl@shiar.org>
Thu, 30 Dec 2021 07:04:53 +0000 (08:04 +0100)
committerMischa POSLAWSKY <perl@shiar.org>
Fri, 31 Dec 2021 04:29:05 +0000 (05:29 +0100)
word/multichoice.js

index 61a7b5adbb7950d4c4bbb0161cb27c3dcdb23f13..5908fdcbec9f3a2a69967bf1d9111bb4e98e193e 100644 (file)
@@ -1,5 +1,6 @@
 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,