How to make it not show the exact location of errors in my typed in answer?

I’m using flashcards for school, mainly the sciences. The answers can vary but they’ll be correct if they follow the general idea. I prefer to use the basic(type in the answer) option as I can recall better that way, but I don’t want my answers to have error corrections on exact letters and words. I just want to see my typed answer and the actual answer, side by side, and I can do the comparison myself. is there any way to do that?

2 Likes

Currently there is no built-in way, but you can achieve something similar by editing the Card Template, using CSS and eventually JavaScript.

E.g. something like

CSS (Styling section):

.typeGood {background-color: #ccc;}
.typeBad {background-color: #ccc;}
.typeMissed {background-color: #ccc;}
.night_mode .typeGood {background-color: white;}
.night_mode .typeBad {background-color: white;}
.night_mode .typeMissed {background-color: white;}

#typeans br {display: none;}

#typeans #typearrow {display: none;}
#typeans br ~ .typeGood {display: none;}
#typeans br ~ .typeBad {display: none;}
#typeans br ~ .typeMissed {display: none;}

JavaScript (Back template):

<script>

    var typed_answer = document.getElementById("typeans").innerHTML;    
    var typed_answer_without_dashes = typed_answer.replace(/[-]/g, "");    

    document.getElementById("typeans").innerHTML = typed_answer_without_dashes;

</script>

Anki automatically adds some dashes when the positions of you typed and what it thinks you were supposed to type do not match. The purpose of this script is to remove them. Unfortunately, it also removes manually typed dashes.
NB: the way Anki evaluates typed text has changed recently, so if you are using Anki 2.1.55 you should probably not need this script.

1 Like

what does the back template script do?

It removes the dashes sometimes added by Anki when it evaluates the typed answer.

Without the script (Anki 2.1.54)

With the script

By the way, there was a typo in the last message, sorry.
The following should work:

<script>

    var typed_answer = document.getElementById("typeans").innerHTML;    
    var typed_answer_without_dashes = typed_answer.replace(/[-]/g, "");    

    document.getElementById("typeans").innerHTML = typed_answer_without_dashes;

</script>
1 Like

Oh ok, i’m using Anki 2.1.55 so there’s no dashes without that script, but thank you.

there’s another thing though. On the back card, it only shows the question and the typed answer

I want it to show the actual answer along with the typed answer below it. How would I do that?

Try adding this under {{type:Back}}:

<br>

{{Back}}

1 Like

It works, thank you so much!!!

Sorry for asking so much, but is there a way to make the correct answer appear above the sample? Cuz it shows below it right now

Try this: delete id=answer from <hr id=answer> and swap {{type:Back}} and {{Back}}

1 Like

Thank you!!

1 Like

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.