From 2c5709390330fbf7a0d01a0d59e76af3e673301d Mon Sep 17 00:00:00 2001 From: Thanos Apollo Date: Fri, 16 Feb 2024 23:58:33 +0200 Subject: Add gnosis-display-mcq-options --- gnosis.el | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/gnosis.el b/gnosis.el index 8db4827..da20d38 100644 --- a/gnosis.el +++ b/gnosis.el @@ -234,6 +234,15 @@ FACE-FOR-INFO is the face used to display info for option." (erase-buffer) (fill-paragraph (insert "\n" (propertize question 'face 'gnosis-face-main))))) +(defun gnosis-display-mcq-options (id) + "Display answer options for mcq note ID." + (let ((options (apply #'append (gnosis-select 'options 'notes `(= id 1) t))) + (option-num 1)) + (insert "\n\n" (propertize "Options:" 'face 'gnosis-face-directions)) + (cl-loop for option in options + do (insert (format "\n%s. %s" option-num option)) + (setf option-num (1+ option-num))))) + (defun gnosis-display-cloze-sentence (sentence clozes) "Display cloze sentence for SENTENCE with CLOZES." (erase-buffer) -- cgit v1.2.3