diff options
author | Thanos Apollo <[email protected]> | 2024-03-08 08:01:45 +0200 |
---|---|---|
committer | Thanos Apollo <[email protected]> | 2024-03-08 08:01:45 +0200 |
commit | 41e5afe96c8c573e409fc446bc51337a20e86f68 (patch) | |
tree | 3a98fb2c68a2e35c7fa40c55eda2eb6af379a307 /gnosis.el | |
parent | fcbb910b678d717893c2f035e5e7e3feb9169dc7 (diff) |
Add initial-interval column for decks
Set initial interval for all notes under deck. Make it easier to
customize gnosis-algorithm for all notes under deck, e.g have 0 as the
first interval for foreign language learning while 1 for biology deck etc.
Diffstat (limited to 'gnosis.el')
-rw-r--r-- | gnosis.el | 7 |
1 files changed, 4 insertions, 3 deletions
@@ -986,7 +986,6 @@ Returns a list of the form ((yyyy mm dd) (ef-increase ef-decrease ef-total))." (c-success (gnosis-get 'c-success 'review-log `(= id ,id))) ;; consecutive successful reviews (c-fails (gnosis-get 'c-fails 'review-log `(= id ,id))) ;; consecutive failed reviews ;; (t-fails (gnosis-get 't-fails 'review-log `(= id ,id))) ;; total failed reviews - (initial-interval (gnosis-get 'interval 'review `(= id ,id))) ;; initial interval ;; (review-num (gnosis-get 'n 'review-log `(= id ,id))) ;; total reviews (last-interval (max (gnosis-review--get-offset id) 1))) ;; last interval (list (gnosis-algorithm-next-interval :last-interval last-interval @@ -994,7 +993,7 @@ Returns a list of the form ((yyyy mm dd) (ef-increase ef-decrease ef-total))." :success success :successful-reviews t-success :failure-factor ff - :initial-interval initial-interval) + :initial-interval (gnosis-get-note-initial-interval id)) (gnosis-algorithm-next-ef :ef ef :success success :increase (gnosis-get-ef-increase id) @@ -1478,7 +1477,8 @@ to improve readability." (failure-factor float) (ef-increase float) (ef-decrease float) - (ef-threshold integer)])) + (ef-threshold integer) + (initial-interval listp)])) (defvar gnosis-db-schema-notes '([(id integer :primary-key :autoincrement) (type text :not-null) @@ -1679,6 +1679,7 @@ DASHBOARD-TYPE: either 'Notes' or 'Decks' to display the respective dashboard." (emacsql gnosis-db [:alter-table decks :add ef-increase]) (emacsql gnosis-db [:alter-table decks :add ef-decrease]) (emacsql gnosis-db [:alter-table decks :add ef-threshold]) + (emacsql gnosis-db [:alter-table decks :add initial-interval]) (emacsql gnosis-db (format "PRAGMA user_version = %s" gnosis-db-version)))))) (gnosis-db-init) |