Hello everyone,
I’ve recently encountered an issue with Anki’s “type answer” feature. The current default behavior is that after submitting an answer, you only find out whether your input was correct or not. However, if the answer is wrong, there’s no option to correct and re-enter it. This can be frustrating, as getting positive feedback on the correct answer is crucial for long-term memory retention.
After looking into some forum discussions, including this How to have instant type:answer feedback? (link is not allowed for me), I found that Cloze cards can provide real-time feedback, but unfortunately, this isn’t the case for regular “type” cards. In the same thread, @kleinerpirat shared a solution that could help, but it’s a little bit complex and it doesn’t work with AnkiDroid, which I use every often.
To address this, I’ve created a simplified version of the solution that works both on Anki desktop and AnkiDroid. I’d like to share it here, as it might be useful to others facing the same issue.
Update: check if all correct
<script>
(() => {
const input = document.getElementById("typeans");
const word = "{{单词}}";
input.addEventListener("input", () => {
const letters = input.value.split("");
let allCorrect = true;
letters.forEach((letter, i) => {
if (allCorrect && letter === word[i]) {
input.style.color = "green";
} else {
input.style.color = "red";
allCorrect = false;
}
});
});
})();
</script>
When everything is good:
When you mistype a letter:
Lastly, I hope that the Anki team can consider adding this feature officially or, at the very least, allowing users to re-enter their answer until it’s correct before they grade themselves (hard / good).
Regards,
Lesca