X-Git-Url: http://git.shiar.nl/sheet.git/blobdiff_plain/4d1fea2512e08b557f4c54801927db41aaff5d1c..0f3a55ca3cfa02e2446a20dc050d04490b23bb8d:/word/quiz.js?ds=sidebyside diff --git a/word/quiz.js b/word/quiz.js index d2a5818..0518fa1 100644 --- a/word/quiz.js +++ b/word/quiz.js @@ -21,9 +21,8 @@ class Quiz { }); } - constructor() { - this.dataurl = '/data/wordlist.nl.json'; - fetch(this.dataurl).then(res => res.json()).then(json => { + constructor(dataurl) { + fetch(dataurl).then(res => res.json()).then(json => { this.form = document.getElementById('quiz'); this.words = Object.values(json) .sort(() => {return .5 - Math.random()}) // shuffle @@ -32,5 +31,3 @@ class Quiz { }); } }; - -new Quiz();