Update learn.php

This commit is contained in:
2026-06-16 11:54:44 +02:00
parent 46b514eea6
commit 3da5b0aacd
+8 -5
View File
@@ -100,13 +100,11 @@ async function loadWord() {
*/ */
window.check = async function () { window.check = async function () {
const input = const input = document.getElementById("answer").value;
document.getElementById("answer").value;
if (!currentWord) return; if (!currentWord) return;
const res = const res = await answerWord(currentWord, input);
await answerWord(currentWord, input);
const result = document.getElementById("result"); const result = document.getElementById("result");
@@ -114,11 +112,16 @@ window.check = async function () {
result.innerText = "Goed"; result.innerText = "Goed";
result.style.color = "green"; result.style.color = "green";
} else { } else {
result.innerText = "Fout"; result.innerText =
`Fout — correct antwoord: ${res.correctAnswer}`;
result.style.color = "red"; result.style.color = "red";
} }
await updateStats();
setTimeout(() => {
loadWord(); loadWord();
}, 800);
}; };
/** /**