50 1

# Enhanced Cloze (for Anki 2.1)

0.03MB. Updated 2022-04-23. Only supports Anki 2.1.x.
The author has shared 6 other item(s).

## Description

Cloze notes are very powerful for spaced repetition softwares like Anki. This add-on along with the attached note type aims to improve Anki's mechanism of displaying clozes and offers great features for better user interaction. The name of the note type the add-on uses is "Enhanced Cloze 2.1 v2". Preview
Main features
• Improved Mechanism of Displaying Clozes
• Take card1 for example.
• All c1 clozes (let me call them "genuine cloze" for this card) will be red.
• All other clozes (let me call them "pseudo cloze" for this card), eg. c2, c3 will be blue.
• On the front of the card, all clozes (genuine or pseudo) will be shown as their hint (if one exists) or empty.
• You can show the answer of every cloze (genuine or pseudo) by clicking it.
• This means you can think about a genuize cloze and check the answer one by one without getting hints from pseudo-clozes and genuine clozes after it.
• Handy Keyboard And Touchscreen Shortcut
• You can ...
• uncover genuine clozes one by one using the keyboard shortcut [J] (conifgurable) or by touching the left border of the card
• uncover pseudo clozes one by one using the keyboard shortcut [N] (conifgurable) or by touching the right border of the card
• toggle all genuine clozes using the keyboard shortcut [Shift+J] (conifgurable) border
• toggle all pseudo clozes using the keyboard shortcut [Shift+N] (conifgurable) border
• This makes uncovering clozes super convenient, no matter whether it's on a computer using the keyboard or on a mobile phone.
• You can edit the shortcut keys by editing the configuration section of the note type (top of the front card template).
• Auto Scroll To The Relevant Cloze
• The card will scroll to the first genuine cloze at the very beginning.
• When you use shortcut to uncover clozes one by one, if the next cloze is out of view (common situation on mobile phones with small screen), the card will automatically scroll to it. Super fluent experience of answering cards. This behaviour can be turned off (by editing the configuration section of the note type)
• Can Be Used In No-Cloze Basic Mode
• It is also Ok to go without clozes using this note type. (Note: Creating such notes only works on Anki Desktop, not on mobile!) Just type the question in the Content field and the answer in the Note field. The Note field, as answer, will be hidden on the front of the card and shown on the back of the card, just like with the Basic note type.
• Anki won't warn you that no clozes are found.
• "Normal" clozes
• If you want a cloze to alway be displayed when it's a pseudo cloze, prepend the answer with a #-sign like this: {{c1::#some text}}.
Usage
• In the editor select the "Enhanced Cloze 2.1 v2" note type
• The content field is the only necessary field that you have to write something into. Other fields are optional.
• Write down anything in the Content field, whether with clozes like {{c1::abc}} or not, the add-on will process the note intelligently.
• For you information, you may create clozes with increasing numbers like {{c1::aa}} {{c2::bb}} with Ctrl+Shift+C and clozes with the same number like {{c1::aa}} {{c1::bb}}.
• I'd recommend you to group several closely related pieces of information to use the same cloze number and review them together on a card for convenience; use different cloze numbers to turn you informative note into several cards to maximize review efficiency.
• When you have Edit Field During Review (Cloze) installed, Ctrl+Click fields to edit them

Supported Anki versions:
• 2.1.28-2.1.50+ (updated 2022-04-23)

1990296174

## Reviews

on 1652706273
Wow, this add on is exactly what I have been looking for/needing.

I use the Cloze (overlapping) add on quite a bit but often found I needed heading within the clozes. Using multiple closes didn't really work as I wanted either but enhanced cloze is perfect!
on 1651075902
it's amazing like its creator
on 1650976027

Question 1: I was wondering if there was a way to show all the pseudo-cloze answers by default ("normal mode"). Is there a quick way to do this in card styling without clicking "Shift+N" or adding a "#" before the pseudocloze content?

*edit: I found the solution to this by playing around a bit. I just copied and pasted this line, toggleAllClozesOfAType("pseudo") , into the script under card styling on the front template.

Question 2: Seems that Edit Field During Review is not working with this addon yet. Would be amazing to get these 2 functioning together!

**edit: THIS MAN/WOMAN IS A BEAST!
Thanks so much!
Comment from author before post was edited
The newest version has support for Edit Field During Review!
on 1650712056
This is a great add-on. And what's even better is that the author is very responsive and innovative! 👍
on 1650650492
This add-on has a great potential, however I see the following issues:
1) When I press the right corner it uncovers pseudo-clozes, and I would like the opposite.
2) If I press a bold word in a showed pseudo-cloze it doesn't covers itself, I have to press a word without additional formats.
3) I can't press the top of the flashcard in order to uncover and cover all the clozes (this was a feature some time ago).
4) I would like to know if it would be possible to maintain the same size of the cloze capsules in any circumstances (I have the text in "justify").
on 1650559386
Hello, first of all I would like to thank you for the work you have done on this tool, it is magnificent. It is helping me a lot in my studies, and it is much more efficient and with more possibilities than others that I had tried.

I'd also like to make a couple of proposals for change, if that's not too much to ask.

- Is it possible that when I have an underlined text (in my original text), its color does not change to blue in the revision, by default?

- Is it possible that the text of the pseudoclozes does not appear underlined when the question is answered?

For example, when I underline a word in my original text, it appears in blue. If, on the other hand, I have a word that is red, and also underlined, when the pseudocloze is discovered, it appears blue instead of red, changing the original color it had on.

Is it possible that the pseudoclozes were not underlined when they were visible, and that the words I have underlined in the original text did not turn blue when the pseudoclozes were discovered?

Thank you very much for this amazing tool, and I hope to continue enjoying it for a long time.
Comment from author
I included your proposed features in the current update!

The card template now has two extra options "underlineRevealedPseudoClozes" and "underlineRevealedGenunineClozes".
First you have to reset the styling by choosing "Reset Enhanced Clozes css to default" from the Tools menu of the main window of Anki (to remove the underline styling from the Enhanced Cloze template).
Then you can edit these options in Ankis card template editor (Tools -> Manage note types -> Enhanced Cloze 2.1 v2 -> Cards).
This will also make it so that your underlined text does not appear blue.
on 1649968024
This is exactly what I have been looking for!!
on 1649629730
Thanks for your response. Resetting solved the problem.
Looking forward to the update on "edit field during review cloze".
Very nice work!
__________________

But it's not working as intended.

I'm trying to use it as a basic card and as a cloze card only if needed. In the first part of the review it's ok, but in the second part (good, easy, etc) anki hides the note and keeps showing "no cloze 1".

Also it is conflicting with the addon edit field during review cloze.
Comment from author
Edit:
The add-on now has support for Edit Field during review (cloze)!

Thanks for the thumbs up!

The add-on should put something like {{c1::text}} into the Cloze99 field automatically when there is no cloze in the content field. This makes it so that Anki doesn't complain about missing clozes. If your removed this field you can restore the Enhanced Cloze note type to its default form from the Tools menu of the main window (or just add it manually).

I might try to add compatibility with the edit field during review cloze add-on in the future.
on 1649598510
Hey there, I don't have a GitHub account, so I'll send my issue here.
I'm having a problem with the keyboard shortcuts because I can't press "spacebar" to show the answer and then click hard, good or easy. The shortcuts that shows the Genuine and Pseudo Clozes is working, but I have to click in "Show the Answer" to continue. Is there already a shortcut for this issue?
Comment from author
Does this issue only show up when you are reviewing Enhanced Cloze cards? For me pressing the spacebar to show the answer works normally. Maybe this is caused by a different add-on?
What Anki version are you using?
on 1649576146
One of the best addons I have seen
on 1649441185
Mathjax error...
Content : $$\dfrac {{{c1::f}}} {s}$$
Display : c1::f/s

Could you help me?
on 1648490859
The best add-on so far! Great work!
on 1648029699
- I´d like the text of the pseudoclozes not to appear underlined when they are discovered
- I´d also like when I have an underlined text (in my original text), its color will not changed to blue in review

"sometext" appears in blue because I have it underlined in the original text. If, for example, I have a word in red underlined, when the pseudocloze appears visible, being underlined instead of red it appears in blue. I would like the pseudoclozes not to appear underlined when they appear visible, and the words that I have underlined in the original text, would not turn blue when they are uncovered. I think I'm asking for 2 different things.
Comment from author before post was edited
What do you mean with font color? The color of the text is always the same. Do you mean the color of the cloze when it's hidden?
Do you want the revealed text of pseudoclozes look just like normal text?
on 1647539837
Add-on works amazingly! Have now used it pretty much all my new cards and am changing old cards as I see them to this.
Only issue is with the last update, it's now showing the startup error message (I'm using 2.1.44) - was just wondering if this could be taken a look at? It still works, but the error message is a bit irritating and I'm not really sure what's causing it.

UPDATE: Thank you for such a quick fix!! It's working perfectly now!

Unfortunately the latest update has made it so that the cloze deletions are no longer showing up on 2.1.44, so the card basically looks empty now.

UPDATE 2: I somehow got it to work again, not too sure how but it seems that if I change the note type without doing any reviews and just download from Anki web, it fixes it
Comment from author before post was edited
I uploaded another update and the message should not appear anymore :)
on 1647351840
First of all thank you so much for this addon, it´s been doing great!
My issue is purely aesthetic, since it seems to display an extra space (empty) behind the last letter of a word written in italic font. It happens in all of them.
If there was a way to correct that, would be awesome! Thanks!
Comment from author
The last update solves this. You have to reset the note type to it's default form from the Tools menu in the main Anki window.
on 1646751593
great addon however after updating i receive this error when trying to export cards:

Error
An error occurred. Please start Anki while holding down the shift key, which will temporarily disable the add-ons you have installed.
When you've discovered the add-on that is causing the problem, please report the issue on the add-ons section of our support site.
Debug info:
Anki 2.1.49 (dc80804a) Python 3.8.6 Qt 5.14.2 PyQt 5.14.2
Platform: Mac 10.16
Flags: frz=True ao=True sv=2
Add-ons, last update check: 2022-03-08 13:56:20

Caught exception:
Traceback (most recent call last):
File "aqt/taskman.py", line 101, in _on_closures_pending
File "aqt/taskman.py", line 71, in <lambda>
File "aqt/exporting.py", line 173, in on_done
File "concurrent/futures/_base.py", line 432, in result
File "concurrent/futures/_base.py", line 388, in __get_result
File "concurrent/futures/thread.py", line 57, in run
File "aqt/exporting.py", line 167, in do_export
File "anki/exporting.py", line 342, in exportInto
File "anki/exporting.py", line 350, in doExport
File "anki/exporting.py", line 253, in exportInto
File "anki/models.py", line 539, in update
File "anki/_backend/generated.py", line 450, in add_or_update_notetype
File "anki/_backend/__init__.py", line 131, in _run_command
anki.errors.TemplateError: Card template ⁨1⁩ in notetype '⁨Enhanced Cloze 2.1⁩' has a problem.<br>See the preview for more information.

and also

this error when reviewing? not sure if i've done something wrong

Front template has a problem:
Found '⁨{{c2::abc}}⁩', but there is no field called '⁨abc⁩'
Comment from author
I updated the add-on and there is now an option to reset the note type to its default form (in the Tools menu of the main window). You can try if this solves the problem.
on 1646486903
Really wonderful add-on! Small (stupid?) question: there's no way of making this work in the Anki iOS app?
on 1646127680
very useful
on 1645991304
Thank you so much for this amazing add-on, this card template is now the one I use the most, it made it a lot easier to add cards with multiple related themes, in addition to making it easier to memorize mnemonics. Your last update "animateScroll = false" was excellent. I hope you continue with this project, as I hope to be able to contribute in some way in a while. Thank you very much. I'm using version 2.1.47.
on 1645491732
Thank you for doing this!
on 1644914597
Excellent. I wish it was quicker to use mathjax with this addon but found an easy (time-consuming) way to make it work.
on 1644908023
Looks promising however when I click "j" all the genuine clozes uncover all at once and the "one by one" process is not functional. I am using the 49 version.

21.02.22
It happens only with the same cloze number

15.2.22
Beautiful! thank you so much. It is working now.
If you use "Customize Keyboard Shortcuts" add-on make sure to disable the "j" binder or use a different shortcut because they contradict each other.
Comment from author before post was edited
Does this only happen with clozes that have the same id (like {{c1::text}} {{c1::other text}}) or with clozes that have different numbers?

(You can edit your message or create an issue on GitHub to reply.)

Edit: This should work correctly now. If it doesn't try checking for updates (From the main window click Tools -> Add-ons -> Check for updates. Then Restart Anki)
on 1644809883
I'd like to make a suggestion.
This add-on enable the card to scroll down to the right place, which helps a lot.
But after clicking the button of "showing the answer", the card would sroll again. It makes me feel dizzy, especially when I hope to answer cards at a fast speed.
Would it be likely to show the answer in a static way?

Comment from author before post was edited
I added a new option for this. To disable the animation you have to set "animateScroll" to "false" in the config section on the front template of the note type.
on 1644341055
Amazing! Really helpful and efficient. However, I noticed it is not possible to reveal one by one all the genuine clozes by using no incremental clozes (in other words, if I use C1 for all the words I want to hide, it will reveal all the clozes by pressing J). It is only possible with incremental clozes, so by creating multiple cards... Maybe an idea for the next update?
Thank you so much for your work!!!
Comment from author
The shortcuts now work as you describe it!
on 1643541593
Very useful for those wanting to use Anki looking to combine note taking and flashcards functionality.
on 1643491940
Very useful addon. Thanks very much! If it would still work with "Edit Field during Review Cloze" and allowed more than 50 fill in the blanks, I would give 100 points.
Comment from author
You can now create up to 500 clozes!
on 1641865546
This is one of my favorite addons. The best alternative to Anking's "cloze one by one"
on 1641726407
Fantastic! Just what I was looking for a long time! One question: Is it possible to show all clozed out information when I click on "Show answer"? Right now, I have to uncover all blue clozes one by one after having clicked on "Show answer".
Comment from author
There is now a hotkey for this, by default it's Shift+N. (You can change it by editing the front of the card template.)
on 1641139313
This add-on is even better than the old one especially for cards with a large chunk of information which may provide hints for the cloze that one needs to answer. The visual is great too. The author deserves a cup of coffee or more.
on 1640329497
这个插件是真的不错，非常好用，我记得之前我能在手机上添加卡片的，现在不知道为什么不能在手机上添加卡片了
on 1638273585
Upd: Tried this for a while and it's fantastically useful addon! stay on it after hard choice between this addon and a few other also outstanding and extremely thoughtful addons (Cloze Hide All, Cloze Anything and Cloze Overlapper).

On Ankidroid I make cards with Cloze Hide All (classic Cloze also works) and then on Desktop easily update (migrate) the note type to Enhanced Cloze, works great (only have to reenter the # sign if there were any, because after all migrating the addon thinks the # is a part of the hidden word itself, not the service mark).

---
Hi, great idea for the addon,
has anyone tried the clozet-cards produced by this addon on AnkiDroid, are shown and work correctly?
Are these cards fully compatible with the AnkiDroid or only on Anki Desktop could be used properly?
Comment from author
You can review cards you create on Anki Desktop on AnkiDroid without any problems. Unfortunately you can't create or edit cards in AnkiDroid.

EDIT:
The card are fully compatible with AnkiDroid now!
on 1638256556
absolute life saver! thank you so much!
although one thing: how can I change the shortcut to reveal cloze one by one? [ i ] is conflicted with card info.
Comment from author
on 1638196856
Very useful add on, thank you so much!
Just a question, when I'm using it on my iPad, by tapping, it just opens the first cloze (red) and I'm not able to open others (blue clozes). How can I do that?
Thanks!
on 1637984905
Bastante útil
on 1636375710
on 1636113794
the only add on I'm actually using as my default for everything now. one suggestion would be an option to unhide the field after I clicked on it
on 1635694721
I was using the fork version of this during 3 or 4 moths, and I'll try to convert the old cards into new ones. Thank you so much for updating this brilliant add-on, however I want to know if it's possible to do more than 20 clozes, that was something that I would do in some cases, but I couldn't with the previous version.
_______________
EDIT: Well, in my case, 50 clozes would be perfect, but it would be an amazing achievement to have 40 too. And thanks for your recommendation about the migration, however I did it without any problem with the implemented features of the Anki 2.1.46 version.
_________
EDIT 2: Wow, thank you so much for allowing 50 clozes per card, that's awesome and will let me do flashcards with the longest articles of laws.
________
EDIT 3.1: The note model that this add-on incorporates has, of course, preset fields, however, I added another one called “Title” with the sole purpose of assigning a visible title to the cards in the browser. Nevertheless, with each update (and now also every time that I open and close the Anki Desktop version), my “Title” field disappears, and I have to do the same procedure again.
— With the default card model, in the browser I would get all the text that was in the “Content” field and, of course, there was all the text that I was going to study. For that reason, I decided to add that additional field to put it the title to the cards.
— Would it be possible to have a solution for this?
EDIT 3.2 -> Thank you so much, you're incredible!.
_____
EDIT 4.1: I've created my first flashcard with more than 20 clozes, and it doesn't work well. The fields from cloze1 to cloze20 have the text {{c1::text}}, {{c2::text}} and so on, but the fields that go from 21 onwards, remain empty. Moreover, when I see a preview of the flashcard, it appears the text “This is an example”.
EDIT 4.2: Now I've opened Anki Desktop again and the note works with the first 20 clozes, but the flashcards from 21 onwards show the “This is an example” text.
EDIT 4.3: Thanks a lot, it works now!!!
_______
EDIT 5: Right now, I'm using Anki 2.1.49 on desktop (I don't know if this has something to do with what I will mention) and I have three issues. 1) If I click at the top of the flashcard, it doesn't appear the whole flashcard revealed. 2) If I click the text of a showed cloze, in order to hide it again, and this text is in bold or has another color that isn't the default one, it doesn't hide it. 3) I use AnkiDroid, and now I see that, even if I press a concrete cloze or press any of the two corners, a light blue color appears accompanying the action (I personally find it somewhat annoying to look at).
I wonder if it would be possible to do something with that, thanks in advance.
Comment from author before post was edited
It's currently not possible to create more than 20 clozes on one note. I could change this though. How much clozes would be enough for you? 40?

I'm not completely sure but I think the Special Fields add-on could help with migrating the cards: https://ankiweb.net/shared/info/1102281552

EDIT: You can create 50 clozes since the newest update!
Edit 3: I should have tested this better... It's fixed now.
on 1634252697
You may want to have a look at your regex that requotes src=\"XX\" to src='XX' as \" somewhere downstream. I am no python expert but it seems the regex doesn't match where it should (at least not on Windows). I did a lazy hack and wrapped the return statement in a working regex as so:

# without this images (and probably other media) don't work
# because they get partially url encoded somewhere down the line <== Doesn't seem to match
src_re = r'(?:src *= *)"(.+?)"'
part = re.sub(src_re, r"src='\1'", part)

parts.append((part, None))
return re.sub('src\\s?=\\s?\\\\"(.+?)\\\\"', "src='\\1'", "<script type='text/javascript'>data=" + json.dumps({ # <== I just wrapped the return here with a working regex
'parts': parts,
'hints': hints,
}).replace('<', '\u003c').replace('-->', '--\>') + "</script>")

For anyone else who wants it working in the mean time: replace lines 117-121 in enhanced_cloze.py with the following (make sure indentation matches line 116):
return re.sub('src\\s?=\\s?\\\\"(.+?)\\\\"', "src='\\1'", "<script type='text/javascript'>data=" + json.dumps({
'parts': parts,
'hints': hints,
}).replace('<', '\u003c').replace('-->', '--\>') + "</script>")
Comment from author
Thank you! My mistake was that I applied the regex substitution only to a part of the whole field content. I updated the add-on and it should work correctly now.
on 1633859691
Top!
on 1633702961
It worked perfectly but since yesterday Anki pop-ups an error message every-time I start it, implying the "Enhanced Cloze for Anki 21"⁩ add-on is at fault.
And since then all my cards show the message "This is an example […]".
Do you know why this is happening ?
Comment from author
Could you sent the whole error message? Without it it's hard to say what could cause it. It could be that it is incompatible with another add-on.

If you want we can communicate using github: https://github.com/RisingOrange/anki-enhanced-cloze/issues
This makes things a bit easier because we will get notifications when the other person writes something.
on 1633299017
on 1632970682
You need this one, trust me!!

Update:
THE BEST!!! Just today I wrote this and the author fixed it, working perfect :) so happy they listen to us, thank you nice human :)
-------------
I dont hava a reddit account so I had to write here, this was my favorite add on, until the last update today, now in the content (first space) when I write something I get this "Cloze deletion can only be used in fields which use the 'cloze:' filter. This is typically the first field." so I added it to a Cloze space/box and when I save it I got this bug "the first field is empty" so I write any other thing and I can save it but later while studying it appears as This is an example [ ] and nothing of any Cloze, no answer, please fix this update :,(
Comment from author
Hi, I wil try to fix this as soon as possible. Do you maybe have the Automatic Basic to Cloze add-on installed? If yes, try disabling it.

I just uploaded another update (you might have to go to Tools -> Addons -> "Check for Updates" for it to appear). After installing it, restart Anki, then try to create an Enhanced Cloze note.

Edit: :)
on 1632834349
The add-ons great except when I had screenshot from my Mac on the Anki it didn't show. You can see it in the edit mode but you can't see it when you are actually studying it, anyway to fix this? I will change the rating after this problem is fixed.
Comment from author
Images are working now!
on 1632195448
Anki: Version ⁨2.1.44 (b2b3275f)⁩
macOS: Version11.5.2(20G95)

If you use Anki 2.147, the shortcut keys will not work. I dropped it to 2.144 and the shortcut keys are normal. But if inline Mathjax uses $${{c1::}}$$ or {{c1:: $$123$$ }}, it just displays the original text.
Comment from author
I just tested it with Mathjax inline and it works. Does it not work for you?

Edit: Updated the add-on, the text should now get displayed properly. I don't know what's up with to the shortcuts, they don't work for me even with all add-ons disabled in Anki 2.1.47.
If you use Ankidroid or Anki mobile you have to do full a database upload from Anki desktop to Ankiweb (Anki settings, force upload on next sync) to update the note template on your mobile device too.
on 1631922778
Good add-on, but can you add a function to always show a particular cloze? For example:

{{c2::Info 1}} {{c3::Info 2}} {{c3::Info 3}}

The cloze c1 should be always visible when clozes 2, 3 and 4 are prompted.

EDIT: Thank you!
Comment from author before post was edited
This is already possible, I forgot to add it to the description. To use this put a #-sign before the answer.
Try this: {{c1::#Heading}} {{c2::Info 1}} {{c3::Info 2}} {{c3::Info 3}}
on 1631789476
Really great. I used it to replace Cloze overlapping and it does the trick & it has some new helpful features.
on 1631285501
Thank you very much!!! This add-on is amazing!

There is a conflict with Popup Dictionary. The conflict is the "<script src="_jquery-3.2.1.min.js"> <script>" write in note "Enhanced Cloze 2.1 v2". Can I remove it manually, or it is fundamental to keep Enhanced Cloze (for Anki 2.1) working?

Thanks.
Comment from author
I fixed this in the newest update! (It was not fundamental by the way)
on 1629362753
Really nice add-on!!. Is there a way to disable "type the answer"? it happens to me in the anki version for iPad.

Edit: Thanks for the update!!
Comment from author before post was edited
The last update should fix this. :)
on 1629321831
The first card works, but all the other cards show the message "This is an example [ ]".
I just cleaned all AppData files and reinstalled Anki. There's no other add-on installed.
Why is this happening?

Edit: The update worked!
Comment from author
Sorry, I just uploaded an update that should fix this. You may have to check for updates (Tools->Add-ons->Check for updates) for it to appear. Edit: Great! :)
on 1628262970
Very interesting!
on 1628212923
Nice!