diff options
author | Thanos Apollo <[email protected]> | 2024-03-10 14:42:31 +0200 |
---|---|---|
committer | Thanos Apollo <[email protected]> | 2024-03-10 14:44:02 +0200 |
commit | b95c25089f83cc42d3f7c76f02309603d9b4cd4b (patch) | |
tree | 3ea754984c4874d8329c63b7a9d992af20875081 | |
parent | d99b81b165450308a1f2290eb4d0b233fe0967e2 (diff) |
[fix] gnosis-review-cloze: Fix multiple clozes reveal
Previous implementation would reveal clozes in the wrong order when
using > 3 clozes.
-rw-r--r-- | gnosis.el | 9 |
1 files changed, 3 insertions, 6 deletions
@@ -1136,8 +1136,7 @@ Used to reveal all clozes left with `gnosis-face-cloze-unanswered' face." "Review cloze type note for ID." (let* ((main (gnosis-get 'main 'notes `(= id ,id))) (clozes (gnosis-get 'answer 'notes `(= id ,id))) - (num 1) - (clozes-num (length clozes)) + (num 1) ;; Number of clozes revealed (hint (gnosis-get 'options 'notes `(= id ,id)))) (gnosis-display-cloze-sentence main clozes) (gnosis-display-image id) @@ -1150,11 +1149,9 @@ Used to reveal all clozes left with `gnosis-face-cloze-unanswered' face." (setf num (1+ num))) ;; Reveal cloze for wrong input, with `gnosis-face-false' (gnosis-display-cloze-reveal :replace cloze :success nil) - ;; Do NOT remove the _when_ statement, unexpected - ;; bugs occur if so depending on the number of - ;; clozes. - (when (< num clozes-num) (gnosis-review-cloze-reveal-unaswered clozes)) (gnosis-display-cloze-user-answer (cdr input)) + ;; Reveal all clozes left with `gnosis-face-cloze-unanswered' face + (gnosis-review-cloze-reveal-unaswered (nthcdr num clozes)) (gnosis-review--update id nil) (cl-return))) ;; Update note after all clozes are revealed successfully |