summaryrefslogtreecommitdiff
path: root/gnosis.el
diff options
context:
space:
mode:
authorThanos Apollo <[email protected]>2023-12-28 02:05:37 +0200
committerThanos Apollo <[email protected]>2023-12-28 02:06:37 +0200
commit66165f7988bf3f2bfe8ea02bdb39baa62d89f017 (patch)
tree199ef9bd395e9bf954d2db3e334ba5863b5df35f /gnosis.el
parent03eb1797156525ed521ab05ab32cd8186a01add2 (diff)
basic: Display user-input with directions after review
Diffstat (limited to 'gnosis.el')
-rw-r--r--gnosis.el17
1 files 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."