X-Git-Url: http://git.shiar.nl/sheet.git/blobdiff_plain/91810a36f31f93d25209e62f40aa24851aa33351..e6f9791973f7c1ef542c3b1438b7fb0527f22109:/word/wijzer.js diff --git a/word/wijzer.js b/word/wijzer.js index 5f2a3bb..7446cc9 100644 --- a/word/wijzer.js +++ b/word/wijzer.js @@ -6,6 +6,7 @@ class WordWijzer extends WordQuiz { this.form.querySelectorAll('li[onclick]').forEach(answer => { answer.removeAttribute('onclick'); }); + this.log('done'); return; } @@ -22,6 +23,7 @@ class WordWijzer extends WordQuiz { console.log(this.question, answer); let match = this.question.dataset.id == answer.dataset.id; put(answer, match ? '.good' : '.wrong'); + this.log('pick', answer.dataset.id, answer.index, this.question.dataset.id); this.next(); } @@ -32,10 +34,13 @@ class WordWijzer extends WordQuiz { let answers = put(this.form, 'ul'); this.words - .forEach(answer => { + .forEach((answer, seq) => { let label = answer[0].replace(/\/.*/, ''); // primary form put(answers, 'li[data-id=$][onclick=""]', - answer[2], label, {onclick: e => this.verify(e)} + answer[2], label, { + onclick: e => this.verify(e), + index: seq, + } ) }); this.words.shuffle();