Update learn.php
This commit is contained in:
@@ -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);
|
||||
};
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user