branch: elpa/gnosis
commit 667a0eb3024cc4eb5ae74b1d49f113420281f451
Author: Thanos Apollo <[email protected]>
Commit: Thanos Apollo <[email protected]>

    Add gnosis-monkeytype-answer: Monkeytype wrong answers.
    
    * Function to be used to monkeytype wrong answers upon wrong recall.
---
 gnosis.el | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/gnosis.el b/gnosis.el
index aa0445bab12..fe7fca15b6a 100644
--- a/gnosis.el
+++ b/gnosis.el
@@ -1211,6 +1211,14 @@ If NEW? is non-nil, increment new themata log by 1."
                              answer))
          (t (gnosis-monkeytype keimenon type answer)))))
 
+(defun gnosis-monkeytype-answer (thema)
+  "Monkeytype answer for THEMA id."
+  (let* ((thema-context (gnosis-select '[type answer] 'themata `(= id ,thema) 
t))
+        (type (nth 0 thema-context))
+        (answer (cl-loop for answer in (nth 1 thema-context)
+                         collect (gnosis-utils-trim-quotes answer))))
+    (gnosis-monkeytype (mapconcat #'identity answer " ") type answer)))
+
 (defun gnosis-review-process-thema (thema &optional thema-count)
   "Process review for THEMA and update session statistics.
 

Reply via email to