git.shiar.nl
/
sheet.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
10fa5ec
)
word/quiz: category selection from location hash
author
Mischa POSLAWSKY
<perl@shiar.org>
Thu, 30 Dec 2021 07:14:29 +0000
(08:14 +0100)
committer
Mischa POSLAWSKY
<perl@shiar.org>
Mon, 7 Feb 2022 17:42:33 +0000
(18:42 +0100)
word/quiz.js
patch
|
blob
|
history
diff --git
a/word/quiz.js
b/word/quiz.js
index e2e8cb6adc412ebeab12aa1e5bc09cd790601f81..187aea7e76d72aa2aa3410e8117679cf1e7822f2 100644
(file)
--- a/
word/quiz.js
+++ b/
word/quiz.js
@@
-44,6
+44,14
@@
class WordQuiz {
load(dataurl) {
this.preset = {};
load(dataurl) {
this.preset = {};
+ let input;
+ if (input = window.location.hash.match(/\d+/)) {
+ this.preset.cat = input[0];
+ }
+ if (window.location.hash.match(/a/)) {
+ this.preset.level = 2;
+ }
+
fetch(dataurl).then(res => res.json()).then(json => {
this.words = this.dataselect(json)
this.setup();
fetch(dataurl).then(res => res.json()).then(json => {
this.words = this.dataselect(json)
this.setup();