summaryrefslogtreecommitdiff
path: root/gnosis.el
diff options
context:
space:
mode:
authorThanos Apollo <[email protected]>2024-02-16 23:58:33 +0200
committerThanos Apollo <[email protected]>2024-02-16 23:58:33 +0200
commit2c5709390330fbf7a0d01a0d59e76af3e673301d (patch)
tree6bc29477d28ea43ab4cb180c5a353e4b10f0ffac /gnosis.el
parente4ca956cc7da0de1ec18e8ff844cb07896894f4d (diff)
Add gnosis-display-mcq-options
Diffstat (limited to 'gnosis.el')
-rw-r--r--gnosis.el9
1 files changed, 9 insertions, 0 deletions
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)