diff options
author | Thanos Apollo <[email protected]> | 2023-12-23 14:06:47 +0200 |
---|---|---|
committer | Thanos Apollo <[email protected]> | 2023-12-23 14:06:47 +0200 |
commit | f2da68563a89b76c7e3613dbc2d67e288a864bb6 (patch) | |
tree | 8ee3066b718f10f879e8de60f80784a6c17e913c | |
parent | 3af9ba3c4b56327bbacc1b2812dbf1cf794a7cfc (diff) |
Add gnosis-review-new-f
Calculate new ef for card id, based on SUCCESS.
To make tracking easier, easiness factor is a list consisting of
(ef-increase ef-decrease ef), where ef-increase & ef-decrease are used
to calculate new ef upon review.
-rw-r--r-- | gnosis.el | 8 |
1 files changed, 8 insertions, 0 deletions
@@ -188,6 +188,14 @@ This function is used to round floating point numbers to 1 decimal, such as the easiness factor (ef)." (/ (round (* num 100.00)) 100.00)) +(defun gnosis-review-new-ef (id success) + "Get new ef for note with value of id ID. + +SUCCESS is a binary value, 1 = success, 0 = failure. +Returns a list of the form (ef-increase ef-decrease ef)." + (let ((ef (nth 1 (gnosis-review--algorithm id success))) + (old-ef (gnosis-get 'ef 'review `(= id ,id)))) + (cl-substitute (gnosis-review-round ef) (nth 2 old-ef) old-ef))) (defun gnosis-review--success (id) "Update review-log for note with value of id ID." |