Update learn.php
This commit is contained in:
@@ -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";
|
||||||
}
|
}
|
||||||
|
|
||||||
loadWord();
|
await updateStats();
|
||||||
|
|
||||||
|
setTimeout(() => {
|
||||||
|
loadWord();
|
||||||
|
}, 800);
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
Reference in New Issue
Block a user