diff options
author | Thanos Apollo <[email protected]> | 2024-02-08 18:28:02 +0200 |
---|---|---|
committer | Thanos Apollo <[email protected]> | 2024-02-08 18:28:02 +0200 |
commit | 268c5f35ba45364d93dcebe3854e8763efa55923 (patch) | |
tree | b0b0585e743c57a95b5be9cb4437ba3742b9c468 /gnosis.el | |
parent | 732ee3d5882fdcac7a753afe3030535abdf88912 (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.
Diffstat (limited to 'gnosis.el')
-rw-r--r-- | gnosis.el | 9 |
1 files changed, 5 insertions, 4 deletions
@@ -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))) |