X-Git-Url: http://git.shiar.nl/sheet.git/blobdiff_plain/7e9a11491faa8ff3f97c9a7fb855b238ad9ea85c..af99f42e425d0fd4e22d92458d5dc2049429d684:/word/multichoice.js diff --git a/word/multichoice.js b/word/multichoice.js index b98842f..aa018d0 100644 --- a/word/multichoice.js +++ b/word/multichoice.js @@ -1,4 +1,4 @@ -class Quiz { +class WordMultiChoice extends WordQuiz { next() { let word = this.words.shift(); let form = put(this.form, @@ -21,12 +21,8 @@ class Quiz { }); } - constructor(dataurl) { - fetch(dataurl).then(res => res.json()).then(json => { - this.form = document.getElementById('quiz'); - this.words = Object.values(json) - .sort(() => {return .5 - Math.random()}) // shuffle - this.next(); - }); + setup() { + this.form = document.getElementById('quiz'); + this.next(); } };