From 33075f7f7cddfdf5c3fc9f1d198322a0ca3e8dbe Mon Sep 17 00:00:00 2001 From: Thanos Apollo Date: Tue, 19 Dec 2023 20:22:13 +0200 Subject: Add gnosis-review--new-ef --- gnosis.el | 9 +++++++++ 1 file changed, 9 insertions(+) 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))) -- cgit v1.2.3