Cloze Overlapper [Official thread]

Glutanimate's Avatar

Glutanimate

25 Feb, 2017 07:47 PM

This is the official support thread for Cloze Overlapper. Please direct all of your questions, suggestions, and support requests regarding the add-on here.

  1. 1 Posted by Glutanimate on 01 Mar, 2017 04:28 PM

    Glutanimate's Avatar

    This is it, folks. Cloze Overlapper for Anki is finally available on AnkiWeb. Please give it a try and let me know what you think!

  2. 2 Posted by dgbeecher on 02 Mar, 2017 06:02 PM

    dgbeecher's Avatar

    Thanks for this great add-on! It is working great.

    Two minor notes:

    Following your instructions around minute 11 of the longer tutorial video, I've been using (on the Mac) Command-Option-Shift-Comma or Period to create bulleted and numbered lists. Thanks for adding this function; it's convenient. However, although previews are generated when creating a bulleted/numbered list, or switching from one to the other, it seems that the preview is not updated if I remove the list formatting. For example, if I hit Cmd-Opt-Shift-Period on an already-numbered list, this removes the numbers in the "Original" field, but does not change the other fields (Text1, Text2, etc.). In order to get these fields to update, I have to click the "Generate Overlapping Clozes" button again.

    And, somewhat relatedly, is there a way to change the hotkeys for any of these functions?

  3. 3 Posted by Glutanimate on 02 Mar, 2017 08:28 PM

    Glutanimate's Avatar

    @dgbeecher:

    Thanks for the feedback and suggestions! I've fixed the issue with list toggling for the next release.

    As for defining custom key bindings, I'd like to implement a proper options tab for this at some point, but I'm afraid I don't have the time for that right now. For now I've restructured all key definitions for the next release, so that they'll be easier to edit manually at the top of the source code (similar to other add-ons). Hope that helps!

    You should definitely look into using the Power Format Pack, though (if you haven't done so already). It comes with a lot more formatting options, lists included, and completely customizable key bindings!

  4. 4 Posted by Glutanimate on 03 Mar, 2017 02:26 PM

    Glutanimate's Avatar

    Quick heads-up: v0.2.1 of Cloze Overlapper is out!

    Changelog:

    • New: Add a hotkey and button to remove clozes from selected text (Alt+Shift+R), also works with regular clozes
    • Fixed: List toggling now works properly again (thanks to Devin for the report)
    • Fixed: Sanity check to prevent empty notes if the user doesn't add enough items to cloze
    • Changed: Moved key binding definitions to the top of main.py, allowing advanced users to manually customize them
    • Changed: Reduced minimum number of cloze items to two

    If you'd like to customize the key bindings of the add-on you can now do so by editing the "Hotkey definitions" section at the top of cloze_overlapper/main.py. To get to that file simply go to Tools -> Add-ons -> Open add-on directory within Anki. Please note, however, that any changes you might apply will be reset upon reinstalling or updating the add-on.

  5. 5 Posted by Jon on 06 Mar, 2017 02:14 AM

    Jon's Avatar

    I love this add-on! I wanted, however to disable the card that is added that shows all the cloze blanks at once. How can I do this? I mainly use this add-on for the context before feature so that is why. Thanks!

  6. 6 Posted by Glutanimate on 06 Mar, 2017 01:38 PM

    Glutanimate's Avatar

    Hey Jon,

    there will be an option for this in the next update. What you can do until then is to generate the cloze deletions manually (using Alt+Shift+C or the button in the toolbar), and then delete the contents of the "Full" field. You will have to repeat this any time you edit the note, however.

  7. 7 Posted by Chris on 06 Mar, 2017 03:39 PM

    Chris's Avatar

    This happened when attempting cloze deletion in the stock cloze template (ctrl-shift-c) from within the browser. Normally it would work without incident, but it appears to have triggered some sort of error in your code:

    Traceback (most recent call last):
      File "anki\hooks.py", line 61, in repl
      File "C:\Users\cwood\Documents\Anki\addons\cloze_overlapper\main.py", line 115, in onInsertCloze
        if not checkModel(self.note.model(), fields=False, notify=False):
      File "C:\Users\cwood\Documents\Anki\addons\cloze_overlapper\main.py", line 174, in checkModel
        config = mw.col.conf["olcloze"]
    KeyError: 'olcloze'

    Nice add-on, btw!

  8. 8 Posted by Glutanimate on 06 Mar, 2017 04:29 PM

    Glutanimate's Avatar

    Thanks for the report, Chris. Not sure what happened there as the add-on explicitly sets up a config entry if it doesn't find one when Anki is started. The only instances I can think of where this might happen are:

    1. Restoring Anki's collection from a previous back-up that didn't have the add-on config set up, yet
    2. Performing a full sync from a device where the add-on hasn't been used, yet

    In any case, thanks for bringing this to my attention. I'll see if I can add some more checks to account for rare scenarios like these.

    Restarting Anki should fix the error for now.

  9. 9 Posted by cidrolin on 06 Mar, 2017 07:20 PM

    cidrolin's Avatar

    This add-on is a very nice idea.

    Some suggestions:

    • Automatically add the required number of "Text" fields in note model if "original" needs more room (at this time there is only a verification, thus a good point)
    • In order to be more useful for learning poetry, add the management of blank lines of these "list". For blank line, a special symbol, as in LPCG, or a blank line.
    • Maybe also, a (optional) mark for beginning and end of list

    Have a nice day.

  10. 10 Posted by cidrolin on 06 Mar, 2017 09:25 PM

    cidrolin's Avatar

    Well... Regarding my bullet #2: maybe marking blank lines between stanza is too much context?

    If i want to remember a poetry, i must be able to recap line by line, without knowing that I end or begin a stanza.

    So i correct my previous post:

    • ...
    • ... For blank line, an optional marker... But under the hidden text, (full recap of answer) text and blank lines (as in "original")
    • ...

    Have a nice day!

  11. 11 Posted by Glutanimate on 07 Mar, 2017 05:44 PM

    Glutanimate's Avatar

    cidrolin, thanks for taking the time to compile these suggestions!

    As for automatically extending the note type with more fields, I decided against that as it would force a full sync anytime users went over the item limit. It could also lead to performance issues down the line as Anki wasn't meant to handle note types with too many fields, especially with a note type like this where the same information is duplicated again and again across all Text fields.

    I think we're at a good compromise with 20 item slots. You can extend that if you'd like, but I'd argue that at that point it might be a better idea to simply split up the input into multiple notes, e.g. one for each stanza of a poem.

    As far as your other points are concerned: Cloze Overlapper was primarily designed with lists and enumerations in mind. Your suggestions could definitely streamline the note creation process for poems, but this isn't the direction I'd like to take the add-on in.

    However, one of the great things about Cloze Overlapper is its flexibility. I think that, if you play around a bit with custom cloze markers ([[c1::etc]]), you'll find that you should be able to replicate most of these things manually.

  12. 12 Posted by cidrolin on 07 Mar, 2017 07:37 PM

    cidrolin's Avatar

    I see your point regarding the number of items. Nevertheless, I've tried with a short poem (42 lines), in order to see if there is trouble with performances.

    I know that I could use LPCG, but it seems too me it"s just not rational to generate 42 cards for one poem (so no sibling management, and data spread accross 42 notes !).

    In any case, thanks for your time.

  13. 13 Posted by cidrolin on 07 Mar, 2017 07:59 PM

    cidrolin's Avatar

    If I use this field as cloze

    {{c1::Que sont mes amis devenus
    Que j'avais de si près tenus
    Et tant aimés::3 vers}}
    {{c2::Ils ont été trop clairsemés
    Je crois le vent les a ôtés
    L'amour est morte::3 vers}}
    (more lines ommited)
    

    I can achieve what I want with JS on the full text of this poem (one note with cloze), like that :

    <div id="cloze"></div>
    <script>
    var cloze = "{{cloze:Texte}}";
    cloze = cloze.replace(/\].+[^$]/,'] </span></div>. . .</div> ');
    document.getElementById("cloze").innerHTML =cloze;
    </script>
    

    and you get :

    [3 vers]
    . . .
    
    and
    Que sont mes amis devenus
    Que j'avais de si près tenus
    Et tant aimés
    [3 vers]
    . . .
    
    (and so on) because in my case, I just want to hide the next lines. I need to refined that, but...

    Anyway, I don't want to "hitch-hike" your topic, see you around ! Many thanks for ideas!

  14. 14 Posted by Glutanimate on 07 Mar, 2017 10:21 PM

    Glutanimate's Avatar

    @cidrolin:

    Thanks for sharing these template snippets! I'm sure they'll be useful.

    @everyone:

    v0.3.0 is here:

    • New: Option to disable full cloze card generation (thanks to smh, dtconan18, Jon, and everyone else who suggested this)
    • New: Option to automatically suspend full cloze cards on creation
    • Fixed: More checks to prevent rare missing config errors (thanks to Chris for the bug report)
  15. 15 Posted by Chris on 11 Mar, 2017 03:04 AM

    Chris's Avatar

    Thanks for the update. I'm about to download that, but would like to mention some behavior I noticed in the previous version and am not sure if you're aware of:

    Cloze overlapper is a little *too* happy to generate new cloze lines. It seems that anytime there is a change of font/color/style/etc, Cloze Overlapper considers it a new line. So if I make some bold text in the middle of a single fact, it will treat it as 3 lines, with the text preceding and following the emboldened text as.

    Example (as HTML): foo <b>and</b> bar
    turns into some form of:
    {{c1::foo}}
    {{c2::and}}
    {{c3::bar}}

  16. 16 Posted by Glutanimate on 11 Mar, 2017 09:42 PM

    Glutanimate's Avatar

    @Chris:

    Thanks for letting me know. Splitting HTML up into lines can be rather tricky and it looks like the library I use is rather overzealous when deciding which tags constitute a linebreak. I will see if I can find a replacement.

    Until then I'd suggest you go with manual cloze definitions whenever your input contains any type of HTML formatting. To do so either use CTRL+SHIFT+C on each individual line, or select multiple lines and use the CTRL+SHIFT+D hotkey.

  17. 17 Posted by AJ on 14 Mar, 2017 01:07 PM

    AJ's Avatar

    Hello,

    This app looks fantastic and I'm excited to get it to work. I am running into one problem however. I'm not finding the "Show Original" link at the bottom, but instead, the original list is always visible beneath my final closed bracket on every card. (attaching screenshot)

    Have you ran into this before?

    Thanks in advance.

  18. 18 Posted by Glutanimate on 14 Mar, 2017 02:29 PM

    Glutanimate's Avatar

    @AJ:

    Have you modified the card template by any chance? If so, please try resetting it to the defaults. If that doesn't work a different add-on might be interfering with the template styling (specifically the .hidden CSS class).

  19. 19 Posted by AJ on 15 Mar, 2017 04:03 AM

    AJ's Avatar

    @Glutanimate

    I'm going to guess it is a conflicting addon. Ultimately, I was able to get the cards to generate correctly, by deleting {{original}} out from the <div>{{Original}}</div> on both the front and back template.

    I'm also noticing that cards don't seem to be changing colors per your default settings, which I think is more evidence that there is a conflict with pre-existing addons; I've got a lot in there.

  20. 20 Posted by vidale3 on 26 Mar, 2017 06:56 AM

    vidale3's Avatar

    I'm having trouble getting the cards to show up in sequential order even after checking the box to override the default anki mode that mixes them up based off how you rate them. I even had my friend try it out and make sure to check both of the boxes and he says his are showing up in review cards mixed as opposed to being grouped together in order, is there a quick fix for this Glutanimate or are we doing something wrong? I included screenshots of my settings and example card that i made, Thanks so much

  21. 21 Posted by Glutanimate on 26 Mar, 2017 07:12 AM

    Glutanimate's Avatar

    Hi vidale,

    these options will only disable sibling-spacing, not affect the general order of your card reviews. New cards are generally presented in the order they were added. A soon as your cards leave the new queue they are subject to Anki's default review scheduling which randomizes card sightings.

    The idea behind these two options is to allow you to review more than one card of a given sequence per day. By default Anki would bury all pending reviews of the same note until the next day. With the option active that behaviour is overriden for cloze overlapper cards.

  22. 22 Posted by cidrolin on 28 Mar, 2017 06:30 PM

    cidrolin's Avatar

    Suppose you're on the go and run across a mistake in one of you're card. You correct it in the Original field... Two days later you're back in front of your computer and cannot at no cost remember which card was erroneous, and dig into hundreds of Cloze Overlapper notes. (A bit dramatic, but well, we use Anki to strengthen up our memory!)

    In this aventure, I think it would be useful to have an option Generate overlapping cards for all notes in the Cloze Overlapper menu.

  23. 23 Posted by warlock war on 29 Mar, 2017 10:57 AM

    warlock war's Avatar

    Great addon, Glutanimate! I also follow 20 rules of formulating knowledge to create my cards.

    In almost each case i create custom anki Note type by cloning basic one. I cloned "Cloze (overlapping)" note type, made some changes (added custom fields), and can't generate cards now by clicking "Generate overlapping clozes".

    Will it be possible to generate cards in future or it is limitation of the addon?

  24. 24 Posted by Glutanimate on 29 Mar, 2017 11:28 PM

    Glutanimate's Avatar

    @cidrolin:

    Thanks for the suggestion! An option like this could definitely be useful. Unfortunately I won't have time to work on new features anytime soon, but I'll add this to my to-do list.

    @warlock:

    Glad you like it!

    So the way the add-on checks whether the note is set to the right note type is three-fold:

    1. It checks whether the note type's name starts with "Cloze (overlapping)". This is to support imported notes from other users which are usually assigned a new note type that is named something like "Cloze (overlapping)-ax0102ad"
    2. If the first check fails the add-on looks at the config option for custom overlapping cloze note types. Any names you add to the comma-separated list of supported note types will be recognized by the add-on
    3. In both of the cases above, the add-on will also check whether your note type contains all of the required fields

    Depending on your locale your cloned note type might not follow the naming scheme in 1.). If that's the case, either try renaming it, or add the name of your custom note type to the overlapping cloze note types list, as described in 2.).

    Whatever you do, make sure to preserve all of the required fields as described in 3.).

  25. 25 Posted by 2.0.36 on 03 Apr, 2017 12:29 PM

    2.0.36's Avatar

    I have just upgraded from 2.0.36 to 2.0.41. However, after reading reports about WiFI lag spike with 2.0.41, am planning to figure out how to move back to using the 2.0.36 version, if possible without losing my data. It says on the FAQ that cloze expander needs 2.0.37 and above - what will happen if I try to install it on 2.0.36? Will it not run, or will ir somehow break anki? Sorry for the lack of technical or programming knowledge. Thanks so much!

  26. 26 Posted by John on 03 Apr, 2017 01:42 PM

    John's Avatar

    bug report:
    Ctrl + Shift + D doesn't work after `Power Format Pack` installation.

  27. 27 Posted by Glutanimate on 03 Apr, 2017 06:28 PM

    Glutanimate's Avatar

    Regarding backwards compatibility with earlier Anki releases: The add-on should still work for the most part, but you might run into an error message every now and then. It won't break Anki in any way. At worst, the add-on won't work properly.

    However, please understand that I can't provide any official support for earlier Anki versions; and as the development of the add-on moves along, what I wrote above might change (i.e. using the add-on might start to break things in Anki).

    @ John: I think the hotkeys are configurable in the PFP add-on, so you could try changing the corresponding key assignment (looks like it's the "definition list" hotkey).

  28. 28 Posted by John on 03 Apr, 2017 07:15 PM

    John's Avatar

    I have no Idea how to change PFP hotkeys, Could you please tell me where did you define hotkeys in your add-ons?
    So I can change it to something else...

  29. 29 Posted by Glutanimate on 03 Apr, 2017 07:19 PM

    Glutanimate's Avatar

    Here is the documentation for Power Format Pack.

    To change the hotkeys in Cloze Overlapper please see above.

  30. 30 Posted by John on 05 Apr, 2017 01:14 PM

    John's Avatar

    Thank you very much, @glutanimate, for the add-ons and for the help. ;p

Comments are closed, but you can start a new discussion.

Keyboard shortcuts

Generic

? Show this help
ESC Blurs the current field

Comment Form

r Focus the comment reply box
^ + ↩ Submit the comment

You can use Command ⌘ instead of Control ^ on Mac