summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThanos Apollo <[email protected]>2024-02-08 18:28:02 +0200
committerThanos Apollo <[email protected]>2024-02-08 18:28:02 +0200
commit268c5f35ba45364d93dcebe3854e8763efa55923 (patch)
treeb0b0585e743c57a95b5be9cb4437ba3742b9c468
parent732ee3d5882fdcac7a753afe3030535abdf88912 (diff)
[FIX] gnosis-review--update: Fix next interval
This fixes a bug for input the wrong value for success when calculating the next interval & refactors to use new boolean value for success.
-rw-r--r--gnosis.el9
1 files changed, 5 insertions, 4 deletions
diff --git a/gnosis.el b/gnosis.el
index ee79398..88655cf 100644
--- a/gnosis.el
+++ b/gnosis.el
@@ -900,15 +900,16 @@ SUCCESS is a boolean value, t for success, nil for failure."
(defun gnosis-review--update (id success)
"Update review-log for note with value of id ID.
-SUCCESS is a binary value, 1 is for successful review."
- (let ((ef (gnosis-review-new-ef id success)))
+SUCCESS is a boolean value, t for success, nil for failure."
+ (let ((ef (gnosis-review-new-ef id success))
+ (next-rev (car (gnosis-review--algorithm id success))))
;; Update review-log
(gnosis-update 'review-log `(= last-rev ',(gnosis-algorithm-date)) `(= id ,id))
- (gnosis-update 'review-log `(= next-rev ',(car (gnosis-review--algorithm id success))) `(= id ,id))
+ (gnosis-update 'review-log `(= next-rev ',next-rev) `(= id ,id))
(gnosis-update 'review-log `(= n (+ 1 ,(gnosis-get 'n 'review-log `(= id ,id)))) `(= id ,id))
;; Update review
(gnosis-update 'review `(= ef ',ef) `(= id ,id))
- (if (= success 1)
+ (if success
(progn (gnosis-update 'review-log `(= c-success ,(1+ (gnosis-get 'c-success 'review-log `(= id ,id)))) `(= id ,id))
(gnosis-update 'review-log `(= t-success ,(1+ (gnosis-get 't-success 'review-log `(= id ,id)))) `(= id ,id))
(gnosis-update 'review-log `(= c-fails 0) `(= id ,id)))