From 297338ffb376be27b60ff2c58ed54575222d39b2 Mon Sep 17 00:00:00 2001 From: Thanos Apollo Date: Thu, 28 Dec 2023 04:06:50 +0200 Subject: Add gnosis-dev-add-fields Function to for testing with items > 1000 --- gnosis-dev.el | 32 +++++++++++++++++++++++++++++++- 1 file changed, 31 insertions(+), 1 deletion(-) (limited to 'gnosis-dev.el') diff --git a/gnosis-dev.el b/gnosis-dev.el index 2457300..0a742d7 100644 --- a/gnosis-dev.el +++ b/gnosis-dev.el @@ -20,6 +20,33 @@ (setq selected-items (cons item selected-items)) (setq shuffled-list (append (butlast shuffled-list index) (nthcdr (1+ index) shuffled-list))))) selected-items)) + +(defun gnosis-dev-add-fields () + "Add random inputs to test." + (dotimes (_ 500) + (gnosis-add-note-mcq :deck "Anatomy" + :question "A 37-year-old man is admitted to the +emergency department after a severe car crash. After examining the +patient the emergency medicine physician concludes that the serratus +anterior muscle is damaged. Which of the following nerves innervates +the serratus anterior muscle?" + :choices '("Long thoracic" "Axillary" "Spinal accessory" "Dorsal scapular" "Thoracodorsal") + :correct-answer 1 + :extra "The long thoracic is the only nerve that +innervates the serratus anterior. The axillary nerve innervates the +deltoid, the spinal accessory nerve innervates the sternocleidomastoid +and trapezius, the dorsal scapular nerve supplies the rhomboid muscles +and levator scapulae, and the latissimus dorsi is the muscle supplied +by the thoracodorsal nerve." + :tags (gnosis-dev-random-items gnosis-dev-tags 2))) + (dotimes (_ 500) + (gnosis-add-note-basic :deck "Anatomy" + :question "A question" + :hint "hint" + :answer "answer" + :extra "extra" + :tags (gnosis-dev-random-items gnosis-dev-tags 2)))) + (defun gnosis-dev-test () "Start testing env." (interactive) @@ -30,7 +57,10 @@ (make-directory gnosis-testing-dir)) (setf gnosis-db (emacsql-sqlite-open (concat gnosis-testing-dir "/testing.db"))) (gnosis-init)) - (setf gnosis-db (emacsql-sqlite-open (concat gnosis-dir "/" "gnosis.db")))))) + (setf gnosis-db (emacsql-sqlite-open (concat gnosis-dir "/" "gnosis.db")))) + (message "Adding testing values...") + (gnosis-dev-add-fields) + (message "Done."))) (provide 'gnosis-dev) ;;; gnosis-dev.el ends here -- cgit v1.2.3