X-Git-Url: http://git.shiar.nl/sheet.git/blobdiff_plain/6af9d408cefdd30a40794742e5ceed7cb3547d45..35a635c705ad1449df22a7cf5f6623b9445e40e3:/word/wijzer.js diff --git a/word/wijzer.js b/word/wijzer.js index b4dab8f..7446cc9 100644 --- a/word/wijzer.js +++ b/word/wijzer.js @@ -6,13 +6,14 @@ class WordWijzer extends WordQuiz { this.form.querySelectorAll('li[onclick]').forEach(answer => { answer.removeAttribute('onclick'); }); + this.log('done'); return; } this.question.innerHTML = ''; put(this.question, - '[data-id=$] img[src=$]', word[0], - `/data/word/en/${word[0]}.jpg` + '[data-id=$] img[src=$]', word[2], + `/data/word/32/${word[2]}.jpg` ); } @@ -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 => { - let label = answer[2].replace(/\/.*/, ''); // primary form + .forEach((answer, seq) => { + let label = answer[0].replace(/\/.*/, ''); // primary form put(answers, 'li[data-id=$][onclick=""]', - answer[0], label, {onclick: e => this.verify(e)} + answer[2], label, { + onclick: e => this.verify(e), + index: seq, + } ) }); this.words.shuffle();