summaryrefslogtreecommitdiff
path: root/gnosis-dev.el
diff options
context:
space:
mode:
Diffstat (limited to 'gnosis-dev.el')
-rw-r--r--gnosis-dev.el42
1 files changed, 23 insertions, 19 deletions
diff --git a/gnosis-dev.el b/gnosis-dev.el
index dadbe04..f5003fc 100644
--- a/gnosis-dev.el
+++ b/gnosis-dev.el
@@ -59,13 +59,21 @@ by the thoracodorsal nerve."
:hint "note"
:tags (gnosis-dev-random-items gnosis-dev-tags 2)
:extra "extra")))
- (when (y-or-n-p "Add mulit cloze type?")
+ (when (y-or-n-p "Add note with multiple clozes?")
(dotimes (_ num)
(gnosis-add-note--cloze :deck testing-deck
:note "this is a {c1:note} with multiple {c1:clozes}"
:hint "note"
:tags (gnosis-dev-random-items gnosis-dev-tags 2)
- :extra "extra")))))
+ :extra "extra")))
+ (when (y-or-n-p "Add note type y-or-n?")
+ (dotimes (_ num)
+ (gnosis-add-note--y-or-n :deck testing-deck
+ :question "Is Codeine recommended in breastfeeding mothers?"
+ :hint "hint"
+ :answer 110
+ :extra "extra"
+ :tags (gnosis-dev-random-items gnosis-dev-tags 2))))))
(defun gnosis-dev-test ()
"Begin/End testing env.
@@ -75,27 +83,23 @@ If ask nil, leave development env"
(let ((ask (y-or-n-p "Start development env?"))
(testing-dir (concat gnosis-dir "/testing")))
(if ask
- (progn (unless (file-exists-p testing-dir)
- (make-directory testing-dir))
- (setf gnosis-db (emacsql-sqlite (concat testing-dir "/testing.db")))
- (setf gnosis-testing t)
- (gnosis-db-init)
- (gnosis-dev-add-fields)
- (message "Adding testing values...")
- (message "Development env is ready for testing."))
+ (progn
+ (unless (file-exists-p testing-dir)
+ (make-directory testing-dir))
+ (setf gnosis-db (emacsql-sqlite (concat testing-dir "/testing.db")))
+ (setf gnosis-testing t)
+ (dolist (table '(notes decks review review-log extras))
+ (condition-case nil
+ (gnosis--drop-table table)
+ (error (message "No %s table to drop." table))))
+ (gnosis-db-init)
+ (gnosis-dev-add-fields)
+ (message "Adding testing values...")
+ (message "Development env is ready for testing."))
(setf gnosis-db (emacsql-sqlite (concat (file-name-as-directory gnosis-dir) "gnosis.db")))
(setf gnosis-testing nil)
(message "Exited development env."))))
-(defun gnosis-dev-retest ()
- "Redo database."
- (interactive)
- (dolist (table '(notes decks review review-log extras))
- (condition-case nil
- (gnosis--drop-table table)
- (error (message "No %s table to drop." table))))
- (gnosis-db-init)
- (gnosis-dev-test))
(provide 'gnosis-dev)
;;; gnosis-dev.el ends here