1 class WordWijzer extends WordQuiz {
3 let word = this.words.shift();
5 put(this.form, '.done');
6 this.form.querySelectorAll('li[onclick]').forEach(answer => {
7 answer.removeAttribute('onclick');
12 this.question.innerHTML = '';
14 '[data-id=$] img[src=$]', word[2],
15 `/data/word/en/${word[2]}.jpg`
20 let answer = click.target;
21 put(answer, '.chosen');
22 console.log(this.question, answer);
23 let match = this.question.dataset.id == answer.dataset.id;
24 put(answer, match ? '.good' : '.wrong');
29 this.form = document.getElementById('quiz');
30 this.question = put(this.form, 'figure');
33 let answers = put(this.form, 'ul');
36 let label = answer[0].replace(/\/.*/, ''); // primary form
37 put(answers, 'li[data-id=$][onclick=""]',
38 answer[2], label, {onclick: e => this.verify(e)}