From 0c5d778ef8bc805ce8968a7512599b9d43e244d1 Mon Sep 17 00:00:00 2001 From: Thanos Apollo Date: Thu, 28 Dec 2023 04:26:29 +0200 Subject: cloze: Use options as hint & display them for cloze type notes --- gnosis.el | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/gnosis.el b/gnosis.el index 0e8393a..eedf2ff 100644 --- a/gnosis.el +++ b/gnosis.el @@ -288,13 +288,13 @@ choice in the `CHOICES' list. Each note must correspond to one `DECK'. `SUSPEND' is a binary value, where 1 is for suspend." (interactive (list :deck (gnosis--get-deck-name) :note (read-string "Cloze note: ") + :hint (read-string "Hint: ") :extra (read-string "Extra: ") :tags (gnosis-prompt-tag))) (let ((notags-note (gnosis-cloze-remove-tags note)) (clozes (gnosis-cloze-extract-answers note))) (cl-loop for cloze in clozes - ;; TODO: OPTIONS need to be hints - do (gnosis-add-note-fields deck "cloze" notags-note "" cloze extra tags suspend image)))) + do (gnosis-add-note-fields deck "cloze" notags-note hint cloze extra tags suspend image)))) (defun gnosis-add-note (type) "Create note as TYPE." @@ -488,9 +488,11 @@ If user-input is equal to CLOZE, return t." (defun gnosis-review-cloze (id) "Review cloze type note for ID." (let* ((main (gnosis-get 'main 'notes `(= id ,id))) - (clozes (gnosis-get 'answer 'notes `(= id ,id)))) + (clozes (gnosis-get 'answer 'notes `(= id ,id))) + (hint (gnosis-get 'options 'notes `(= id ,id)))) (gnosis-display--image id) (gnosis-display--cloze-sentence main clozes) + (gnosis-display--hint hint) (cl-loop for cloze in clozes do (let ((input (gnosis-review-cloze--input cloze))) (when (equal (car input) nil) -- cgit v1.2.3