I have multiple statements of usage English Idioms.
In a way:
- Main explanation
- Example 1
- Example 2
....
- Example N
The example in text:
- {{c1::To get in}} is used for cars;
{{c1::to get on}} is used for all other forms of transportation.
- It's easiest {{c2::to get in}} the car from the driver's side.
- I always {{c3::get on}} the bus to work at 34th Street.
When I just use cloze card types , obviously anki hide only one cloze area per card.
But I have the next additional needs:
- have ability to use
bury interday siblings
( to go only through one example per day instead of 10 , bruuuuh)
- hide everything that not related to current list item. Means if anki choose c3, only the next text should be shown:
- I always [...] the bus to work at 34th Street.
There is a way to do it with Vilhelm Ian’s note type. I will share the code with you.
Front
First, paste this on the front:
<script>
(()=>{
let clozes = document.getElementById("hidden").innerHTML.split("|")
let rng = Math.floor(Math.random() * clozes.length)
localStorage.setItem("rng", rng)
document.getElementById("target").innerHTML = clozes[rng]
function close() {
}
})()
</script>
Back
Now, paste this in your back template:
<script>
(()=>{
const clozes = document.getElementById("hidden").innerHTML.split("|")
const rng = localStorage.getItem("rng")
document.getElementById("target").innerHTML = clozes[rng]
})()
</script>
Styling
This sets the styling for your field:
#hidden {
display: none;
}
Now on both sides of the template, change {{cloze:Text}}
(or whatever you named that field) to this:
!-- this hides everything in your field -->
<div id="hidden">{{cloze:Text}}</div>
<!-- then we fill this target div using javascript -->
<div id="target"></div>
Example of how it works
Let’s say, if I want one card to show me sky is {{c1:red}}
and the same card to sometimes show me sky is {{c1:blue}}
, I’ll do this in the note:
sky is {{c1:red}} | sky is {{c1:blue}}
As you can see, we are seperating the text using the pipe character (|
), you can simply use c1
for all your clozes and Anki will randomly show you one of the texts.
If you wish, you can also replace the pipe with any other character in the first two script I posted.