l3kn / org-fc

Spaced Repetition System for Emacs org-mode
https://www.leonrische.me/fc/index.html
GNU General Public License v3.0
259 stars 31 forks source link

[Feature] Undo Rating Function #35

Closed l3kn closed 4 years ago

l3kn commented 4 years ago

It would be nice to re-rate a card that has been rated incorrectly, possibly also unsuspending it if the last action was to suspend a card.

After each rating, the previous review data of the position can be stored in the session so it can be reverted later.

I think the hardest part about this is chaning the entry in the review history file, as it can grow pretty large (18mb, 143k lines in my case) so loading it to change the last line takes some time.

natask commented 4 years ago

I think the hardest part about this is changing the entry in the review history file, as it can grow pretty large (18mb, 143k lines in my case) so loading it to change the last line takes some time.

We can delay updating the review history file by one or more entries. Place them in a separate buffer/file and update one entry at a time to review history when an action is completed by a user and the buffer is full to its maximum assigned size (one or more entries). we can then save the whole buffer to the review history file on org-fc-pause or quit.

Interesting side point is the scalability of org-fc. are there things we can do to make it more scalable?

l3kn commented 4 years ago

Storing review history entries in memory is a good idea! They can be written to the main file once a review ends or emacs is closed.

Regarding scalability: I have ~30k flashcards in ~2300 .org files, 17k of those were imported automatically and are not active yet (suspended)

Both these times are higher than I'd like.

Review history statistics can be speed up by limiting them to the last n (e.g. 10k) entries. They could also be stored in memory, which would be useful for generating per-context review statistics (currenly even if a review context is selected, the dashboard shows statistics for all reviews).

The card index can also be stored in memory, updating only entries for files that have changed since the last review. I've built a prototype implementation of this cache and it cuts down the time to a few ms.

l3kn commented 4 years ago

Closing, moved to https://todo.sr.ht/~l3kn/org-fc/5