ankidroid / Anki-Android

AnkiDroid: Anki flashcards on Android. Your secret trick to achieve superhuman information retention.
GNU General Public License v3.0
8.75k stars 2.24k forks source link

[BUG]: All card options show (end) #15611

Open Cevianne opened 9 months ago

Cevianne commented 9 months ago

Checked for duplicates?

What are the steps to reproduce this bug?

I didn't do anything different. It was the same custom study.

Expected behaviour

It was supposed to show the intervals, and only show "end" if it was the button "easy".

Actual behaviour

Screenshot_20240220_191546_AnkiDroid

Debug info

AnkiDroid Version = 2.17beta6 (c17fed63b97a464484f7ee465057ff251f54007f)

Backend Version = 0.1.34-anki23.12.1 (23.12.1 1a1d4d5419c6b57ef3baf99c9d2d9cf85d36ae0a)

Android Version = 13 (SDK 33)

ProductFlavor = play

Manufacturer = samsung

Webview User Agent = Mozilla/5.0 AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/121.0.6167.178 Mobile Safari/537.36

ACRA UUID = f9e278f4-992f-4e8e-8ef6-c4c69cb11716

Crash Reports Enabled = true

(Optional) Anything else you want to share?

No response

Research

welcome[bot] commented 9 months ago

Hello! 👋 Thanks for logging this issue. Please remember we are all volunteers here, so some patience may be required before we can get to the issue. Also remember that the fastest way to get resolution on an issue is to propose a change directly, https://github.com/ankidroid/Anki-Android/wiki/Contributing

DevP-ai commented 9 months ago

Hii @Cevianne could you provide more details on how to reproduce the bug?

SanjaySargam commented 9 months ago

Not Reproduced!

AdrianKlessa commented 9 months ago

I have the same issue, it started happening after I updated to 2.17 .

I use custom study-->review forgotten cards-->3 (though I see that inputting 1 day doesn't help).

Debug info:

AnkiDroid Version = 2.17.1 (dd2f3762fb214f9dd51162b215974b23cc809713)

Backend Version = 0.1.34-anki23.12.1 (23.12.1 1a1d4d5419c6b57ef3baf99c9d2d9cf85d36ae0a)

Android Version = 13 (SDK 33)

ProductFlavor = play

Manufacturer = motorola

Model = motorola edge 30

Hardware = qcom

Webview User Agent = Mozilla/5.0 (Linux; Android 13; motorola edge 30 Build/T1RDS33.116-33-13-1; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/121.0.6167.178 Mobile Safari/537.36

ACRA UUID = c1be0156-5ee3-4d76-88ec-9f9397faa2cc

Crash Reports Enabled = true
david-allison commented 9 months ago

Is it feasible to get an export of either the deck, or your collection (both without media) with scheduling enabled so we can reproduce the issue

Either zipped and uploaded here, or emailed to my Gmail: davidallisongithub

AdrianKlessa commented 9 months ago

Ok, this is weird: I used a spare phone (which was set to my native language) to try and reproduce the issue by exporting and importing and found out that in my case it appears to have something to do with the language selected in Anki and the collection itself?

The issue doesn't occur when importing a single deck, but it does when importing a collection. My current collection is quite old (~7 years?) and pretty large. I most likely created it on a phone which had Polish as the system language (my current one has English).

I recorded the weird language behavior here:

  1. Anki is set to system language (English), I import the collection
  2. Review has all (end) buttons
  3. I change the language to Polish (most likely my system language when I created the collection years ago?)
  4. Review has correct (<1 min, <10min, (end), (end)) buttons
  5. Changing to English (not the system language option at the top, the other one) gives all (end) buttons again

https://github.com/ankidroid/Anki-Android/assets/50918271/a6d82e14-3641-4d4e-9d0e-8839090355ed

I forgot to record it but when set to Polish the "again" and "hard" buttons do work correctly (making the cards appear again later), so it's not just a UI difference.

Also: when I removed all but one (small, 131 cards) deck and exported the collection, it was still 65MB - I think it might have gotten corrupted over time or something, since apkg export yields a 259KB file. The deck is too large to upload here so I'll send it by mail, but considering this it seems to me like there's something wrong with the collection itself (I've already tried the check database and check media options).

I think I'll make a collection backup, export all my decks one by one and create a new collection from the deck exports to hopefully clean up whatever is causing both the collection size and this issue.

In both the recording and the attached collection I removed all decks but a single, smaller one (I don't fully feel comfortable sharing my entire collection, sorry :/ )

EDIT: Works when set to Japanese and German as well. Breaks when changed back to English. EDIT2: Inspecting the collection sqlite file, I see that the revlog has 2.6 million rows so that's probably where the collection size mostly comes from.

david-allison commented 9 months ago
0 = {DeckConfig@27814} {"id":1,"mod":1640442086,"name":"Default","usn":-1,"maxTaken":60,"autoplay":true,"timer":0,"replayq":true,"new":{"bury":true,"delays":[1,10],"initialFactor":2500,"ints":[1,4,0],"order":1,"perDay":5,"separate":true},"rev":{"bury":true,"ease4":1.3,"ivlFct":1,"maxIvl":36500,"perDay":100,"hardFactor":1.2,"fuzz":0.05,"minSpace":1},"lapse":{"delays":[10],"leechAction":0,"leechFails":99,"minInt":1,"mult":0},"dyn":false,"newMix":0,"newPerDayMinimum":0,"interdayLearningMix":0,"reviewOrder":0,"newSortOrder":0,"newGatherPriority":0,"buryInterdayLearning":false,"fsrsWeights":[],"desiredRetention":0.9,"stopTimerOnAnswer":false,"secondsToShowQuestion":0,"secondsToShowAnswer":0,"answerAction":0,"waitForAudio":true,"sm2Retention":0.9,"weightSearch":""}
9 = {DeckConfig@27823} {"id":1561564140249,"mod":1592837184,"name":"Internet slang","usn":-1,"maxTaken":60,"autoplay":true,"timer":0,"replayq":true,"new":{"bury":true,"delays":[1,10],"initialFactor":2500,"ints":[1,4,0],"order":1,"perDay":5,"separate":true},"rev":{"bury":true,"ease4":1.3,"ivlFct":1,"maxIvl":36500,"perDay":100,"hardFactor":1.2,"fuzz":0.05,"minSpace":1},"lapse":{"delays":[10],"leechAction":0,"leechFails":99,"minInt":1,"mult":0},"dyn":false,"newMix":0,"newPerDayMinimum":0,"interdayLearningMix":0,"reviewOrder":0,"newSortOrder":0,"newGatherPriority":0,"buryInterdayLearning":false,"fsrsWeights":[],"desiredRetention":0.9,"stopTimerOnAnswer":false,"secondsToShowQuestion":0,"secondsToShowAnswer":0,"answerAction":0,"waitForAudio":true,"sm2Retention":0.9,"weightSearch":""}

0 = {DeckNameId@27890} DeckNameId(name=Custom study session, id=1526273961323)
1 = {DeckNameId@27891} DeckNameId(name=Default, id=1)
2 = {DeckNameId@27892} DeckNameId(name=English Math vocabulary, id=1564748014686)

1526273961323 -> 1
1564748014686 -> 1561564140249

{"id":1526273961323,"mod":1709144165,"name":"Custom study session","usn":-1,"lrnToday":[2403,0],"revToday":[2403,2],"newToday":[2403,0],"timeToday":[2403,4884],"collapsed":false,"browserCollapsed":false,"desc":"","dyn":1,"mid":1503016466066,"resched":false,"terms":[["deck:\"English Math vocabulary\" rated:3:1",99999,1]],"separate":true,"delays":[1],"previewDelay":0,"previewAgainSecs":0,"previewHardSecs":0,"previewGoodSecs":0}
{"id":1564748014686,"mod":1709099746,"name":"English Math vocabulary","usn":-1,"lrnToday":[2403,0],"revToday":[2403,2],"newToday":[2403,0],"timeToday":[2403,11870],"collapsed":false,"browserCollapsed":false,"desc":"","dyn":0,"conf":1561564140249,"extendNew":10,"extendRev":50,"reviewLimit":null,"newLimit":null,"reviewLimitToday":null,"newLimitToday":null}

sched.card ->
'customData': ,  'did': 1526273961323,  'due': -100000,  'elapsedTime': 0,  'factor': 1800,  'flags': 0,  'id': 1564746616528,  'ivl': 1,  'lapses': 2,  'left': 0,  'mod': 1709219811,  'nid': 1564746534994,  'note': null,  'oDid': 1564748014686,  'oDue': 2404,  'ord': 0,  'originalPosition': null,  'queue': 2,  'renderOutput': null,  'reps': 19,  'timerStarted': 1709221112193,  'type': 2,  'usn': -1,  'Companion': com.ichi2.libanki.Card$Companion@b29a78a
david-allison commented 9 months ago

In the provided file, Deck Options -> Again appears corrupt.

The value should be >= 1, but the value is 0. AnkiDroid enforces the value is >= 1

Screenshot 2024-02-29 at 15 51 33
david-allison commented 9 months ago

@AdrianKlessa Do you know how the deck was created?

AdrianKlessa commented 9 months ago

@david-allison The vocabulary deck I sent was created manually around 2019 in either Ankidroid (most likely) or the desktop version of Anki (very unlikely but can't rule it out 100% since it was quite a while ago). Then moved alongside the rest of my collection to a new phone.

No idea about the custom study session deck, sorry. I forgot when I started using this functionality or when the deck appeared in my collection.

Might be worth noting that I used to have a bad habit of copying the Ankidroid directory to move the collection between phones (instead of using the proper export functionality), not sure if that might cause this sort of corruption.

Thank you very much for pointing out the preview delay setting. Changing that fixed the issue - custom study works for me again.

david-allison commented 8 months ago

Had this reported again on reddit

david-allison commented 8 months ago

@dae

What should the defaults be if a dynamic deck has not been provided with preview_again_secs etc...

A new deck uses 60/600/0 [again, hard, good]

An upgraded deck [AnkiDroid/Anki Desktop] appears to use 0/0/0


1a12f1a466fafb5cddbe4f1829e676fa0e18bb94 sets min=1 for preview_again_secs, but Anki Desktop appears to allow a value of 0,

https://github.com/ankidroid/Anki-Android/blob/1a12f1a466fafb5cddbe4f1829e676fa0e18bb94/AnkiDroid/src/main/res/xml/cram_deck_options.xml#L55-L60

Overall our issue is the following, which doesn't set the new defaults:

https://github.com/ankidroid/Anki-Android/blob/3775853baabe202f9d2c975a10754f229b89bf9c/AnkiDroid/src/main/java/com/ichi2/libanki/Decks.kt#L96-L114

dae commented 8 months ago

Users who have filtered decks created with older versions will need to edit the filtered deck options and adjust the delays to their liking (e.g. the new defaults). The issue is that they can't currently do that in AnkiDroid (unless that feature has been added and I didn't notice).

david-allison commented 8 months ago

It's added & released

As a follow-up: our current implementation has 1 as a minimum for preview_again_secs. Is there a reason for this, or was it an oversight?

dae commented 8 months ago

Allowing 0 for preview_again would mean Again shows (end), which is probably not what users would expect.

david-allison commented 8 months ago

This issue will be closed when the following method is updated to use the backend:

https://github.com/ankidroid/Anki-Android/blob/3775853baabe202f9d2c975a10754f229b89bf9c/AnkiDroid/src/main/java/com/ichi2/libanki/Decks.kt#L96-L114

github-actions[bot] commented 3 months ago

Hello 👋, this issue has been opened for more than 3 months with no activity on it. If the issue is still here, please keep in mind that we need community support and help to fix it! Just comment something like still searching for solutions and if you found one, please open a pull request! You have 7 days until this gets closed automatically