I wish to implement this unanswered idea of reverse cloze cards in Anki 2.1.x, i.e. (since I do not think that there is a builtin that does this) I want to write an add-on in Python 3.x and PyQt 5, which are the versions Anki 2.1.x uses. Basically, what I want this to do is that if I have the following card
This is {{c1::clozed::card type}}.
It will create two cards, akin to how you can reverse FrontSide and BackSide in regular Anki cards. I.e. I want to have two cards displaying
This is [card type]. --> This is clozed.
and the other
This is [clozed]. --> This is card type.
respectively. Here are my problems with this:
The cloze card type is a special one and the only way to get cloze cards is by copying this card type. The problem is this card type does not even allow the adding of multiple card types.
My first thought was to have it as for regular cards, in which one has one card with
Front -> Back
and the other cardBack -> Front
. I would like to have thisHint -> Cloze
andCloze -> Hint
.Just adding
{{cloze:fieldname}}
to templates of normal cards does not seem to work correctly either (it stops working when studying the cards, because in the preview it works fine). So one would first have to solve the issue of creating two cards from one entered card.I first thought of somehow rewriting the code in this answer, but I am not sure how to do this, since I have not been able to get that code running. I thought that maybe one could exchange the hint and the cloze field for a second card and then have that card added.
I have not been able to find anything on this on the internet. I am not asking for completely functioning code (though of course that would be the easiest for me). As I am more or less able to program in Python, an explanation of how Anki would allow me to implement this with a link to documentation or source code (ideally Anki 2.1 code, i.e. code from the github), maybe even with small code snippets, would be tremendously helpful.
I just have the small doubt that this is not even possible, and if it is I have no clue how to start tackling this issue since documentation is scarce. If I end up writing my own implementation, I will make sure to share it here as well.