tl;dr: Is it possible to get the ordinal number of the current review attempt (the current question-answer combination) into a card template? Like, for an ability to write “this is the 19th attempt of the day” on each card?
(Edit:) Without using an add-on.
When practicing grammar, for example, I feel like it’s a good thing to get away from repeating set phrases, to something more dynamic, to train the actual pattern. E.g. if I want to learn to ask someone’s name, it’d be better not just to practice “How old is Alice?”, but also “How old is Bob?”, “How old is Charlie?”, “How old is he?”, etc. (To/from some other language.)
Having to create multiple notes per pattern is, of course, not desired, so I actually developed a way to get dynamic content on cards, without using add-ons. It’s a silly way, using Javascript in the card’s template. I can post the code if anyone cares, but I’ll describe the process for now:
- Two fields are used for comma-separated replacement vocabularies. E.g. the answer vocabulary has “Alice,Bob,Charlie,he,she”, while the question vocabulary has “アリス,ボブ,チャーリー,彼,彼女” (same but in Japanese). Each replacement gets its own line in the vocabulary.
- The actual question and answer fields are written with replacement symbols: “(Q1)は何歳ですか。” and “How old is (A1)?”. There can be any number of replacements, i.e. “(A1) gave (A2) to (A3) while (A4) was watching”, corresponding to lines in the vocabulary.
- Javascript variables are populated with the contents of the vocabulary fields, like “as = `{{Answer Vocabulary}}`;”. These are split by line breaks and commas into arrays of arrays: as[0][0] is “Alice”, as[0][1] is “Bob” etc.
- A random number is generated which is used to make random selections for each replacement.
- A replacement is done on the card’s “innerHTML”, one for each replacement symbol; e.g. all “(A1)” are replaced by “Bob” and all “(Q1)” by “ボブ”, all “(A2)” by “a fish” and all “(Q2)” by “魚”, etc.
This leads to dynamic cards. A note with 1 replacement with 10 words means there are 10 possible card questions-and-answers; a note with 2 replacements with 10 words each means there are 100 possible questions-and-answers, surely helpful in practicing the actual pattern instead of set phrases.
There’s a problem, however: showing the answer in Anki recreates the page and re-runs the Javascript with a new randomization, leading (most often) to different replacements. I therefore made a work-around by using the current minute of the system as seed for the randomization, manually re-generating each new minute, and added a countdown-to-regeneration (to not try to answer a question with too little time left).
It would be far preferable to use for example the ordinal number of the current review as seed: knowing that this is the nth review of the day would allow for a seed that is (1) time-independent, and (2) the same for both front and back cards. Something like “{{::counter::}}” -> “19” would be ideal. Is this information available (edit: without add-ons)? Or does someone know of an alternative or have other suggestions (perhaps some way to store the seed between page loadings).