word/quiz: dynamic lang(uage) option
[sheet.git] / word / memory.js
index dfbb8a65b2b4dcdc22995701b26229a33de6757f..99e76e87ad66cec3e9d757f5b234ce68bacfc996 100644 (file)
@@ -41,17 +41,17 @@ class WordMemory extends WordQuiz {
                .forEach(card => put(card, '!.turn!.bad'));
        }
 
-       load(dataurl) {
-               if (dataurl) {
-                       super.load(dataurl);
-               }
-               else {
+       load() {
+               if (this.preset.pairs) {
                        this.dataurl = '/data/wordpairs.json';
                        fetch(this.dataurl).then(res => res.json()).then(pairs => {
                                this.pairs = pairs;
                                this.setup();
                        });
                }
+               else {
+                       super.load();
+               }
        }
 
        setup() {