krmanik / Anki-xiehanzi

Learn, read, write and practice Mandarin by drawing strokes in Anki Desktop, AnkiDroid and AnkiMobile with audio of HSK 2.0 (HSK1-6) and HSK 3.0 (HSK 1-9) characters.
https://krmanik.github.io/Anki-xiehanzi
Other
157 stars 17 forks source link

Side buttons not working on new cards #47

Open BeorTheOld opened 4 months ago

BeorTheOld commented 4 months ago

I tried to update my old Xiehanzi 3.0 deck with the new Xiehanzi 3.0 write card style by copy and pasting the front, back and styling sections into their respective places on my old deck, my old deck looked right but the buttons that control what fields are displayed were all unchecked and they did not save between cards like the new xiehanzi 3.0 deck's cards did. I tried adding cards to the new xiehanzi 3.0 decks with pleco but they had the same problem as the cards from my old deck. Is there something about the new xiehanzi 3.0 deck that is different that makes the persistence work compared to my old deck?

I had the problem on my android and PC versions of anki, while the new versions of the decks worked.

krmanik commented 4 months ago

Maybe some javascript relate errors happening, without more info it is not easy to find the issues. I suggest install to install this addon in anki, then during review, inspect the page and paste screenshot here.

https://ankiweb.net/shared/info/31746032

krmanik commented 4 months ago

I have found another easier way to update the card template.

Download and import this deck in Anki and select Update notetypes -> always, after that delete the Update deck.

Download https://github.com/krmanik/Anki-xiehanzi/releases/download/v2.2.1/Type.1.-.New.HSK.3.0.Mandarin.Chinese__Update.apkg


image

BeorTheOld commented 4 months ago

I updated the card template the way you said but it seems like it still doesn't work. The left side bar always looks like that, if I change anything the changes will not save on the next card and some of the buttons, like grid size, don't even work.

Screenshot 2024-02-21 012447 Screenshot 2024-02-21 012623

krmanik commented 4 months ago

In this case, I have updated the card template, provided two method to update xiehanzi 3.0 deck.

A. Update by importing deck Download and import this deck in Anki and select Update notetypes -> always, after that delete the Update deck.

Download https://github.com/krmanik/Anki-xiehanzi/releases/download/v2.2.1/Type.4.-.xiehanzi.HSK.3.0__Update.apkg

Above method is easiest, try below method only if above does not work.

B. Update manually by copy paste.

  1. Open card template editor
  2. Copy front.html and paste in front side of card template front.html
  3. Copy back.html and paste in back side of card template back.html
  4. Copy styling.css and paste in styling of card css styling.css Save and review, it will update and fix the error.
BeorTheOld commented 4 months ago

Unfortunately the problem is still here. I tried both methods to update the cards.

Screenshot 2024-02-21 173753

BeorTheOld commented 4 months ago

Here is a small sample of my deck.

xiehanzi 3.0.zip

krmanik commented 4 months ago

The issue was that pinyin color class was generated using python using this library but when new card added, there is no pinyin color class.

Anyway, I have updated the deck and html source. Download this deck, extract, and import in Anki then delete Update deck.

xiehanzi 3.0__Update.zip

BeorTheOld commented 4 months ago

It works as intended on PC but ankidroid still is having the same problem for me.

Ankidroid version 2.16.5

krmanik commented 4 months ago

It seems the note types are not get updated, the only solution I used to fix is to copy and paste manually from this front.html to Card Template in AnkiDroid.

Another options is move all notes to another note types.

BeorTheOld commented 4 months ago

I tried manually copy and pasting into ankidroid but the problem is still the same. I know that ankidroid is updating when I change the code anki for pc but ankidroid just isnt working with the card code correctly.

BeorTheOld commented 3 months ago

Screenshot_20240307_231604_AnkiDroid Screenshot_20240307_231615_AnkiDroid

I'm still having the problem on ankidroid, anki on PC works as intended. The card templates have been updated on ankidroid.

krmanik commented 3 months ago

I have found that there is limit to clipboard copy paste. So, the copy/paste method will not work. I suggest edit it in PC for all notetype related to xiehanzi 3.0 then syncing from PC to Ankiweb then Ankiweb to AnkiDroid. This is possible solution, I have tried, and it is working.

This is new front.html updated for AnkiDroid, because it is working without changing on AnkiMobile and Anki, but in case of AnkiDroid you have to replace with new front content now, then follow sync.

BeorTheOld commented 3 months ago

The new code causes the grid to disappear on both Anki for PC and Ankidroid. Persistence works as it should on PC, however, on Ankidroid the sidebar saves the checked boxes during review of a deck but if I exit to the main menu and reenter the same deck the boxes are back to their default settings.

krmanik commented 3 months ago

It is known problem that I knew about later. https://github.com/ankidroid/Anki-Android/issues/15773

Please update AnkiDroid to 2.17.5 and try again, it may fixed for older front.html also.

BeorTheOld commented 3 months ago

I tried a few versions of front.html but they all didn't work. I found the line to manually set the grid size and changed it to what I want it to be, is there a way to manually check and uncheck the other checkboxes?

krmanik commented 3 months ago

I have used the deck you have provided in this comment https://github.com/krmanik/Anki-xiehanzi/issues/47#issuecomment-1958425450 then imported it in Anki desktop xiehanzi.3.0.zip Then clicked xiehanzi 3.0 deck and edited Card Template by copying HTML from this front.html and pasted in front side of template. Also updated styling, card.css.

I found the issue with grid, which I have fixed now. Please try again and let me know.

More info

https://github.com/krmanik/Anki-xiehanzi/blob/7836d555e30e72f330930f026fbefcd54c50ce5b/card%20templates/Card%205/front-xiehanzi-3.0.html#L506-L508