diff options
author | Thanos Apollo <[email protected]> | 2023-12-25 07:04:56 +0200 |
---|---|---|
committer | Thanos Apollo <[email protected]> | 2023-12-25 07:04:56 +0200 |
commit | 6267dd0904cb2dec4b6e2d23f6d86e3657890ce9 (patch) | |
tree | 6336280b429919e64e844d76606acb2dcf131881 /gnosis.el | |
parent | 437f0f89e73dcfadeb608d35158fa61bee539601 (diff) |
Add gnosis-display--correct-answer-mcq
Diffstat (limited to 'gnosis.el')
-rw-r--r-- | gnosis.el | 10 |
1 files changed, 10 insertions, 0 deletions
@@ -84,6 +84,16 @@ Example: (erase-buffer) (fill-paragraph (insert (propertize question 'face 'gnosis-face-main)))))) +(defun gnosis-display--correct-answer-mcq (id) + "Display correct answer for MCQ note type with ID." + (let* ((correct-answer (gnosis-get 'answer 'notes `(= id ,id))) + (options (gnosis-get 'options 'notes `(= id ,id))) + (answer (nth correct-answer options))) + (with-current-buffer + (switch-to-buffer + (get-buffer-create "*gnosis*")) + (insert (concat "\n\nCorrect answer: " (propertize answer 'face 'gnosis-face-correct-answer)))))) + (defun gnosis-display--extra (id) "Display extra information for note ID." (let ((extras (gnosis-get 'extra-notes 'extras `(= id ,id)))) |