From 3da5b0aacdb0262817373641431cebd1603fc650 Mon Sep 17 00:00:00 2001 From: Thomas de Roo <2+thomas@noreply.localhost> Date: Tue, 16 Jun 2026 11:54:44 +0200 Subject: [PATCH] Update learn.php --- learn.php | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/learn.php b/learn.php index 6316c6a..21288f8 100644 --- a/learn.php +++ b/learn.php @@ -100,13 +100,11 @@ async function loadWord() { */ window.check = async function () { - const input = - document.getElementById("answer").value; + const input = document.getElementById("answer").value; if (!currentWord) return; - const res = - await answerWord(currentWord, input); + const res = await answerWord(currentWord, input); const result = document.getElementById("result"); @@ -114,11 +112,16 @@ window.check = async function () { result.innerText = "Goed"; result.style.color = "green"; } else { - result.innerText = "Fout"; + result.innerText = + `Fout — correct antwoord: ${res.correctAnswer}`; result.style.color = "red"; } - loadWord(); + await updateStats(); + + setTimeout(() => { + loadWord(); + }, 800); }; /**