From 5242c12bfe461c20500dd7f82ad5325b199c4341 Mon Sep 17 00:00:00 2001 From: Thanos Apollo Date: Wed, 27 Dec 2023 10:06:38 +0200 Subject: Add gnosis-display--cloze-user-answer --- gnosis.el | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/gnosis.el b/gnosis.el index a7a2967..7ff38fa 100644 --- a/gnosis.el +++ b/gnosis.el @@ -119,6 +119,17 @@ Example: (goto-char (point-min)) (search-forward cloze-chars nil t) (replace-match (propertize correct 'face 'gnosis-face-cloze-correct)))) + +(cl-defun gnosis-display--cloze-user-answer (user-input &optional (false nil)) + "Display USER-INPUT answer for cloze note. + +If FALSE t, use gnosis-face-cloze-false face" + (with-gnosis-buffer + (goto-char (point-max)) + (insert (concat "\nYour answer: " (propertize user-input 'face (if false + 'gnosis-face-cloze-false + 'gnosis-face-cloze-correct)))))) + (defun gnosis-display--correct-answer-mcq (answer user-choice) "Display correct ANSWER & USER-CHOICE for MCQ note." (with-gnosis-buffer -- cgit v1.2.3