summaryrefslogtreecommitdiff
path: root/gnosis.el
diff options
context:
space:
mode:
authorThanos Apollo <[email protected]>2024-03-08 08:01:45 +0200
committerThanos Apollo <[email protected]>2024-03-08 08:01:45 +0200
commit41e5afe96c8c573e409fc446bc51337a20e86f68 (patch)
tree3a98fb2c68a2e35c7fa40c55eda2eb6af379a307 /gnosis.el
parentfcbb910b678d717893c2f035e5e7e3feb9169dc7 (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.el7
1 files changed, 4 insertions, 3 deletions
diff --git a/gnosis.el b/gnosis.el
index 4b89dc5..2588b61 100644
--- a/gnosis.el
+++ b/gnosis.el
@@ -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)