Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

JSON export does not include FSRS weights. field "fsrsWeights" seems to always be empty []. #208

Closed
edzillion opened this issue Jan 26, 2024 · 3 comments

Comments

@edzillion
Copy link

#192 seems to imply that the weights are saved but I do not see them in the JSON output and I presume that the field fsrsWeights are where they should be saved.

I want to make a separate client that has it's own scheduler but I need the weights to calculate schedules.

Win 10 v 22H2
Anki desktop Version ⁨23.12.1 (1a1d4d54)⁩
CrowdAnki v0.9.5

@aplaice
Copy link
Collaborator

aplaice commented Jan 26, 2024

I'm not too familiar with FSRS (a lack that I'd very much like to fix at some point!), but if I understand correctly* fsrsWeights are part of the per-user scheduling information (each user should have their own, which is not saved in the JSON, but is kept in the Anki database.

* fsrsWeights is something that is/can be recalculated based on your own review history (good/bad answers etc.)?


Sorry for the confusion!

If it makes things clearer, the JSON only contains information that is meant to be shared among many users (the contents of the notes, the styling/arrangement of the cards, tagging of notes, subdivision into sub-decks etc.).

Scheduling information always remains in the Anki database, since it shouldn't be shared among users (user A does not want user B's scheduling).

What #192 means is that if you re-import (via CrowdAnki) a deck that you already have in Anki, then your progress on existing cards should not be reset (i.e. your future scheduling should be as if it would have been had you not re-imported), only the contents of the cards should be updated (e.g. typo-fixes) and/or new cards added.

I hope this makes sense!


(Depending on what you're trying to achieve, you could probably tweak CrowdAnki to also export scheduling info, but it's not really a design goal here.)

@edzillion
Copy link
Author

edzillion commented Jan 26, 2024

Thanks for the quick and comprehensive reply :)

  • fsrsWeights is something that is/can be recalculated based on your own review history (good/bad answers etc.)?

Yes. The calculation of weights is a manual step. If you have enough review history it can calculate them upfront, otherwise picking the default weights. Then you are advised to recalc them once a month. FAQ Q12

Sorry for the confusion!

Not at all! I see the disctinction, thanks for the explanation.

I went and had a look to see whether I could find the info in the DB, and using the browser in Anki I confirmed that the extra FSRS fields are added to the notes view (stability, difficulty etc.) but when I try to export the DB (whether a downloaded one like Ultimate Geography or one I have created myself) as an .apkg, when I view the contents of the DB there is only one note and the flds column contains the message Please update to the latest Anki version, then import the .colpkg/.apkg file again.

Not sure what's happening there. I reinstalled anki and then disabled all plugins and tried again. Same thing :/


In any case, can you point to where in CrowdAnki I would have to tweak to include the weights (and the stability, difficulty parameters) in the output? I had a quick look at the codebase thinking if I searched for sqlite3 I might find where the db was being converted but I couldn't find anything much.

@edzillion edzillion reopened this Jan 26, 2024
@aplaice
Copy link
Collaborator

aplaice commented Jan 27, 2024

In any case, can you point to where in CrowdAnki I would have to tweak to include the weights (and the stability, difficulty parameters) in the output? I had a quick look at the codebase thinking if I searched for sqlite3 I might find where the db was being converted but I couldn't find anything much.

On a casual look, it probably wouldn't be that small a tweak (I initially thought it might just be a case of not excluding some fields — but this isn't one of the fields that we exclude; it's in a different table, so we don't need to). We (mostly?) don't directly read from the db, since it's arguably more fragile in terms of version compatibility.

You'd need to find the Anki python functions that read/write the fsrs-related properties (or just read/write from the db yourself, for that part) and probably make a serialisation wrapper like deck.py or deck_config.py.

(For instance, the deck-related info is via mw.col.decks and its methods.)

It might (or not :)) be easier for you to write your own database-dumper from scratch.


when I view the contents of the DB there is only one note and the flds column contains the message Please update to the latest Anki version, then import the .colpkg/.apkg file again.

That's weird :(

@edzillion edzillion closed this as not planned Won't fix, can't repro, duplicate, stale Jan 27, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants