From 55387b522303d8d2243c83be90cda2d7b7ef36b6 Mon Sep 17 00:00:00 2001 From: Thanos Apollo Date: Tue, 19 Dec 2023 20:20:58 +0200 Subject: Add gnosis-review--algorithm A seperate function to output the new interval & new ef using gnosis-algorithm --- gnosis.el | 14 ++++++++++++++ 1 file changed, 14 insertions(+) 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)))) -- cgit v1.2.3