summaryrefslogtreecommitdiff
path: root/gnosis.el
diff options
context:
space:
mode:
authorThanos Apollo <[email protected]>2023-12-19 20:22:13 +0200
committerThanos Apollo <[email protected]>2023-12-19 20:22:13 +0200
commit33075f7f7cddfdf5c3fc9f1d198322a0ca3e8dbe (patch)
tree0c36f3c80dc88cf0ea796e44e3711a8c5c85080a /gnosis.el
parent6813a8c62d75f0c70d11ed84fdf7a15fed22937e (diff)
Add gnosis-review--new-ef
Diffstat (limited to 'gnosis.el')
-rw-r--r--gnosis.el9
1 files changed, 9 insertions, 0 deletions
diff --git a/gnosis.el b/gnosis.el
index 38c5046..8a25f06 100644
--- a/gnosis.el
+++ b/gnosis.el
@@ -181,6 +181,15 @@ Returns a list of the form ((yyyy mm dd) ef)."
(let ((last-rev (gnosis-get 'last-rev 'review-log `(= id ,id))))
(gnosis-algorithm-date-diff last-rev)))
+(defun gnosis-review--new-ef (id success)
+ "Update ef for note with value of id ID.
+
+SUCCESS is a binary value, 1 = success, 0 = failure."
+ (cl-assert (or (equal success 1) (equal success 0)))
+ (let ((ef (gnosis-review--algorithm id success)))
+ (if (equal success 1)
+ (nth 0 ef)
+ (nth 1 ef))))
(defun gnosis-review-mcq-choices (id)
"Display multiple choice answers for question ID."
(let ((answer (gnosis-get 'answer 'notes `(= id ,id)))