From 66165f7988bf3f2bfe8ea02bdb39baa62d89f017 Mon Sep 17 00:00:00 2001 From: Thanos Apollo Date: Thu, 28 Dec 2023 02:05:37 +0200 Subject: basic: Display user-input with directions after review --- gnosis.el | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/gnosis.el b/gnosis.el index 1f17b30..5202416 100644 --- a/gnosis.el +++ b/gnosis.el @@ -113,7 +113,7 @@ Example: (fill-paragraph (insert (gnosis-cloze-replace-words sentence clozes gnosis-cloze-char))))) -(defun gnosis-display--basic-answer (answer success) +(defun gnosis-display--basic-answer (answer success user-input) "Display ANSWER. Depending on the value of SUCCESS, display it using different faces. @@ -121,16 +121,21 @@ 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)))))) + (concat "\n\nAnswer: " (propertize answer 'face (if success 'gnosis-face-correct 'gnosis-face-false)))) + ;; Insert user wrong answer + (when (not success) + (insert (concat "\n" + (propertize "Your answer:" 'face 'gnosis-face-directions) + " " + (propertize user-input 'face 'gnosis-face-false)))))) (defun gnosis-display--hint (hint) "Display HINT." (with-gnosis-buffer (goto-char (point-max)) - (insert (concat "\n" - (propertize hint 'face 'gnosis-face-hint))))) + (insert (concat + (propertize "\n\n-----\n" 'face 'gnosis-face-seperator) + (propertize hint 'face 'gnosis-face-hint))))) (defun gnosis-display--cloze-correct (cloze-chars correct) "Replace CLOZE-CHARS with CORRECT." -- cgit v1.2.3