summaryrefslogtreecommitdiff
path: root/gnosis.el
diff options
context:
space:
mode:
Diffstat (limited to 'gnosis.el')
-rw-r--r--gnosis.el15
1 files changed, 8 insertions, 7 deletions
diff --git a/gnosis.el b/gnosis.el
index f58e851..a3f9ca0 100644
--- a/gnosis.el
+++ b/gnosis.el
@@ -850,10 +850,10 @@ SUCCESS is a binary value, 1 = success, 0 = failure.
Returns a list of the form ((yyyy mm dd) ef)."
(let ((ff gnosis-algorithm-ff)
(ef (nth 2 (gnosis-get 'ef 'review `(= id ,id))))
- (c-success (gnosis-get 'c-success 'review-log `(= id ,id))))
+ (t-success (gnosis-get 't-success 'review-log `(= id ,id))))
(gnosis-algorithm-next-interval (gnosis-review--get-offset id)
(gnosis-get 'n 'review-log `(= id ,id))
- ef success ff c-success)))
+ ef success ff t-success)))
(defun gnosis-review-due-notes--with-tags ()
"Return a list of due note tags."
@@ -933,7 +933,7 @@ SUCCESS is a binary value, 1 is for successful review."
(gnosis-review--update id (if success 1 0))
(gnosis-display--next-review id)))
-(defun gnosis-review-y-or-p (id)
+(defun gnosis-review-y-or-n (id)
"Review y-or-n type note for ID."
(gnosis-display--image id)
(gnosis-display--question id)
@@ -941,7 +941,7 @@ SUCCESS is a binary value, 1 is for successful review."
(let* ((answer (gnosis-get 'answer 'notes `(= id ,id)))
(user-input (read-char-choice "[y]es or [n]o: " '(?y ?n)))
(success (equal answer user-input)))
- (gnosis-display-y-or-n-answer :answer answer :success success :user-input user-input)
+ (gnosis-display-y-or-n-answer :answer answer :success success)
(gnosis-display--extra id)
(gnosis-review--update id (if success 1 0))
(gnosis-display--next-review id)))
@@ -975,7 +975,6 @@ Used to reveal all clozes left with `gnosis-face-cloze-unanswered' face."
(if (equal (car input) t)
;; Reveal only one cloze
(progn (gnosis-display-cloze-reveal :replace cloze)
- (gnosis-review--update id 1)
(setf num (1+ num)))
;; Reveal cloze for wrong input, with `gnosis-face-false'
(gnosis-display-cloze-reveal :replace cloze :success nil)
@@ -985,7 +984,9 @@ Used to reveal all clozes left with `gnosis-face-cloze-unanswered' face."
(when (< num clozes-num) (gnosis-review-cloze-reveal-unaswered clozes))
(gnosis-display-cloze-user-answer (cdr input))
(gnosis-review--update id 0)
- (cl-return)))))
+ (cl-return)))
+ ;; Update note after all clozes are revealed successfully
+ finally (gnosis-review--update id 1)))
(gnosis-display--extra id)
(gnosis-display--next-review id))
@@ -999,7 +1000,7 @@ Used to reveal all clozes left with `gnosis-face-cloze-unanswered' face."
("mcq" (gnosis-review-mcq id))
("basic" (gnosis-review-basic id))
("cloze" (gnosis-review-cloze id))
- ("y-or-n" (gnosis-review-y-or-p id))
+ ("y-or-n" (gnosis-review-y-or-n id))
(_ (error "Malformed note type")))))))
(defun gnosis-review-commit (note-num)