anki-addons-misc icon indicating copy to clipboard operation
anki-addons-misc copied to clipboard

[More answer buttons 2.1 port] Editor suddenly showing in reviewer

Open Z1839 opened this issue 5 years ago • 10 comments

I've been using the "More answer buttons" port for 2.1 for a few days without any issues. However, just today out of nowhere there's a strange bug where whenever I select one of the extra buttons, my reviewer shows the "Waiting for editing to finish" with the "resume now button" as if I was editing a card. However, the editor is not open, just the aformentioned screen. I can click resume now to resume my study, but it happens every time I select any of the new buttons now.

Z1839 avatar Apr 12 '19 22:04 Z1839

I realized that this happens when I edit the config in "ReMemorizer" to "false, false" to enable the browser reschedule feature. Very strange.

Z1839 avatar Apr 12 '19 22:04 Z1839

Thanks for your report.

I just tried and can't reproduce the error after rating about 35 new cards.

Here's what I did:

I removed my addons21 folder (I just renamed it so that after this trial I still have my addons). Then I started the latest Anki version which is 2.1.11. Then I installed two add-ons :

  • "more answer buttons" via drag and drop from here: https://github.com/glutanimate/anki-addons-misc/releases/download/0.1.0-temp/reviewer_more_answer_buttons.ankiaddon
  • "ReMemorize: Rescheduler with sibling and logging" (version from 2019-02-25) by entering the number 323586997 into the download box in the add-on window.

Then I restarted anki and rated some new cards. I think I clicked all available answer boxes.

I didn't change any configuration. The configuration for ReMemorize looks like this for me:

{
    "automatic_mode": false,
    "browser": {
        "replace_brower_reposition": false,
        "replace_brower_reschedule": false,
        "skip_new_card_types_on_reposition": false
    },
    "bury_siblings": false,
    "default_days_on_ask": 7,
    "ef_hotkey": "Ctrl+Shift+M",
    "fg_hotkey": null,
    "forget_siblings": false,
    "fuzz_days": true,
    "hotkey": "Ctrl+M",
    "reschedule_sibling": false,
    "reschedule_siblings_on_again": true,
    "revlog_rescheduled": true,
    "sibling_boundary": 365,
    "sibling_days_max": 20,
    "sibling_days_min": 7
}

I don't notice any strange behavior.

My question:

  • If you use Anki 2.1.11 with the latest versions of these two add-ons can you still reproduce this bug? If so post your config for ReMemorize and "more answer buttons".
  • If you can't use 2.1.11 and another one of your add-ons. Try again and if you don't get the problem add another add-on. Repeat this until you identify which combination of add-ons causes the problem. Then try to remove other add-ons so that you identify which minimal set of add-ons causes the problem. If this feels like too much work: I'm sure that more than 50 people use "More answer buttons" and Rememorize. You might help all of them. If this still doesn't motivate you: Name all the add-ons you use.

ijgnd avatar Apr 14 '19 15:04 ijgnd

Hmm..I forgot to mention that I was using the latest beta build for Anki 2.1 (because of the puppy reinforcement bug I mentioned earlier). Perhaps this was causing the issue.

Z1839 avatar Apr 14 '19 15:04 Z1839

The problem only occurs if you set "replace_brower_reschedule" to true.

ijgnd avatar Apr 14 '19 15:04 ijgnd

this might be also interesting for @lovac42 : the updated version of glutanimate's add-on More Answer Buttons for New Cards for 2.1 from last week which has not been published to ankiweb yet doesn't work with ReMemorize (version from ankiweb from 2019-02-25) if in ReMemorize replace_brower_reschedule is set to true.

ijgnd avatar Apr 15 '19 00:04 ijgnd

Thx I'll check it out

lovac42 avatar Apr 15 '19 00:04 lovac42

The fix was easy, but I'm not sure how to design it. MAB doesn't log properly, it triggers ReMemorize and double logs the reschedules.

I have two possible versions, replace reschedCards() code in main.py with the following.

BROWSER_TAG="_reschedule" if ANKI21 else "reschedule" #TODO: MV to const.py
# Replace scheduler.reschedCards called by browser
def reschedCards(self, ids, imin, imax, _old):
    browConf=remem.conf.get("browser",{})
    if not browConf.get("replace_brower_reschedule",False):
        return _old(self, ids, imin, imax)

    for i in range (2,5): #only pause state for browser calls
        f=sys._getframe(i)
        if f.f_code.co_name==BROWSER_TAG:
            mw.requireReset()
            break

    log=remem.conf.get("revlog_rescheduled",True)
    fuzz=remem.conf.get("fuzz_days",True) #for load balance
    runHook('ReMemorize.rescheduleAll',ids,imin,imax,log,fuzz)

Bypass ReMemorize if it's not a call from the browser.

BROWSER_TAG="_reschedule" if ANKI21 else "reschedule" #TODO: MV to const.py
# Replace scheduler.reschedCards called by browser
def reschedCards(self, ids, imin, imax, _old):
    browConf=remem.conf.get("browser",{})
    if not browConf.get("replace_brower_reschedule",False):
        return _old(self, ids, imin, imax)

    for i in range (2,5): #only wrap for browser calls
        f=sys._getframe(i)
        if f.f_code.co_name==BROWSER_TAG:
            mw.requireReset()
            log=remem.conf.get("revlog_rescheduled",True)
            fuzz=remem.conf.get("fuzz_days",True) #for load balance
            runHook('ReMemorize.rescheduleAll',ids,imin,imax,log,fuzz)
            return
    return _old(self, ids, imin, imax) #called by other addons in reviewer.

lovac42 avatar Apr 15 '19 01:04 lovac42

After seeing lovac42's elegant new add-on ReMemorizeButtons from this morning I should mention that the ugly update of MAB for 2.1 was done by me ...

ijgnd avatar Apr 15 '19 09:04 ijgnd

MAB had like 3 or 4 previous authors. Its harder to code when you are influenced by other people's ideas. When you are developing on top of existing code, on top of existing workarounds. My first C program was much uglier, so keep trying.

ReMemorizeButtons is ready for testing now, limit was set for new cards only to prevent abuse. https://github.com/lovac42/ReMemorizeButtons/releases

lovac42 avatar Apr 15 '19 11:04 lovac42

@Z1839 : This issue should be resolved as of ReMemorize v1.1.4. Thanks for reporting.

lovac42 avatar Apr 27 '19 02:04 lovac42