diff options
author | Thanos Apollo <[email protected]> | 2024-07-17 10:22:40 +0300 |
---|---|---|
committer | Thanos Apollo <[email protected]> | 2024-07-17 10:22:40 +0300 |
commit | 4cd3ce6993a9b97b698537c428addf7387b13a3f (patch) | |
tree | ab357805ce5760b0bd1b88a621d6444db6b433db /gnosis.el | |
parent | 889a1fc8691494e795520a2b51e8f8fd6183dce0 (diff) |
cloze: edit: Add assertion for string or nil.
* Contents inside options/hints should be either nil or string.
Diffstat (limited to 'gnosis.el')
-rw-r--r-- | gnosis.el | 3 |
1 files changed, 2 insertions, 1 deletions
@@ -1898,7 +1898,8 @@ SUSPEND: Suspend note, 0 for unsuspend, 1 for suspend" (not (stringp options))) (cl-assert (or (listp options) (stringp options)) nil "Options must be a list or a string.") (cl-assert (gnosis-cloze-check main answer) nil "Clozes are not part of the question (main).") - (cl-assert (>= (length answer) (length options)) nil "Hints (options) must be equal or less than clozes (answer).")) + (cl-assert (>= (length answer) (length options)) nil "Hints (options) must be equal or less than clozes (answer).") + (cl-assert (cl-every (lambda (item) (or (null item) (stringp item))) options) nil "Hints (options) must be either nil or a string.")) ;; Construct the update clause for the emacsql update statement. (cl-loop for (field . value) in `((main . ,main) (options . ,options) |