git.shiar.nl
/
sheet.git
/ blob
commit
grep
author
committer
pickaxe
?
search:
re
021758650c4c26a8eec2688fd98388f5916e63b0
[sheet.git]
/
word
/
quiz.js
1
class WordQuiz {
2
dataselect(json) {
3
let rows = Object.values(json);
4
return rows.sort(() => {return .5 - Math.random()}) // shuffle
5
}
6
7
load(dataurl) {
8
fetch(dataurl).then(res => res.json()).then(json => {
9
this.words = this.dataselect(json)
10
this.setup();
11
});
12
}
13
14
constructor(dataurl) {
15
this.load(dataurl);
16
}
17
}