ankidroid / Anki-Android

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

[Bug] {{c1::}} are not handled the same way in anki desktop and ankidroid #8030

Closed thiswillbeyourgithub closed 3 years ago

thiswillbeyourgithub commented 3 years ago
Reproduction Steps
  1. create a cloze card containing somewhere a {{c1::}}
  2. notice than on anki desktop the card can be reviewed, the cloze is recognized
  3. notice than on ankidroid the card is marked as empty and so cannot be reviewed
Expected Result

Both cards should be reviewable. I often have this situation happenning to me because I sometimes have to create cards to help me write words and differentiate latin prefixes. Sometimes the prefix is just empty so the cards ends up broken on ankidroid.

Actual Result

Cards can only be reviewed on anki desktop. Maybe the card could even be wrongly deleted by ankidroid by using the "empty cards" function.

Research

Enter an [x] character to confirm the points below:

mikehardy commented 3 years ago

Hi there!

What are the versions of AnkiDesktop + AnkiDroid?

Also, can you please reproduce with the current 2.15alpha series? Field rendering has changed a lot between 2.14 and 2.15? You can try a parallel build easily from here: https://github.com/ankidroid/Anki-Android/releases/tag/v2.15alpha22

thiswillbeyourgithub commented 3 years ago

Hi!

I'm on 2.1.35 on my desktop and just tried 2.15.22.

I confirm this still is the case.

Also an example of why I sometimes use this kind of cards :

random molecule : {{c1::}}agonist of such and such another random molecule : {{c1::anta}}agonist of such and such

I know I could phrase differently cards to avoid this etc but after years of doing this I figured I might as well notify you :) Especially as it is not compliant with how anki desktop handles things.

Have a nice day!

mikehardy commented 3 years ago

Okay, thanks for trying the alpha to verify, marking this for triage - maybe @Arthur-Milchior knows?

Arthur-Milchior commented 3 years ago

I'll take a look over the week-end. I must confess that my knowledge of the template system is not so good that I knew about the behaviour of cloze with empty cloze from the top of my head.

@thiswillbeyourgithub can you please let me know whether this problem is new, whether you had it for some time or whether you don't know.

In any case, thank you very much for giving an example of case where it is useful. While "it's distinct from upstream" is already a good argument for us to act, that's nice to know why we are doing that. In your example, I don't expect the card to be deleted, because for cloze type, we always keep a card even if we don't detect a clause. However, if you used {{c2::....}} anywhere, then the cloze 1 would indeed be deleted. And if you used {{c2::}} and no cloze 1, then cloze 2 would be deleted and 1 generated...

@mikehardy I don't recall cloze generation rules to have chnaged recently. I changed a lot the standard type rules, but the cloze one still uses the same process of looking for clozes in cloze field, and looking for cloze field in the template.

thiswillbeyourgithub commented 3 years ago

Hi @Arthur-Milchior !

This problem is very old, I would say at least a year.

Another example would be {{c1::}}advantage and {{c1::dis}}advantage, you get the point.

Thanks!

thiswillbeyourgithub commented 3 years ago

Sorry for the double mail but I add another thing to add, not related to this issue.

When trying the latest ankidroid alpha my template started to not work, giving me a warning that {{info-Factor:}} fields don't exist or something like that. Those "info" fields are used because of the addon additional card fields that is only supposed to affect anki desktop and should be ignored on ankidroid.

I dont' know if it's just because it's an alpha or if it's a regression but figured it might be useful to notify you!

Sorry again for the double mail. Thanks a lot!

Arthur-Milchior commented 3 years ago

I move this to another bug report: https://github.com/ankidroid/Anki-Android/issues/8043