git.shiar.nl
/
sheet.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
latin: group aliases similar to termcol ea
[sheet.git]
/
word
/
multichoice.js
diff --git
a/word/multichoice.js
b/word/multichoice.js
index 649d19a5d9460e0ae549f15576870b18ea1c97bb..f0520f9d428cccbcc376a89eecb7e2f2c960d884 100644
(file)
--- a/
word/multichoice.js
+++ b/
word/multichoice.js
@@
-1,16
+1,20
@@
class WordMultiChoice extends WordQuiz {
next() {
class WordMultiChoice extends WordQuiz {
next() {
+ if (this.words.length < 4) return;
let word = this.words.shift();
let word = this.words.shift();
+ if (!word[2]) return this.next();
let form = put(this.form,
let form = put(this.form,
- '+img[src=$]+ul', `/data/word/
en/${word[0
]}.jpg`,
+ '+img[src=$]+ul', `/data/word/
32/${word[2
]}.jpg`,
);
);
- let answers = [word[
2], this.words[0][2], this.words[1][2], this.words[2][2
]]
+ let answers = [word[
0], this.words[0][0], this.words[1][0], this.words[2][0
]]
.shuffle()
.shuffle()
+ this.log('ask', word[2], answers);
answers.forEach(suggest => {
let label = suggest.replace(/\/.*/, '');
let option = put(form, 'li', label, {onclick: () => {
answers.forEach(suggest => {
let label = suggest.replace(/\/.*/, '');
let option = put(form, 'li', label, {onclick: () => {
- if (suggest != word[2]) {
+ this.log('pick', suggest, null, word[0]);
+ if (suggest != word[0]) {
// incorrect
put(option, '.wrong');
return;
// incorrect
put(option, '.wrong');
return;