Anki-android: 4th answer button shown when it should NOT be shown (new cards etc)

Created on 27 Sep 2020  路  25Comments  路  Source: ankidroid/Anki-Android

Hey guys, I think it has been at least a couple of weeks now, there are always shown 4 answer buttons, where before on new, notmature or failed cards there were only 3 buttons (fail, hard, good). Now there is always 4, and the forth one on those mentioned cards, has some crazy value (like in the screenshot (again, good(10min), easy (1d), easy (1.3 years!)).

This obviously breaks the whole JavaScript api (as it uses the availability of the 4th button to determine if the cards are mature or not) also and more importantly breaks gestures, as I have the easiest option assigned to swiping right, and it leads not seing a new card for 1.3years right from the start if i don't check before swiping.

image

2.13.x 2.14 Priority-High Reproduced Reviewer

All 25 comments

Hi @danZ4C, thanks for the report!

Could you provide debugging info: Settings - Advanced - About AnkiDroid - Copy Debug Info

A working copy of the deck to be able to reproduce the issue would also be appreciated (with scheduling info, without media).

Thanks,

"notmature" ?
I don't get it.
A mature card is a card whose interval is at least 21 days. As far as I know, there has never ever been a time in anki where knowing whether a card is mature or not change the number of button. So I don't get what you mean.

"fail" ? Do you mean "again" as on the screenshot ? Because I don't recall ever seeing a "fail" button

Really sorry I am not at all familiar with the terminilogy. What happens is this:

I start the attached deck, I don't know a card (fail it) so i press the "again button" then when that card is shown to me again whilst revising it will have 4 buttons (two "easy" buttons) instead of 3 answer buttons (as expected) as shown here:

image

my debug info is as follows:

AnkiDroid Version = 2.13.3
Android Version = 9
ACRA UUID = 51399646-d822-4a2e-b320-d4d5fdd83d4b
Scheduler = std

ps. deck in a zip file as apkg don't seem to be accepted by github

sorry the last deck file didnt include scheduling info, this one does:
Anki debugging deck - Chinese.zip

The card who created problem, were there new card or were there cards you already reviewed and that are shown to you again ?

No trouble at all if you don't know the terminology. You don't have to know it.

The doubled "EASY" button is shown for brand new never revised cards and also on cards that i have revised in the past but failed (pressed AGAIN on) and when they are shown to me again in this session.

It seems to be happening for EVERY card (mentioned above - new or failed/agained) in EVERY deck i have.

Well, it seems there is ALWAYS 4 buttons, even when there should be 3. and the 4rth button is filled with "Easy" and some really long time period.

Should i try reinstalling the app?

I highly doubt it would change anything.

I can't reproduce on 2.13.3

I see there is plenty of unusual button. Next button, Show English, an arrow. Do you click on any of them, or only on "again" ?

@danZ4C I suspect that this bug will require a copy of AnkiDroid/collection.anki2 to resolve.

If your Anki collection doesn't contain private information, would you be happy to zip it and post it here.

This file includes all your Anki Cards and review data, but not your media.

If it does contain private information, please let us know and we'll sort things out to keep the data private.

Oh yeah those are my custom JS buttons, but you can ignore it all, they don't interfere with the scheduling, just press answerButtonEase3(); )

Above problems i described were acheaved just be using the standard AnkiDroid interface.

Here you go!
collection.zip

I've removed all the JavaScriptAPI code, cleared the cache, no change, all new cards had 4 buttons (two "EASY" ones where one of them has some crazy long time on it).

Then I added all the JavaScript back, I have uninstalled the app on my phone, cleared cache, left the beta programm on google play, and I installed the normal (non-Beta) version, (WITHOUT deleting any files from my phone, so i didn't have to sync, used the same collection.anki2 file) and everything was FINE, no 4 buttons on new cards, no doubled EASY buttons.

Then i've uninstalled the normal version, and rejoined the beta program, installed the beta version and everything still looks GOOD!

@Arthur-Milchior Reproduced with the files above, download and press "again" on the cards until a new card appears.

Didn't work yesterday.

I think we should get to the bottom of this, as there's definitely something wrong here

I tried to reset a card so that I see it as new and was not able to reproduce. If it occurs only with review card failed, then that may explain the reproduction problem indeed.

I agree that it should be inspected. Do you take care of it or do you want me to look at it ? It'll have to wait a few days probably, as that's not something I can do while thinking at other thing.

I would check upstream to see what are the values.
But anyway, I can't figure out how two easy buttons could appear (I actually don't know the reviewer well, so I don't know which part of the code actually shows the buttons)

If this was common, we'd have seen it before so it's fine to shelve for a while. I won't have the time to investigate this further.

I saw this yesterday in my 2.14alpha12 yesterday while reviewing my kid's collection, then (just in case?) I upgraded to current alpha 2.14alph13 and could not reproduce. It was 4 buttons where 3 were expected, the middle 2 were green/good and the second had a wierd value. Very strange! It was while he was on all red/review cards and I imagine one was marked fail/again yes

Got a screenshot - sched v1

Screenshot_20200927-174225.jpg

I'll investigate then. If any of you know where the buttons are added to the UI, that would save me time in my search.

FYI, the way the delay work is that:

  • the reviewer ask to the scheduler the number of buttons for a card
  • for each button, the scheduler ask the delay for the card and this button
  • the scheduler starts its computation, assuming that it received a question for a button which exists

So the absurd number is not really surprising if the button should not exists, then any computation could occur.

If the buttons are made in js and not in java, my intuition would be that there are some interference exists between multiple call. After all, the same web renderer is used multiple time.

@mikehardy , does your card type contains any javascript ?

@Arthur-Milchior I have no javascript API usage, so this is just the reviewer. I think AbstractFlashcardViewer will have all this stuff, it's either there or Reviewer

This is a really fast phone I'm running on so it should not be as race-y, but it is a very simple card template (so maybe the reviewer will win a race, if there is a race) ? If you're thinking there is an asynchronous thing happening

Let me be clear, I'm just doing wild guess and trying to gather as much information as I can first. I suspect that I'll have some fun hours of debugging and trying to understand the spageti code of the reviewer before I find what's going on.

My intuition is that answerButton returns 3 and 2 in the two examples above, but for some reason the reviewer believes that there should be four buttons. (Race condition probably)
So it asks for value and text of some buttons it should not consider.
Buttons 4聽is always easy, so it's displayed as "easy" even when it should not exists

After I reinstalled the app the problem seemed to be gone, but now it is back again. Below is a brand new card with two EASY buttons.
image

Also, ive just discovered that the 4th button (the doubled EASY button) is NOT clickable at all, i click on it a little button highlight show for a sec, but absolutely nothing happens, i never tried clicking them before.

I feel have an obligation to state that this is absolutely not something a French person would say. That's probably grammatically correct, but I can't imagine a native people stating this, seems more of a literal translation of "I only have a small appartement".

"Je n'ai qu'un petit appartement" would sound more correct. The difference being whether you are applying "only" on the number "one" or on the size "small" of the appartement. And I doubt the sentence is expected to mean that you don't have multiple small appartments.

I know that it's unrelated to the bug, which is important, but that just felt too wrong for me to stay quiet here

It's a visual issue. The values from the scheduler are correct.

answerButtons(mCurrentCard) == 3

This might be caused by the automatic display of answers, was this enabled on your collection @mikehardy ?

Heck no, I have to actually answer my questions manually like a savage

This occurs when moving from a card with 4 buttons to a card with 3 AND not letting the animation finish normally.

withEndAction is only executed if an animation ends normally: https://developer.android.com/reference/android/view/ViewPropertyAnimator#withEndAction(java.lang.Runnable)

The current card JS flips the card before this completes - setting the animated field to GONE, which presumably stops this from firing.

https://github.com/ankidroid/Anki-Android/blob/a079a61fc0e7dc06437c851026b29266868aef9b/AnkiDroid/src/main/java/com/ichi2/anki/AbstractFlashcardViewer.java#L1660-L1685

Was this page helpful?
0 / 5 - 0 ratings

Related issues

hanpingchinese picture hanpingchinese  路  5Comments

mikehardy picture mikehardy  路  4Comments

kanjieater picture kanjieater  路  4Comments

Mornon picture Mornon  路  5Comments

mashinbaz1 picture mashinbaz1  路  6Comments