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.

Showing page 2 out of 5. View the first page

  1. 31 Posted by Ivcota on 13 Apr, 2017 03:51 PM

    Ivcota's Avatar

    Hey this is a great addon thanks very much! I can't however get the cards to work on ankidroid, or anki web. Is it not compatible?

  2. 32 Posted by John on 14 Apr, 2017 02:31 PM

    John's Avatar

    @Ivcota, you can only add on desktop and use anywhere

  3. 33 Posted by Sebastian on 20 Apr, 2017 07:45 AM

    Sebastian's Avatar

    Hey guys,

    got this error message on trying to add a card. It's not possible anymore…
    The card was not a cloze overlapping card, but since the error contains "cloze_overlapper" I think this is the right place to discuss that?

    Best regards,
    Sebastian

    In einer Erweiterung trat ein Fehler auf.
    Bitte diesen im Erweiterungsforum beschreiben:
    https://anki.tenderapp.com/discussions/add-ons

    Traceback (most recent call last):
      File "anki/hooks.pyc", line 61, in repl
      File "/Users/MrTre/Library/Application Support/Anki2/addons/cloze_overlapper/main.py", line 256, in onAddCards
        return _old(self)
      File "aqt/addcards.pyc", line 186, in addCards
      File "anki/hooks.pyc", line 61, in repl
      File "/Users/MrTre/Library/Application Support/Anki2/addons/cloze_overlapper/main.py", line 331, in onAddNote
        note = _old(self, note)
      File "aqt/addcards.pyc", line 172, in addNote
      File "anki/collection.pyc", line 253, in addNote
      File "anki/notes.pyc", line 47, in flush
    AssertionError

  4. 34 Posted by Sebastian on 20 Apr, 2017 07:55 AM

    Sebastian's Avatar

    Edit to my first post: After third try adding cards was possible again without having touched anything in-between. Kinda mysterious to me.

  5. 35 Posted by Glutanimate on 20 Apr, 2017 09:48 AM

    Glutanimate's Avatar

    @Sebastian:

    Glad to hear that it's resolved. The reason cloze overlapper appeared in the error message is because it hooks into the addCards function. It does so to check whether an overlapping cloze has been added to the collection. If that's not the case it goes back to executing the regular Anki function, which is signified by _old(self, note) in the code above. The actual error happened downstream from that execution point, while flushing the note. It was likely caused by a different add-on or Anki itself.

  6. 36 Posted by ahbonte on 29 Apr, 2017 02:57 PM

    ahbonte's Avatar

    Hi there,

    Love this add on so very much, but just today when I go to review some of the cards I created, only the first deletion comes up. The others come up as ellipses, but I never end up being quizzed on them. Some of the cards I made today work, some don't. Very confused! Already reset to defaults, reinstalled overlapper, and restarted anki.

    Attached the front of card with overlapping deletions and the edit page for that card. When I show the answer and select a difficulty button, it just moves on to the next card, but not the next deletion in that card. Oddly, when I preview the card in the browser, it works properly. I feel like I'm missing something pretty easy to fix, but I can't figure it out.

    EDIT: It looks like it has something to do with the ordering of cards in my decks? The cards that have titles seem to be okay, but the overlapping cards without titles sort first by their absent name, and then by the "card" field, so I get cloze-ol 1 of one card, and then of the next. Going to try adding titles to the ones without them, but is there another way?

    EDIT 2: adding a title worked for one set, but not another. It does seem to be related to their position in the deck though. Take the following example:

    That same heart sounds card in the browser shows cloze-ol 1 for that set of overlapping clozes at position 29. However, the other 3 clozes and cloze-ol 21 are listed as position 776. Any ide how to reset that and/or make sure it doesn't keep happening?

    EDIT 3: Sorry everyone, I'm relatively new to Anki. It seems the custom study I was generating confused the hell out of the positioning. Looks like if I make the custom deck, open it in the browser, sort by created date & time, then use the Reposition function, all works as planned.

    Thank you again for all your help!

  7. 37 Posted by Glutanimate on 29 Apr, 2017 05:18 PM

    Glutanimate's Avatar

    @ahbonte:

    Yeah, I think the custom study option creates randomized decks by default.

    In any case, thanks for documenting your solution here! I'm sure it will help other users who run into the same issue.

  8. 38 Posted by Iverson Diles on 29 Apr, 2017 05:50 PM

    Iverson Diles's Avatar

    Oh sry, you responded to my question in the YouTube comments as well. I
    believe you can add cards in a deck that is under a group that has disabled
    buried related cards unchecked on Android. I'm not sure
    but I think this is the case.

  9. 39 Posted by ImAUsername on 30 Apr, 2017 07:33 AM

    ImAUsername's Avatar

    Hi, Glutanimate,

    Thank you so much for making such a useful addon to help Anki user to memorize lists!

    When using Cloze Overlapper in Anki PC (windows), I found some text in the "scheduling" option of "General" setting is missing because it is too long to show properly (see the attached screenshot 1). It would be better if the text size could adjust automatically or if the pop-up window of Cloze Overlapper Option could be adjusted manually.
    The cloze part in the list will be highlighted (bold and blue), it's a very "eyes-friendly" feature. I'm wondering if the counterpart in "Full" field could be highlighted, too. In that case, users could locate the target (cloze part) much easier (see the attached screenshot 2).

    Thanks again for your amazing addon!
    Best regards,
    Liam

  10. 40 Posted by aPaci on 30 Apr, 2017 10:13 AM

    aPaci's Avatar

    How can I add more text fields? I modified the card template in order to add them, but in this way while I'm reviewing it doesn't show the "show original" link at the bottom, but instead it shows the original line.

    Screenshot here:

  11. 41 Posted by Glutanimate on 30 Apr, 2017 06:40 PM

    Glutanimate's Avatar

    @aPaci:

    That's weird. Could you post your front and back template here, so I can take a look?

    You can wrap the code with three backticks to preserve its formatting:

    ```

    code here

    ```

  12. 42 Posted by Glutanimate on 30 Apr, 2017 06:48 PM

    Glutanimate's Avatar

    @Liam:

    Glad you've found the add-on useful!

    Thanks for letting me know about the issue with the labels. I'll see if I can fix this for the next release (which might be a while, though, because of uni).

    As for highlighting the current answer, I like the idea! I'm not entirely sure if this will be feasible to implement (since it will require a bit of JS trickery), but I'll definitely give this a look when I get the chance.

  13. 43 Posted by warlock war on 30 Apr, 2017 07:21 PM

    warlock war's Avatar

    вс, 30 апр. 2017 г. в 21:48, Glutanimate <[email blocked]>:

  14. 44 Posted by aPaci on 30 Apr, 2017 07:21 PM

    aPaci's Avatar

    @Glutanimate

    I didn't changed the card template, I only modified the fields
    The problem is only with the front card

    ```
    <div class="front">
      {{#Title}}<div class="title">{{Title}}</div>{{/Title}}
      <div class="text">
        {{cloze:Text1}}
        {{cloze:Text2}}
        {{cloze:Text3}}
        {{cloze:Text4}}
        {{cloze:Text5}}
        {{cloze:Text6}}
        {{cloze:Text7}}
        {{cloze:Text8}}
        {{cloze:Text9}}
        {{cloze:Text10}}
        {{cloze:Text11}}
        {{cloze:Text12}}
        {{cloze:Text13}}
        {{cloze:Text14}}
        {{cloze:Text15}}
        {{cloze:Text16}}
        {{cloze:Text17}}
        {{cloze:Text18}}
        {{cloze:Text19}}
        {{cloze:Text20}}
        {{cloze:Full}}
        <div class="hidden">
           <div>{{Original}}</div>
        </div>
      </div>
    </div>
    <div style='font-family: Arial; font-size: 20px;'>{{Text20}}</div>
    ```

    ```
    <div class="back">
      {{#Title}}<div class="title">{{Title}}</div>{{/Title}}
      <div class="text">
        {{cloze:Text1}}
        {{cloze:Text2}}
        {{cloze:Text3}}
        {{cloze:Text4}}
        {{cloze:Text5}}
        {{cloze:Text6}}
        {{cloze:Text7}}
        {{cloze:Text8}}
        {{cloze:Text9}}
        {{cloze:Text10}}
        {{cloze:Text11}}
        {{cloze:Text12}}
        {{cloze:Text13}}
        {{cloze:Text14}}
        {{cloze:Text15}}
        {{cloze:Text16}}
        {{cloze:Text17}}
        {{cloze:Text18}}
        {{cloze:Text19}}
        {{cloze:Text20}}
        {{cloze:Full}}
        <div class="hidden">{{Original}}</div>
      </div>
      <div class="extra"><hr></div>
      <div class="text"><div class="fullhint">{{hint:Original}}</div></div>
      <div class="extra">
        {{#Remarks}}
        <div class="extra-entry">
          <div class="extra-descr">Remarks</div><div>{{Remarks}}</div>
        </div>
        {{/Remarks}}
        {{#Sources}}
        <div class="extra-entry">
          <div class="extra-descr">Sources</div><div>{{Sources}}</div>
        </div>
        {{/Sources}}
      </div>
    </div>
    <script>
      // remove cloze syntax from revealed hint
      var hint = document.querySelector('.fullhint>[id^="hint"]')
      var html = hint.innerHTML.replace(/\[\[oc(\d+)::(.*?)(::(.*?))?\]\]/mg, "$2")
      hint.innerHTML = html
      // scroll to cloze
      document.addEventListener('DOMContentLoaded', function() {
        setTimeout(function(){
          const cloze1 = document.getElementsByClassName("cloze")[0];
          const rect = cloze1.getBoundingClientRect();
          const absTop = rect.top + window.pageYOffset;
          const absBot = rect.bottom + window.pageYOffset;
          if (absBot >= window.innerHeight) {
            const height = rect.top - rect.bottom
            const middle = absTop - (window.innerHeight/2) - (height/2);
            window.scrollTo(0, middle);};
        }, 1);
      }, false);
    </script>
    ```

  15. 45 Posted by Glutanimate on 30 Apr, 2017 07:28 PM

    Glutanimate's Avatar

    @aPaci:

    Ah, I see. You'll also have to append the new text fields to your templates. For instance, if you added three fields - Text21, Text22, and Text23 - your front and back templates should look like this:

    <div class="front"> 
      {{#Title}}<div class="title">{{Title}}</div>{{/Title}} 
      <div class="text"> 
        {{cloze:Text1}} 
        {{cloze:Text2}} 
        {{cloze:Text3}} 
        {{cloze:Text4}} 
        {{cloze:Text5}} 
        {{cloze:Text6}} 
        {{cloze:Text7}} 
        {{cloze:Text8}} 
        {{cloze:Text9}} 
        {{cloze:Text10}} 
        {{cloze:Text11}} 
        {{cloze:Text12}} 
        {{cloze:Text13}} 
        {{cloze:Text14}} 
        {{cloze:Text15}} 
        {{cloze:Text16}} 
        {{cloze:Text17}} 
        {{cloze:Text18}} 
        {{cloze:Text19}} 
        {{cloze:Text20}} 
        {{cloze:Text21}} 
        {{cloze:Text22}} 
        {{cloze:Text23}} 
        {{cloze:Full}} 
        <div class="hidden"> 
           <div>{{Original}}</div> 
        </div> 
      </div> 
    </div> 
    <div style='font-family: Arial; font-size: 20px;'>{{Text20}}</div>
    
    <div class="back"> 
      {{#Title}}<div class="title">{{Title}}</div>{{/Title}} 
      <div class="text"> 
        {{cloze:Text1}} 
        {{cloze:Text2}} 
        {{cloze:Text3}} 
        {{cloze:Text4}} 
        {{cloze:Text5}} 
        {{cloze:Text6}} 
        {{cloze:Text7}} 
        {{cloze:Text8}} 
        {{cloze:Text9}} 
        {{cloze:Text10}} 
        {{cloze:Text11}} 
        {{cloze:Text12}} 
        {{cloze:Text13}} 
        {{cloze:Text14}} 
        {{cloze:Text15}} 
        {{cloze:Text16}} 
        {{cloze:Text17}} 
        {{cloze:Text18}} 
        {{cloze:Text19}} 
        {{cloze:Text20}} 
        {{cloze:Text21}} 
        {{cloze:Text22}} 
        {{cloze:Text23}} 
        {{cloze:Full}} 
        <div class="hidden">{{Original}}</div> 
      </div> 
      <div class="extra"><hr></div> 
      <div class="text"><div class="fullhint">{{hint:Original}}</div></div> 
      <div class="extra"> 
        {{#Remarks}} 
        <div class="extra-entry"> 
          <div class="extra-descr">Remarks</div><div>{{Remarks}}</div> 
        </div> 
        {{/Remarks}} 
        {{#Sources}} 
        <div class="extra-entry"> 
          <div class="extra-descr">Sources</div><div>{{Sources}}</div> 
        </div> 
        {{/Sources}} 
      </div> 
    </div> 
    <script> 
      // remove cloze syntax from revealed hint 
      var hint = document.querySelector('.fullhint>[id^="hint"]') 
      var html = hint.innerHTML.replace(/\[\[oc(\d+)::(.*?)(::(.*?))?\]\]/mg, "$2") 
      hint.innerHTML = html 
      // scroll to cloze 
      document.addEventListener('DOMContentLoaded', function() { 
        setTimeout(function(){ 
          const cloze1 = document.getElementsByClassName("cloze")[0]; 
          const rect = cloze1.getBoundingClientRect(); 
          const absTop = rect.top + window.pageYOffset; 
          const absBot = rect.bottom + window.pageYOffset; 
          if (absBot >= window.innerHeight) { 
            const height = rect.top - rect.bottom 
            const middle = absTop - (window.innerHeight/2) - (height/2); 
            window.scrollTo(0, middle);}; 
        }, 1); 
      }, false); 
    </script>
    
  16. 46 Posted by mchirmure on 10 May, 2017 05:22 PM

    mchirmure's Avatar

    Hi

    I don't know whether its a bug, but sometimes when I use the "Ctrl + R (or the corresponding button, both in Editor and Browser)" to remove formatting (say red color) from some formatted text (red colored text), Anki crashes.

    I am using Anki 2.0.44 on Windows 7 and latest version of Cloze (overlapper)

    Also, I have 60 extra fields (instead of the 20 that the addon comes with), so let me know if that could be the problem.

  17. 47 Posted by Glutanimate on 12 May, 2017 08:36 PM

    Glutanimate's Avatar

    @michrmure:

    That's strange. Are you sure this is exclusive to the overlapping cloze note type? If not, it's likely an issue with Anki itself as the add-on does not interact with the formatting removal feature.

  18. 48 Posted by roger on 14 May, 2017 04:33 AM

    roger's Avatar

    I have a problem after creating a cloze (overlapping) and synchronizing it to AnkiMobile(ios): it does not work.
    I attached some files where you can see that it works on PC, but on AnkiMobile it stops after the first cloze.

    Please let me know if there is anything else that I should be configuring to be able to use the OC on iOS.

  19. 49 Posted by Glutanimate on 14 May, 2017 01:21 PM

    Glutanimate's Avatar

    @roger: You'll have to disable burying of related cards in your deck options (both for new cards and reviews).

  20. 50 Posted by roger on 14 May, 2017 04:17 PM

    roger's Avatar

    Hi Glutanimate

    Thanks for answering so quickly.

    I unchecked both boxes, I synchronized the ios application, I restarted it, but it's the same: only the first cloze shows up and than it directly asks me to pick 1m/10m/4h as in picture no2.

    Is there smth else I can do?

  21. 51 Posted by Glutanimate on 14 May, 2017 04:29 PM

    Glutanimate's Avatar

    Each cloze generates a separate card, so that's the expected behaviour. If you'd like to be questioned about more than one item at once you will have to mark them with the same cloze index. Even then, though, the items will not be revealed gradually when reviewing but rather all be unveiled at once when showing the answer.

    Overlapping clozes work exactly like regular clozes in that regard.

  22. 52 Posted by hussdagoose on 15 May, 2017 07:57 PM

    hussdagoose's Avatar

    Hi Glutanimate,
    Awesome add-on, you're the man.
    I'm still learning the ropes of Anki, so I apologize for the amateur question in advance, but I haven't been able to find a solution here or elsewhere online.

    Is there any way I can configure my Anki settings to make it so that cloze-overlap only ever shows me a set of cards together, and in order?

    e.g. say I have this list

    The five basic tastes are
    1) sweet
    2) sour
    3) salty
    4) bitter
    5) umami (savory)

    this will generate 5 cards, each with the taste 1-5. Great.

    However, when I add these to a deck, they very quickly get shuffled between other cards, especially if I rate them with different difficulty levels -- some take longer to appear, etc..

    Is there a way these 5 cards can be grouped into a 'batch' that are only ever presented together, and in order? From another user's question above, I thought that checking the two 'override ..... ' specifications under General in settings (see attachment) should have helped with this -- but it doesn't.

    Hopefully my question makes sense, and thanks again for this awesome add on.

  23. 53 Posted by roger on 16 May, 2017 02:25 AM

    roger's Avatar

    Exactly @hussdagoose, that's what I thought OC does too. I watched the youtube instructions which were great, but it seems it does not behave like you and me thought it did.

    On the github page https://github.com/glutanimate/cloze-overlapper, the short gifs were clear enough for me that the list will operate inplace with a 'next' button.
    I even bought the ios application because of this add-on which anyway is a great one.
    Thanks again for the effort of making this available.

  24. 54 Posted by Glutanimate on 16 May, 2017 05:38 AM

    Glutanimate's Avatar

    @hussdagoose and Roger:

    Once your cards enter the learning/review queue they are subject to Anki's scheduling which will present them to you when they're due while also randomizing the reviews of that session. I'm afraid there's no simple way to change that. But even if there were it would probably not be a good idea since each cloze item constitutes a separate piece of information. For instance: What would happen if you recalled step 5 -> 6 better than step 2 -> 3? How would Anki be able to account for that if it was set to always show you the cards in one batch?

  25. 55 Posted by hussdagoose on 17 May, 2017 01:56 AM

    hussdagoose's Avatar

    Thanks for the reply @glutanimate. Yeah I see your point, and I understand it's probably difficult to override the anki shuffling based on difficulty since it almost goes against the concept of it.

  26. 56 Posted by albertodelucca on 23 May, 2017 09:19 PM

    albertodelucca's Avatar

    Hey @Glutanimate,

    How can I install the add-on directly from your github repo? I cloned repo, made a release (make release), unzipped both files from the zip and moved to the Anki Addons folder. When I restart Anki, it reports an error (see below).

    I'd like to figure this out to avoid having to update addons through the official webpage workflow.

    —Alberto

    An error occurred in an add-on.
    Please post on the add-on forum:
    https://anki.tenderapp.com/discussions/add-ons
    
    Traceback (most recent call last):
      File "aqt/addons.pyc", line 41, in loadAddons
      File "/Users/alberto/Library/Application Support/Anki2/addons/Cloze Overlapper.py", line 15, in <module>
      File "/Users/alberto/Library/Application Support/Anki2/addons/cloze_overlapper/main.py", line 28, in <module>
      File "/Users/alberto/Library/Application Support/Anki2/addons/cloze_overlapper/config.py", line 19, in <module>
    ImportError: cannot import name settings_global
    
  27. 57 Posted by albertodelucca on 23 May, 2017 09:47 PM

    albertodelucca's Avatar

    NVM - I found out through the make trace that pyuic4 is not being found when running the build_ui.sh script. So the forms folder is not being generated. I don't think I have PyQt4 installed so I think that's why it must be failing.

    I thought Anki was registering something upon install that didn't happen when manually moving folders around, but it doesn't seem to. It's just a bad generation on my part.

  28. 58 Posted by Glutanimate on 25 May, 2017 04:08 PM

    Glutanimate's Avatar

    Hey Alberto,

    glad to hear it's working now! Thanks for documenting your solution. That should make things easier for future users.

  29. 59 Posted by silence820 on 10 Jun, 2017 02:21 AM

    silence820's Avatar

    I think I have broken my cloze overlapper. I was trying to add a type the answer field and inadvertently deleted the script. I tried uninstalling and reinstalling the addon but it did not work. can someone please help?

  30. 60 Posted by Glutanimate on 11 Jun, 2017 03:42 PM

    Glutanimate's Avatar

    @silence:

    You can restore your card templates by following the instructions in the wiki: https://github.com/glutanimate/cloze-overlapper/wiki/Troubleshootin...

    If you haven't added any overlapping cloze cards to your collection, yet, you can also simply delete the note type. The add-on will automatically create a new one the next time you use it. Once again, please only do this if you don't have any existing cloze overlapper notes. Otherwise all of them will be lost.

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