word/quiz: configuration presets from request hash
[sheet.git] / word / memory.js
index ac1e829996258598c1b710bded8c182b99c8c84a..dfbb8a65b2b4dcdc22995701b26229a33de6757f 100644 (file)
@@ -62,7 +62,7 @@ class WordMemory extends WordQuiz {
                if (this.words) {
                        const aspect = this.form.clientWidth / window.innerHeight;
                        //TODO image ratio
-                       let count = 35;
+                       let count = parseInt(this.preset.n) || 35;
                        let cols = Math.round(Math.sqrt(count) * aspect**.5);
                        count = cols * Math.ceil(count / cols);
                        this.form.style['grid-template-columns'] = `repeat(${cols}, 1fr)`;