Hello all!
I am new here. I discovered Anki just a few weeks ago and it’s helping me so much, I wish I had found it before.
I am using Anki to study Russian. I create the cards in AnkiDesktop, but I mainly study them in AnkiDroid.
I would like to use randomization for the following:
- Adjectives: I have notes with 5 fields, which are the four forms of a Russian adjective (masculine, feminine, neuter and plural) and the Spanish translation.
- Verb conjugations: notes with one field for the infinitive and one additional field for each person (I, you, (s)he, we, etc.).
I don’t one to create one card for each of the possibilities, because then I will have too many cards for a few adjectives and verbs, and less time to revise sustantives, adverbs, etc. Instead, I have managed to have one single card, where I am asked randomly one of the fields.
Let’s focus on the adjective case. On the front of the card, I am shown the Spanish word and I am asked randomly to type one of its forms (m, f, n or p) in Russian.
The problem is that, when I introduce the answer and flip the card, the back of the card always uses the masculine form for the correction. That is, even if I am asked for the feminine and I type it in correctly, it will appear as incorrect because the back of the card is comparing it with the masculine answer.
I have tried to use anki-persistence and localStorage, with no success so far (it still compares my answer with the masculine version). Here are the current codes, using (or trying to do so) localStorage:
FRONT
Adjetivo: {{Castellano}}
<br>
<div class="sentence" hidden>Masculino: {{type:Ruso (m)}}</div>
<div class="sentence" hidden>Femenino: {{type:Ruso (f)}}</div>
<div class="sentence" hidden>Neutro: {{type:Ruso (n)}}</div>
<div class="sentence" hidden>Plural: {{type:Ruso (p)}}</div>
<script>
const fields = [...document.querySelectorAll(".sentence")];
function randomInt(max) {
return Math.floor(Math.random() * max);
}
var numalea = localStorage.getItem('numalea'); // Recover stored number
if (numalea == null) { // If it doesn't exist,
numalea = randomInt(fields.length); // generate a new one
localStorage.setItem('numalea', numalea); // and store it in localStorage
}
fields[numalea].hidden = false;
</script>
BACK
{{FrontSide}}
<hr id=answer>
Thanks a lot to everyone!