diff --git a/index.html b/index.html index f97c33e..e2e6df1 100644 --- a/index.html +++ b/index.html @@ -8,7 +8,7 @@ - + diff --git a/static/js/quiz.js b/static/js/quiz.js index 0f1e69b..0a72ce9 100644 --- a/static/js/quiz.js +++ b/static/js/quiz.js @@ -3,18 +3,22 @@ $(function () { var changed = false; // Hints - $('.hint').replaceWith(function () { - return '
Bekijk hint' + $(this).hide()[0].outerHTML + '
'; - }); + + + function processHints() { + $('.hint').replaceWith(function () { + return '
Bekijk hint' + $(this).hide()[0].outerHTML + '
'; + }); + $('#difficulty').trigger('change'); + } + $('#difficulty').change(function (e) { var option = $(this).find(':selected').val(); - $('.hintlink').toggle(option == 'normal'); $('.hint').toggle(option == 'easy'); - window.localStorage.setItem('difficulty', option); }); @@ -31,7 +35,7 @@ $(function () { $('#difficulty').trigger('change'); function loadPage(page) { - $('#quiz').load('/' + page + '.html?cachebuster=' + Math.random()); + $('#quiz').load('/' + page + '.html?cachebuster=' + Math.random(), processHints); } function getPage(link) {