diff options
author | Thanos Apollo <[email protected]> | 2024-07-16 14:05:17 +0300 |
---|---|---|
committer | Thanos Apollo <[email protected]> | 2024-07-16 14:05:17 +0300 |
commit | c4497af9171f932c8aad29f9020009089e046a10 (patch) | |
tree | bc43b1aa6622f16e4c0af548515f4e41b0b436fc /gnosis.el | |
parent | 3f78225016e797770923cbf5559d10685c9e87b3 (diff) |
cloze: Add gnosis-cloze-mark-false: Mark false answers.
Diffstat (limited to 'gnosis.el')
-rw-r--r-- | gnosis.el | 14 |
1 files changed, 14 insertions, 0 deletions
@@ -489,6 +489,20 @@ Refer to =gnosis-db-schema-extras' for informations on images stored." (replace-match (propertize answer 'face face) nil t))) (buffer-string))) +(defun gnosis-cloze-mark-false (str answers) + "Mark contents of STR as false for ANSWERS. + +First item of answers will be marked as false, while the rest unanswered." + (let* ((false (car answers)) + (unanswered (cdr answers)) + (str-with-false (and answers (gnosis-cloze-mark-answers str (list false) 'gnosis-face-false))) + final) + (if unanswered + (setq final (gnosis-cloze-mark-answers str-with-false (if (listp unanswered) unanswered + (list unanswered)) + 'underline)) + (setq final (or str-with-false str))) + final)) (defun gnosis-display-basic-answer (answer success user-input) "Display ANSWER. |