summaryrefslogtreecommitdiff
path: root/gnosis.el
diff options
context:
space:
mode:
authorThanos Apollo <[email protected]>2023-12-28 13:29:09 +0200
committerThanos Apollo <[email protected]>2023-12-28 13:29:09 +0200
commita408e71eb2ebf2ccd186bcff83aff66884c204e1 (patch)
treed5f24a07008194d2a6c4d836888a0746b6493c11 /gnosis.el
parent8f5316bd10b9f7702485fe3da23d0faeb52a9112 (diff)
gnosis-review: Fix bugs on clozes, reveal one cloze per loop
Diffstat (limited to 'gnosis.el')
-rw-r--r--gnosis.el6
1 files changed, 5 insertions, 1 deletions
diff --git a/gnosis.el b/gnosis.el
index 27bd961..a94ab68 100644
--- a/gnosis.el
+++ b/gnosis.el
@@ -565,13 +565,17 @@ If user-input is equal to CLOZE, return t."
"Review cloze type note for ID."
(let* ((main (gnosis-get 'main 'notes `(= id ,id)))
(clozes (gnosis-get 'answer 'notes `(= id ,id)))
+ (clozes-num (length clozes))
+ (num 0)
(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)
+ (if (equal (car input) t)
+ (progn (gnosis-review-cloze--reveal (list (nth num clozes)))
+ (setf num (1+ num)))
(gnosis-review-cloze--reveal clozes)
(gnosis-display--cloze-user-answer (cdr input) t)
(gnosis-review--update id 0)