word/quiz: apply subsequent hash parameters
[sheet.git] / word / quiz.js
index dce5f7a43ace9c973c726432f70d651112cbea69..5498809f67ceb2bbb0ce9a7d31ab8205217b6277 100644 (file)
@@ -7,9 +7,12 @@ Array.prototype.shuffle = function () {
 };
 
 function hashparams() {
-       // location.hash is not encoded in firefox
-       const encodedhash = (window.location.href.split('#'))[1] || '';
-       return decodeURIComponent(encodedhash).split('#');
+       const encodedhash = window.location.href.split('#').slice(1) || '';
+       if (encodedhash.length == 1) {
+               // location.hash is not encoded in firefox
+               return decodeURIComponent(encodedhash).split('#');
+       }
+       return encodedhash;
 }
 
 class Words {