From 9f81a472ef13df058e7bf3408c23b97a9a4941d7 Mon Sep 17 00:00:00 2001 From: Thanos Apollo Date: Wed, 27 Dec 2023 10:57:17 +0200 Subject: Add gnosis-display--basic-answer --- gnosis.el | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/gnosis.el b/gnosis.el index cc50a82..f954d29 100644 --- a/gnosis.el +++ b/gnosis.el @@ -113,6 +113,18 @@ Example: (fill-paragraph (insert (gnosis-cloze-replace-words sentence clozes gnosis-cloze-char))))) +(defun gnosis-display--basic-answer (answer success) + "Display ANSWER. + +Depending on the value of SUCCESS, display it using different faces. +If success t, use `gnsois-face-correct' +else use `gnosis-face-false'" + (with-gnosis-buffer + (insert + (concat "\n\nAnswer: " (propertize answer 'face (if success + 'gnosis-face-correct + 'gnosis-face-false)))))) + (defun gnosis-display--cloze-correct (cloze-chars correct) "Replace CLOZE-CHARS with CORRECT." (with-gnosis-buffer -- cgit v1.2.3