diff --git a/quiz.js b/quiz.js index 059998330796119f7d2c783e53989c5e768d1285..d0e1d66346e0ba0a779576eedc424a3d5a9423ca 100644 --- a/quiz.js +++ b/quiz.js @@ -7,7 +7,7 @@ * http://creativecommons.org/publicdomain/zero/1.0/. */ "use strict"; -const version = "$Id: quiz.js,v 1.26 2024/01/21 19:33:05 oj14ozun Exp oj14ozun $"; +const version = "$Id: quiz.js,v 1.27 2024/01/21 19:34:22 oj14ozun Exp oj14ozun $"; const js_version = document.getElementById("js-version"); js_version.innerText = version; @@ -25,6 +25,8 @@ const stats = document.getElementById("stats"); const report = document.getElementById("report"); const correct = document.getElementById("correct"); const wrong = document.getElementById("wrong"); +const seen = document.getElementById("seen"); +const total = document.getElementById("total"); const perma = document.getElementById("perma"); const class_list = document.documentElement.classList; @@ -65,6 +67,8 @@ function update_stats(q) { // update stats correct.innerText = data.right; wrong.innerText = data.wrong; + seen.innerText = (Object.keys(progress).length || 0) + + (progress.hasOwnProperty(q.id) ? 0 : 1); } function remember(q, ok) { @@ -274,6 +278,8 @@ async function make_quiz(file) { questions = await (await fetch(file)).json(); shuf(questions); + total.innerText = questions.length; + // when done, load first question next(); };