summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThanos Apollo <[email protected]>2023-12-27 10:06:19 +0200
committerThanos Apollo <[email protected]>2023-12-27 10:06:19 +0200
commitcbc0f2d04854dd2a05ce7fea26005bb587996c5d (patch)
treeeec940539e4805c2606745fabf59950c815e61ff
parent0677731a081c4e41404eabd447ad2c230519c0f4 (diff)
Add gnosis-display--cloze-correct
-rw-r--r--gnosis.el8
1 files changed, 7 insertions, 1 deletions
diff --git a/gnosis.el b/gnosis.el
index 3a41e58..a7a2967 100644
--- a/gnosis.el
+++ b/gnosis.el
@@ -113,6 +113,12 @@ Example:
(fill-paragraph (insert
(gnosis-cloze-replace-words sentence clozes gnosis-cloze-char)))))
+(defun gnosis-display--cloze-correct (cloze-chars correct)
+ "Replace CLOZE-CHARS with CORRECT."
+ (with-gnosis-buffer
+ (goto-char (point-min))
+ (search-forward cloze-chars nil t)
+ (replace-match (propertize correct 'face 'gnosis-face-cloze-correct))))
(defun gnosis-display--correct-answer-mcq (answer user-choice)
"Display correct ANSWER & USER-CHOICE for MCQ note."
(with-gnosis-buffer
@@ -362,7 +368,7 @@ SUCCESS is a binary value, 1 is for successful review."
(message "Correct!"))
(gnosis-review--update id 0)
(message "False"))
- (sit-for 0.5)
+ (sit-for 0.3)
(gnosis-display--correct-answer-mcq answer user-choice)
(gnosis-display--extra id)))