diff options
author | Thanos Apollo <[email protected]> | 2023-11-29 08:03:52 +0200 |
---|---|---|
committer | Thanos Apollo <[email protected]> | 2023-11-29 08:03:52 +0200 |
commit | ac99bcc1583147f9e6ee8e071efb8071bc515d0d (patch) | |
tree | 4efb793b8a0725be5c9d7285299b325747a75d83 | |
parent | 91db2020882358c7c5d43c2ce3719e6d00998de3 (diff) |
Update review functionallity
- Use gnosis-review pcase statement to call different review processes
depending on note/question type.
- Update gnosis mcq type review process
-rw-r--r-- | gnosis.el | 25 |
1 files changed, 19 insertions, 6 deletions
@@ -108,16 +108,29 @@ use it like this: ("Basic" (message "Not ready yet.")) (_ (message "No such type.")))) -;; Fix: review for seperate question types. -(defun gnosis-review (id) - "Start review for question ID." - (let ((canswer (gnosis--get-correct-answer id)) - (choices (gnosis--get-mcanswers id)) - (user-choice (gnosis--mcanswers-choice id))) +(defun gnosis-mcq-answer (id) + "Choose the correct answer, from mcq choices for question ID." + (let ((choices (gnosis--get 'notes 'options id)) + (history-add-new-input nil)) ;; Disable history + (completing-read "Answer: " choices))) + +(defun gnosis-review-mcq-choices (id) + "Display multiple choice answers for question ID." + (let ((canswer (gnosis--get 'notes 'answer id)) + (choices (gnosis--get 'notes 'options id)) + (user-choice (gnosis-mcq-answer id))) (if (equal (nth (- canswer 1) choices) user-choice) (message "Correct!") (message "False")))) +(defun gnosis-review (id) + "Start review for question ID." + (let ((type (gnosis--get 'notes 'type id))) + (pcase type + ("mcq" (gnosis-review-mcq-choices id)) + ("basic" (message "Not Ready yet.")) + ("cloze" (message "Not Ready yet."))))) + ;; testing (defun gnosis-test-buffer () "Create testing buffer." |