From 5a25c324919fc46bfd7353f53430eab0e2949552 Mon Sep 17 00:00:00 2001 From: Thanos Apollo Date: Wed, 27 Dec 2023 07:15:06 +0200 Subject: Redo gnosis-review-cloze--input Return t or nil depending on user input, this will be used on cl-loop, otherwise depending on this function for a sentence wiht multiple clozes would be a mess --- gnosis.el | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/gnosis.el b/gnosis.el index fcd4fb2..4878680 100644 --- a/gnosis.el +++ b/gnosis.el @@ -349,16 +349,14 @@ SUCCESS is a binary value, 1 is for successful review." (gnosis-display--correct-answer-mcq answer user-choice) (gnosis-display--extra id))) -(defun gnosis-review-cloze--input (id answer) +(defun gnosis-review-cloze--input (cloze) "Prompt for user input during cloze review. -If user-input is equal to ANSWER, update card ID for successful review." - (let ((user-input (downcase (read-string "Answer: ")))) - (if (string= user-input (downcase answer)) - (progn (gnosis-review--update id 1) - (message "Correct!")) - (gnosis-review--update id 0) - (message "Fail")))) +If user-input is equal to CLOZE, return t." + (let ((user-input (read-string "Cloze: "))) + (if (string= user-input cloze) + t + nil))) (defun gnosis-review-cloze (id) "Review cloze type note for ID." -- cgit v1.2.3