I was prompted with an alternative to the addon.
How to have instant type:answer feedback?
Template
Front Template
{{Front}}
{{type:Back}}
<div id="answer-field" hidden>{{Back}}</div>
<script>
(() => {
/**
* Type-in-the-answer live feedback for Anki (vague variant)
* @author Matthias Metelka | @kleinerpirat
*/
const input = document.getElementById("typeans");
const answer = document.getElementById("answer-field").innerHTML;
if (input) {
input.addEventListener("input", () => {
input.classList.add("typed");
input.classList.toggle(
"goodsofar",
input.value == answer.substring(0, input.value.length)
);
input.classList.toggle(
"correct",
input.value == answer
);
});
}
})();
</script>
Back Template
{{Front}}
<hr id=answer>
{{type:Back}}
Styling
.card {
font-family: arial;
font-size: 20px;
text-align: center;
color: black;
background-color: white;
}
#typeans.typed {
background: red;
}
#typeans.typed.goodsofar {
background: yellow;
}
#typeans.typed.correct {
background: green;
}