summaryrefslogtreecommitdiff
path: root/gnosis.el
diff options
context:
space:
mode:
authorThanos Apollo <[email protected]>2023-12-19 20:20:58 +0200
committerThanos Apollo <[email protected]>2023-12-19 20:20:58 +0200
commit55387b522303d8d2243c83be90cda2d7b7ef36b6 (patch)
tree9594d58cdd6f239168dff685cddaa4a42064617e /gnosis.el
parent345748cf07f13f0f489edec5d3a9d6b69288ee6b (diff)
Add gnosis-review--algorithm
A seperate function to output the new interval & new ef using gnosis-algorithm
Diffstat (limited to 'gnosis.el')
-rw-r--r--gnosis.el14
1 files changed, 14 insertions, 0 deletions
diff --git a/gnosis.el b/gnosis.el
index 4660333..a53c917 100644
--- a/gnosis.el
+++ b/gnosis.el
@@ -158,6 +158,20 @@ TAGS are used to organize questions."
(history-add-new-input nil)) ;; Disable history
(completing-read "Answer: " choices)))
+;; Review
+(defun gnosis-review--algorithm (id success)
+ "Get next review date & ef for note with value of id ID.
+
+SUCCESS is a binary value, 1 = success, 0 = failure.
+Returns a list of the form ((yyyy mm dd) ef)."
+ (let ((ff gnosis-algorithm-ff)
+ (ef (nth 2 (gnosis-get 'ef 'review `(= id 1)))))
+ (gnosis-algorithm-next-interval (gnosis-review--get-offset id)
+ (gnosis-get 'n 'review-log `(= id ,id))
+ ef
+ success
+ ff)))
+
(defun gnosis-review--get-due-notes ()
"Get due notes for current date."
(gnosis--select 'id 'review-log `(<= next-rev ',(gnosis-algorithm-date))))