matthayes / anki_cloze_anything

Add cloze deletions to any existing Anki notes without any modification to Anki
https://ankiweb.net/shared/info/330680661
Apache License 2.0
52 stars 10 forks source link

Convert existing built-in cloze cards to Cloze Anything #19

Open rwmpelstilzchen opened 3 years ago

rwmpelstilzchen commented 3 years ago

Say one has many cloze deletion cards that use Anki’s built-in mechanism. How can they convert them to Cloze Anything while saving the state, interval, review history, etc. of the original cards? Naïve ‘Change Note Type’ (ctrl+shift+M) doesn’t seem to help.

matthayes commented 3 years ago

I did a quick test and it does seem this is possible.

If you change the note type from Cloze to another note type, it seems to map Cloze 1, Cloze 2, etc. to the card types of the target note type in the order of those card types. So if you have a note type based on Cloze Anything with card type ExpressionCloze1, ExpressionCloze2, etc., the cards will map as you'd hope. Note that it seems to disregard the card type mapping you choose in the menu and just uses the card types of the target note type in order.

Then you can use Anki's Find and Replace feature under Edit to replace all {{ with (( and all }} with )). Finally, select all the cards, then under Edit choose Cloze Anything, then Create Missing Cards. This will in the1` values within each of the fields based on the cloze content. However given the cards already exist from the conversion this step isn't really necessary.

The caveat here is that I don't know if this behavior with how the Cloze cards get mapped is an intended feature of Anki or accidental. It's probably worth following up in the Anki forum to confirm this is the way it's supposed to work and not just a happy accident, to make sure it's not something that will change in the future. I recommend doing your own testing in some test decks and backing up before attempting conversion of your real cards. I'll document this when I have better clarity on the conversion process.

rwmpelstilzchen commented 3 years ago

I supposed that if only one mapping is listed in the interface (‘Change Cloze to:’), only one card will remain. It’s good to hear I’m wrong.

I guess that if one’s Cloze Anything note type has cards before the one with the cloze deletions (say reading and listening comprehension cards for language learning), they can first convert the old cards to an intermediate note type, and then convert it to the target note type, mapping the cards accordingly. It is a bit of a hassle, but this process should be done only once, so it is not a big deal. The manual process can be described in the documentation, or automated using the add-on.

matthayes commented 3 years ago

Anki lets you reorder the card types for a note type. It may be that if you move your other card types like recall to the end that it will map successfully without the intermediate note type.

rwmpelstilzchen commented 3 years ago

Yeah, that would be a simpler solution.