From cbc0f2d04854dd2a05ce7fea26005bb587996c5d Mon Sep 17 00:00:00 2001 From: Thanos Apollo Date: Wed, 27 Dec 2023 10:06:19 +0200 Subject: Add gnosis-display--cloze-correct --- gnosis.el | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) 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))) -- cgit v1.2.3