From b71e2ea92fca02e02e3304a68a6d3571d621f76a Mon Sep 17 00:00:00 2001 From: Thanos Apollo Date: Wed, 13 Dec 2023 15:27:53 +0200 Subject: mcq: Use gnosis--select --- gnosis.el | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'gnosis.el') diff --git a/gnosis.el b/gnosis.el index 017c2e0..dafbc6d 100644 --- a/gnosis.el +++ b/gnosis.el @@ -73,7 +73,7 @@ (defun gnosis--display-question (id) "Display main row for question ID." - (let ((question (gnosis--get-id 'notes 'main id))) + (let ((question (caar (gnosis--select 'main 'notes `(= id ,id))))) ;; Animate.el is used only for testing purposes. (animate-string question 5))) @@ -139,14 +139,14 @@ TAGS are used to organize questions." (defun gnosis-mcq-answer (id) "Choose the correct answer, from mcq choices for question ID." - (let ((choices (gnosis--get-id 'notes 'options id)) + (let ((choices (gnosis--select 'options 'notes `(= id ,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-id 'notes 'answer id)) - (choices (gnosis--get-id 'notes 'options id)) + (let ((canswer (gnosis--select 'answer 'notes `(= id ,id))) + (choices (gnosis--select 'answer 'notes `(= id ,id))) (user-choice (gnosis-mcq-answer id))) (if (equal (nth (- canswer 1) choices) user-choice) (message "Correct!") -- cgit v1.2.3