[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/org-drill 0184220926 150/251: Replace drill-typed-answer
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/org-drill 0184220926 150/251: Replace drill-typed-answer |
Date: |
Mon, 17 Jan 2022 18:59:10 -0500 (EST) |
branch: elpa/org-drill
commit 01842209269e290676e38b764d23b408850cb747
Author: Phillip Lord <phillip.lord@russet.org.uk>
Commit: Phillip Lord <phillip.lord@russet.org.uk>
Replace drill-typed-answer
---
org-drill.el | 30 ++++++++++++++----------------
1 file changed, 14 insertions(+), 16 deletions(-)
diff --git a/org-drill.el b/org-drill.el
index 611c0c9ccb..104f92b6de 100644
--- a/org-drill.el
+++ b/org-drill.el
@@ -582,13 +582,6 @@ This variable is useful for card types that compute their
answers
-- for example, a card type that asks the student to translate a
random number to another language. ")
-
-(defvar drill-typed-answer nil
- "Global variable that can be bound to the last answer typed by
-the user. Used by card types that ask the user to type in an
-answer, rather than just pressing spacebar to reveal the
-answer.")
-
(defvar org-drill-display-answer-hook nil)
(defcustom org-drill-cloze-length-matches-hidden-text-p
@@ -644,7 +637,11 @@ for review unless they were already reviewed in the recent
past?"
(cnt :initform 0)
(exit-kind
:initform nil
- :documentation "Return value from typed answers which use recursive
edit."))
+ :documentation "Return value from typed answers which use recursive edit.")
+ (typed-answer
+ :initform nil
+ :documentation "The last answer typed by the user.")
+ )
:documentation "An org-drill session object carries data about
the current state of a particular org-drill session." )
@@ -1472,9 +1469,9 @@ of QUALITY."
(let ((ch nil)
(input nil)
(next-review-dates (org-drill-hypothetical-next-review-dates))
- (typed-answer-statement (if drill-typed-answer
+ (typed-answer-statement (if (oref session typed-answer)
(format "Your answer: %s\n"
- drill-typed-answer)
+ (oref session typed-answer))
""))
(key-prompt (format "(0-5, %c=help, %c=edit, %c=tags, %c=quit)"
org-drill--help-key
@@ -1776,9 +1773,10 @@ Consider reformulating the item to make it easier to
remember.\n"
(defun org-drill-response-rtn ()
(interactive)
- (setq drill-typed-answer (buffer-string))
- (oset org-drill-current-session exit-kind t)
- (org-drill-response-complete))
+ (let ((session org-drill-current-session))
+ (setf (oref session drill-typed-answer) (buffer-string))
+ (oset session exit-kind t)
+ (org-drill-response-complete)))
(defun org-drill-response-quit ()
(interactive)
@@ -3943,13 +3941,13 @@ shuffling is done in place."
(let ((org-drill-question-tag org-drill-leitner-tag))
(org-drill-entry-f (apply-partially #'org-drill-leitner-rebox session))))
-(defun org-drill-leitner-rebox ()
+(defun org-drill-leitner-rebox (session)
"Returns quality rating (0-5), or nil if the user quit."
(let ((ch nil)
(input nil)
- (typed-answer-statement (if drill-typed-answer
+ (typed-answer-statement (if (oref session typed-answer)
(format "Your answer: %s\n"
- drill-typed-answer)
+ (oref session typed-answer))
""))
(key-prompt (format "(0-5, %c=help, %c=edit, %c=tags, %c=quit)"
org-drill--help-key
- [nongnu] elpa/org-drill b6a4b4f103 238/251: Merge branch 'master' into 'master', (continued)
- [nongnu] elpa/org-drill b6a4b4f103 238/251: Merge branch 'master' into 'master', ELPA Syncer, 2022/01/17
- [nongnu] elpa/org-drill 749e012e65 216/251: Merge branch 'fix/drill-matching' into 'master', ELPA Syncer, 2022/01/17
- [nongnu] elpa/org-drill 96d7c199a0 221/251: Merge branch 'patch-1' into 'master', ELPA Syncer, 2022/01/17
- [nongnu] elpa/org-drill 35c1ce3499 248/251: Merge branch 'branweb/org-mode-version' into 'master', ELPA Syncer, 2022/01/17
- [nongnu] elpa/org-drill 7dece4a5e4 229/251: Fix org-get-tags compatability, ELPA Syncer, 2022/01/17
- [nongnu] elpa/org-drill 0e0f7bcddd 242/251: Bump org-mode version to 9.3, ELPA Syncer, 2022/01/17
- [nongnu] elpa/org-drill e55415221e 249/251: Fix autoloads, ELPA Syncer, 2022/01/17
- [nongnu] elpa/org-drill 78d3472033 246/251: add cram-mode test, ELPA Syncer, 2022/01/17
- [nongnu] elpa/org-drill b431634c3e 018/251: Bug fix: when drill sessions span more than one file, display items in the other files correctly., ELPA Syncer, 2022/01/17
- [nongnu] elpa/org-drill eb370c7405 077/251: - Moved a line with side effects to earlier in the file, possibly fixing an, ELPA Syncer, 2022/01/17
- [nongnu] elpa/org-drill 0184220926 150/251: Replace drill-typed-answer,
ELPA Syncer <=
- [nongnu] elpa/org-drill b7b295c80b 122/251: Update gitignore, ELPA Syncer, 2022/01/17
- [nongnu] elpa/org-drill 2832be1ad4 153/251: Replace more non-namespaced commands, ELPA Syncer, 2022/01/17
- [nongnu] elpa/org-drill b0ee414c16 177/251: Fix call to removed variable, ELPA Syncer, 2022/01/17
- [nongnu] elpa/org-drill 90d777bd55 183/251: Fix more byte compile errors, ELPA Syncer, 2022/01/17
- [nongnu] elpa/org-drill 3c356dfc5a 179/251: Fix robot testing and reference to drill-typed-answer, ELPA Syncer, 2022/01/17
- [nongnu] elpa/org-drill 8c36f488e2 162/251: Spanish card fixes and full test set, ELPA Syncer, 2022/01/17
- [nongnu] elpa/org-drill 29b4faa174 190/251: Fix compat call, ELPA Syncer, 2022/01/17
- [nongnu] elpa/org-drill fdbbccad8c 218/251: Merge branch 'patch-2' into 'master', ELPA Syncer, 2022/01/17
- [nongnu] elpa/org-drill 4daff57b81 161/251: Replace dynamically scoped end-pos, ELPA Syncer, 2022/01/17
- [nongnu] elpa/org-drill 04283a8a6c 228/251: Remove obsolete org-drill-optimal-factor-matrix, ELPA Syncer, 2022/01/17