diff options
author | Thanos Apollo <[email protected]> | 2024-01-16 09:57:13 +0200 |
---|---|---|
committer | Thanos Apollo <[email protected]> | 2024-01-16 09:57:13 +0200 |
commit | 0b76877a49348e211a3ce49147f55a0eb11dea7d (patch) | |
tree | 97a3c1e67e1e04529fa1d1142b0fa6d79be67f41 /gnosis.el | |
parent | 8ca53e1a0e7f1cde295b2aab29893439be07a89a (diff) | |
parent | 70b1af5810b8c13afc61508d82163c172bfce047 (diff) |
Merge branch 'version-0.1.1' into master
- Fix bug for multiple clozes review
- Fix gnosis-review-y-or-n for new inputs
- Update gnosis-algorithm implementation
- Fix minor bugs on gnosis-algorithm
Reviews for all note types should work fine with this version
Diffstat (limited to 'gnosis.el')
-rw-r--r-- | gnosis.el | 15 |
1 files changed, 8 insertions, 7 deletions
@@ -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) |