Skip to content
Snippets Groups Projects
Commit c49b15bf authored by Philip Kaluđerčić's avatar Philip Kaluđerčić :u7121:
Browse files

Avoid generating the inner HTML of #stats

parent 65e4f9aa
No related branches found
No related tags found
No related merge requests found
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
// ./LICENSE for more details. // ./LICENSE for more details.
"use strict"; "use strict";
const version = "$Id: quiz.js,v 1.14 2024/01/20 09:55:10 oj14ozun Exp oj14ozun $"; const version = "$Id: quiz.js,v 1.15 2024/01/20 10:00:26 oj14ozun Exp oj14ozun $";
const js_version = document.getElementById("js-version"); const js_version = document.getElementById("js-version");
js_version.innerHTML = version; js_version.innerHTML = version;
...@@ -18,6 +18,8 @@ const info_toggle = document.getElementById("info-toggle"); ...@@ -18,6 +18,8 @@ const info_toggle = document.getElementById("info-toggle");
const action = document.getElementById("action"); const action = document.getElementById("action");
const stats = document.getElementById("stats"); const stats = document.getElementById("stats");
const report = document.getElementById("report"); const report = document.getElementById("report");
const correct = document.getElementById("correct");
const wrong = document.getElementById("wrong");
const class_list = document.documentElement.classList; const class_list = document.documentElement.classList;
...@@ -54,9 +56,8 @@ function update_stats(q) { ...@@ -54,9 +56,8 @@ function update_stats(q) {
const data = get_data(q); const data = get_data(q);
// update stats // update stats
stats.innerHTML = correct.innerHTML = data.right;
"<abbr title=\"Wie oft richtig\" class=\"correct\">" + data.right + "</abbr>:" wrong.innerHTML = data.wrong;
+ "<abbr title=\"Wie oft falsch\" class=\"wrong\">" + data.wrong + "</abbr>";
} }
function remember(q, ok) { function remember(q, ok) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment