summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThanos Apollo <[email protected]>2024-01-04 07:54:22 +0200
committerThanos Apollo <[email protected]>2024-01-04 07:54:22 +0200
commit657e44185c4c830652770b142375f429603dbc3b (patch)
treefe9bbd75ae84ba5a7234f8218b4c52ff87946d2b
parent1f41618eb14711bfbb758806c639f990d86626ff (diff)
Add gnosis-get-notes-for-deck
Return a list of ID vlaues for each note with value of deck-id DECK
-rw-r--r--gnosis.el16
1 files changed, 3 insertions, 13 deletions
diff --git a/gnosis.el b/gnosis.el
index bd3c078..e8e7b8c 100644
--- a/gnosis.el
+++ b/gnosis.el
@@ -595,19 +595,6 @@ See `gnosis-add-note--cloze' for more reference."
("Double" (gnosis-add-note-double))
(_ (message "No such type."))))
-(defun gnosis-export-deck (deck filename)
- "Export DECK as FILENAME.
-
-Export all notes for DECK, in a file as FILENAME."
- (interactive (list (gnosis--get-deck-id)
- (read-string "Name for exported file: ")))
- (let ((notes (gnosis-select '[type main options answer tags] 'notes `(= deck-id ,deck)))
- (default-directory gnosis-dir))
- (with-temp-file (concat filename ".el")
- (insert "(" (concat "gnosis-define-deck " "'" filename "\n"))
- (insert (pp-to-string notes) "\n")
- (insert ")" ))))
-
(defun gnosis-mcq-answer (id)
"Choose the correct answer, from mcq choices for question ID."
(let ((choices (gnosis-get 'options 'notes `(= id ,id)))
@@ -1063,6 +1050,9 @@ SECOND-IMAGE: Image to display after user-input"
(gnosis-update 'notes `(= ,field ',value) `(= id ,id)))
(t (gnosis-update 'notes `(= ,field ,value) `(= id ,id))))))
+(cl-defun gnosis-get-notes-for-deck (&optional (deck (gnosis--get-deck-id)))
+ "Return a list of ID vlaues for each note with value of deck-id DECK."
+ (apply #'append (gnosis-select 'id 'notes `(= deck-id ,deck))))
;;;###autoload
(defun gnosis-review ()