-class Quiz {
+class WordMultiChoice extends WordQuiz {
next() {
let word = this.words.shift();
let form = put(this.form,
});
}
- 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();
}
};