Skip to content

Commit

Permalink
improve negative feedback on mathbox + fun animal
Browse files Browse the repository at this point in the history
  • Loading branch information
glendc committed Feb 8, 2024
1 parent dca9e93 commit 1dd8ec7
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion site/1/mathbox.html
Original file line number Diff line number Diff line change
Expand Up @@ -289,6 +289,7 @@ <h3 id="form-title"></h3>

const answerEl = document.getElementById("answer");
answerEl.style.backgroundColor = "#fffde6";
document.getElementById("exercise-feedback").style.color = "black";
answerEl.focus();
answerEl.click();

Expand Down Expand Up @@ -340,7 +341,13 @@ <h3 id="form-title"></h3>
} else {
console.log(answer, "wrong, try again");

document.getElementById("exercise-feedback").innerHTML = `🦉 Probeer het nog eens.`;
const animals = [
'🐶', '🦊', '🦄', '🐭', '🐼', '🐣', '🦉',
];
const animal = animals[Math.floor(Math.random() * animals.length)];

document.getElementById("exercise-feedback").innerHTML = `${animal} Probeer het nog eens.`;
document.getElementById("exercise-feedback").style.color = "red";
document.getElementById("answer").style.backgroundColor = "rgb(253, 220, 220)";

let exerciseString = "";
Expand Down

0 comments on commit 1dd8ec7

Please sign in to comment.