diff options
Diffstat (limited to 'org-fc-review.el')
-rw-r--r-- | org-fc-review.el | 33 |
1 files changed, 26 insertions, 7 deletions
diff --git a/org-fc-review.el b/org-fc-review.el index eaa29cf..e0e882b 100644 --- a/org-fc-review.el +++ b/org-fc-review.el @@ -238,6 +238,16 @@ same ID as the current card in the session." (org-fc-review-quit) (signal (car err) (cdr err))))) +(defun org-fc-review-rate-incorrect () + "Rate the card at point with 'incorrect'." + (interactive) + (org-fc-review-rate 'incorrect)) + +(defun org-fc-review-rate-correct () + "Rate the card at point with 'correct'." + (interactive) + (org-fc-review-rate 'correct)) + (defun org-fc-review-rate-again () "Rate the card at point with 'again'." (interactive) @@ -301,7 +311,9 @@ rating the card." (format "%.2f" delta) (symbol-name org-fc-algorithm))) (cl-destructuring-bind (next-ease next-box next-interval) - (org-fc-algo-sm2-next-parameters ease box interval rating) + (if (eq org-fc-algorithm 'tn) + (org-fc-algo-tn-next-parameters ease box interval rating) + (org-fc-algo-sm2-next-parameters ease box interval rating)) (setcdr current (list (format "%.2f" next-ease) @@ -403,7 +415,8 @@ END is the start of the line with :END: on it." "Default review data for position POSITION." (cl-case org-fc-algorithm ('sm2-v1 (org-fc-algo-sm2-initial-review-data position)) - ('sm2-v2 (org-fc-algo-sm2-initial-review-data position)))) + ('sm2-v2 (org-fc-algo-sm2-initial-review-data position)) + ('tn (org-fc-algo-tn-initial-review-data position)))) (defun org-fc-review-data-update (positions) "Update review data to POSITIONS. @@ -464,11 +477,15 @@ removed." (defun org-fc-review-add-rating (session rating) "Store RATING in the review history of SESSION." (with-slots (ratings) session - (cl-case rating - ('again (cl-incf (cl-getf ratings :again) 1)) - ('hard (cl-incf (cl-getf ratings :hard) 1)) - ('good (cl-incf (cl-getf ratings :good) 1)) - ('easy (cl-incf (cl-getf ratings :easy) 1))) + (if (eq org-fc-algorithm 'tn) + (cl-case rating + ('incorrect (cl-incf (cl-getf ratings :incorrect) 1)) + ('correct (cl-incf (cl-getf ratings :correct) 1))) + (cl-case rating + ('again (cl-incf (cl-getf ratings :again) 1)) + ('hard (cl-incf (cl-getf ratings :hard) 1)) + ('good (cl-incf (cl-getf ratings :good) 1)) + ('easy (cl-incf (cl-getf ratings :easy) 1)))) (cl-incf (cl-getf ratings :total 1)))) ;;; Header Line @@ -527,6 +544,8 @@ removed." (defvar org-fc-review-rate-mode-map (let ((map (make-sparse-keymap))) + (define-key map (kbd "i") 'org-fc-review-rate-incorrect) + (define-key map (kbd "c") 'org-fc-review-rate-correct) (define-key map (kbd "a") 'org-fc-review-rate-again) (define-key map (kbd "h") 'org-fc-review-rate-hard) (define-key map (kbd "g") 'org-fc-review-rate-good) |