summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThanos Apollo <[email protected]>2023-12-25 17:35:01 +0200
committerThanos Apollo <[email protected]>2023-12-25 17:35:01 +0200
commit8c7e2604065d4a1ddd12edd3853ae4eacd059244 (patch)
treed39219deedd673e91170edfacf921c0d9272bbca
parent6687492980c8220f4d95c0e3991b6b24c83808fb (diff)
gnosis-display--correct-answer-mcq: Display user-choice as well
-rw-r--r--gnosis.el9
1 files changed, 6 insertions, 3 deletions
diff --git a/gnosis.el b/gnosis.el
index ea982b6..ca0ef63 100644
--- a/gnosis.el
+++ b/gnosis.el
@@ -84,15 +84,18 @@ 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."
+(defun gnosis-display--correct-answer-mcq (id user-choice)
+ "Display correct answer & USER-CHOICE 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))))))
+ (insert (concat "\n\nCorrect answer: "
+ (propertize answer 'face 'gnosis-face-correct-answer)
+ "\nYour answer: "
+ (propertize user-choice 'face 'gnosis-face-user-choice))))))
(defun gnosis-display--extra (id)
"Display extra information for note ID."