[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/org-drill e52080c97b 047/251: New option: org-drill-sm5-in
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/org-drill e52080c97b 047/251: New option: org-drill-sm5-initial-interval. Allows users of SM5 algorithm to adjust the first |
Date: |
Mon, 17 Jan 2022 18:59:00 -0500 (EST) |
branch: elpa/org-drill
commit e52080c97b59ee94871d29ce39a1bd91d8f3e318
Author: eeeickythump <devnull@localhost>
Commit: eeeickythump <devnull@localhost>
New option: org-drill-sm5-initial-interval. Allows users of SM5 algorithm
to adjust the first
repetition interval from the 4 days that is mandated in the official
algorithm.
New option: org-drill-cloze-text-weight: Allows users of hide1_firstmore,
show1_firstless and
show1_lastmore card types to control how often the 'infrequent' form of the
card is shown.
Some bugfixes to DRILL_CARD_WEIGHT property.
---
org-drill.el | 168 +++++++++++++++++++++++++++++++++++++++++++++--------------
1 file changed, 129 insertions(+), 39 deletions(-)
diff --git a/org-drill.el b/org-drill.el
index a6a42da038..29e1657649 100755
--- a/org-drill.el
+++ b/org-drill.el
@@ -2,7 +2,7 @@
;;; org-drill.el - Self-testing using spaced repetition
;;;
;;; Author: Paul Sexton <eeeickythump@gmail.com>
-;;; Version: 2.3.3
+;;; Version: 2.3.4
;;; Repository at http://bitbucket.org/eeeickythump/org-drill/
;;;
;;;
@@ -307,6 +307,15 @@ pace of learning."
:type 'sexp)
+(defcustom org-drill-sm5-initial-interval
+ 4.0
+ "In the SM5 algorithm, the initial interval after the first
+successful presentation of an item is always 4 days. If you wish to change
+this, you can do so here."
+ :group 'org-drill
+ :type 'float)
+
+
(defcustom org-drill-add-random-noise-to-intervals-p
nil
"If true, the number of days until an item's next repetition
@@ -334,6 +343,27 @@ is used."
:type 'boolean)
+(defcustom org-drill-cloze-text-weight
+ 4
+ "For card types 'hide1_firstmore', 'show1_lastmore' and 'show1_firstless',
+this number determines how often the 'less favoured' situation
+should arise. It will occur 1 in every N trials, where N is the
+value of the variable.
+
+For example, with the hide1_firstmore card type, the first piece
+of clozed text should be hidden more often than the other
+pieces. If this variable is set to 4 (default), the first item
+will only be shown 25% of the time (1 in 4 trials). Similarly for
+show1_lastmore, the last item will be shown 75% of the time, and
+for show1_firstless, the first item would only be shown 25% of the
+time.
+
+If the value of this variable is NIL, then weighting is disabled, and
+all weighted card types are treated as their unweighted equivalents."
+ :group 'org-drill
+ :type '(choice integer (const nil)))
+
+
(defcustom org-drill-cram-hours
12
"When in cram mode, items are considered due for review if
@@ -436,6 +466,7 @@ for review unless they were already reviewed in the recent
past?")
(put 'org-drill-hide-item-headings-p 'safe-local-variable 'booleanp)
(put 'org-drill-spaced-repetition-algorithm 'safe-local-variable
'(lambda (val) (memq val '(simple8 sm5 sm2))))
+(put 'org-drill-sm5-initial-interval 'safe-local-variable 'floatp)
(put 'org-drill-add-random-noise-to-intervals-p 'safe-local-variable 'booleanp)
(put 'org-drill-adjust-intervals-for-early-and-late-repetitions-p
'safe-local-variable 'booleanp)
@@ -446,6 +477,8 @@ for review unless they were already reviewed in the recent
past?")
(put 'org-drill-scope 'safe-local-variable
'(lambda (val) (or (symbolp val) (listp val))))
(put 'org-drill-save-buffers-after-drill-sessions-p 'safe-local-variable
'booleanp)
+(put 'org-drill-cloze-text-weight 'safe-local-variable
+ '(lambda (val) (or (null val) (integerp val))))
;;;; Utilities ================================================================
@@ -891,9 +924,23 @@ Returns a list: (INTERVAL REPEATS EF FAILURES MEAN
TOTAL-REPEATS OFMATRIX), wher
;;; SM5 Algorithm =============================================================
+
+(defun initial-optimal-factor-sm5 (n ef)
+ (if (= 1 n)
+ org-drill-sm5-initial-interval
+ ef))
+
+(defun get-optimal-factor-sm5 (n ef of-matrix)
+ (let ((factors (assoc n of-matrix)))
+ (or (and factors
+ (let ((ef-of (assoc ef (cdr factors))))
+ (and ef-of (cdr ef-of))))
+ (initial-optimal-factor-sm5 n ef))))
+
+
(defun inter-repetition-interval-sm5 (last-interval n ef &optional of-matrix)
- (let ((of (get-optimal-factor n ef (or of-matrix
- org-drill-optimal-factor-matrix))))
+ (let ((of (get-optimal-factor-sm5 n ef (or of-matrix
+
org-drill-optimal-factor-matrix))))
(if (= 1 n)
of
(* of last-interval))))
@@ -917,20 +964,20 @@ Returns a list: (INTERVAL REPEATS EF FAILURES MEAN
TOTAL-REPEATS OFMATRIX), wher
(let ((next-ef (modify-e-factor ef quality))
(old-ef ef)
- (new-of (modify-of (get-optimal-factor n ef of-matrix)
+ (new-of (modify-of (get-optimal-factor-sm5 n ef of-matrix)
quality org-drill-learn-fraction))
(interval nil))
(when (and org-drill-adjust-intervals-for-early-and-late-repetitions-p
delta-days (minusp delta-days))
(setq new-of (org-drill-early-interval-factor
- (get-optimal-factor n ef of-matrix)
+ (get-optimal-factor-sm5 n ef of-matrix)
(inter-repetition-interval-sm5
last-interval n ef of-matrix)
delta-days)))
(setq of-matrix
(set-optimal-factor n next-ef of-matrix
- (round-float new-of 3))) ; round OF to 3 d.p.
+ (round-float new-of 3))) ; round OF to 3 d.p.
(setq ef next-ef)
@@ -939,7 +986,7 @@ Returns a list: (INTERVAL REPEATS EF FAILURES MEAN
TOTAL-REPEATS OFMATRIX), wher
((<= quality org-drill-failure-quality)
(list -1 1 old-ef (1+ failures) meanq (1+ total-repeats)
of-matrix)) ; Not clear if OF matrix is supposed to be
- ; preserved
+ ; preserved
;; For a zero-based quality of 4 or 5, don't repeat
;; ((and (>= quality 4)
;; (not org-learn-always-reschedule))
@@ -1101,12 +1148,15 @@ item will be scheduled exactly this many days into the
future."
(if (numberp days-ahead)
(setq next-interval days-ahead))
- (org-drill-store-item-data next-interval repetitions failures
- total-repeats meanq ease)
(if (and (null days-ahead)
(numberp weight) (plusp weight)
(not (minusp next-interval)))
- (setq next-interval (max 1.0 (/ next-interval weight))))
+ (setq next-interval
+ (max 1.0 (+ last-interval
+ (/ (- next-interval last-interval) weight)))))
+
+ (org-drill-store-item-data next-interval repetitions failures
+ total-repeats meanq ease)
(if (eql 'sm5 org-drill-spaced-repetition-algorithm)
(setq org-drill-optimal-factor-matrix new-ofmatrix))
@@ -1150,7 +1200,8 @@ of QUALITY."
((not (plusp next-interval))
0)
((and (numberp weight) (plusp weight))
- (max 1.0 (/ next-interval weight)))
+ (+ last-interval
+ (max 1.0 (/ (- next-interval last-interval) weight))))
(t
next-interval))))))
@@ -1722,46 +1773,84 @@ chosen at random."
(defun org-drill-present-multicloze-hide1-firstmore ()
- "Three out of every four repetitions, hides the FIRST piece of
-text that is marked for cloze deletion. One out of every four
-repetitions, hide one of the other pieces of text, chosen at
-random."
+ "Commonly, hides the FIRST piece of text that is marked for
+cloze deletion. Uncommonly, hide one of the other pieces of text,
+chosen at random.
+
+The definitions of 'commonly' and 'uncommonly' are determined by
+the value of `org-drill-cloze-text-weight'."
;; The 'firstmore' and 'lastmore' functions used to randomly choose whether
;; to hide the 'favoured' piece of text. However even when the chance of
;; hiding it was set quite high (80%), the outcome was too unpredictable over
;; the small number of repetitions where most learning takes place for each
;; item. In other words, the actual frequency during the first 10 repetitions
;; was often very different from 80%. Hence we use modulo instead.
- (if (zerop (mod (1+ (org-drill-entry-total-repeats 0)) 4))
- ;; 25% of time, hide any item except the first
- (org-drill-present-multicloze-hide-n 1 t)
- ;; 75% of time, hide first item
- (org-drill-present-multicloze-hide-first)))
+ (cond
+ ((null org-drill-cloze-text-weight)
+ ;; Behave as hide1cloze
+ (org-drill-present-multicloze-hide1))
+ ((not (and (integerp org-drill-cloze-text-weight)
+ (plusp org-drill-cloze-text-weight)))
+ (error "Illegal value for org-drill-cloze-text-weight: %S"
+ org-drill-cloze-text-weight))
+ ((zerop (mod (1+ (org-drill-entry-total-repeats 0))
+ org-drill-cloze-text-weight))
+ ;; Uncommonly, hide any item except the first
+ (org-drill-present-multicloze-hide-n 1 t))
+ (t
+ ;; Commonly, hide first item
+ (org-drill-present-multicloze-hide-first))))
(defun org-drill-present-multicloze-show1-lastmore ()
- "Three out of every four repetitions, hides all pieces except
-the last. One out of every four repetitions, shows any random
-piece. The effect is similar to 'show1cloze' except that the last
-item is much less likely to be the item that is visible."
- (if (zerop (mod (1+ (org-drill-entry-total-repeats 0)) 4))
- ;; 25% of time, show any item except the last
- (org-drill-present-multicloze-hide-n -1 nil nil t)
- ;; 75% of time, show the LAST item
- (org-drill-present-multicloze-hide-n -1 nil t)))
+ "Commonly, hides all pieces except the last. Uncommonly, shows
+any random piece. The effect is similar to 'show1cloze' except
+that the last item is much less likely to be the item that is
+visible.
+
+The definitions of 'commonly' and 'uncommonly' are determined by
+the value of `org-drill-cloze-text-weight'."
+ (cond
+ ((null org-drill-cloze-text-weight)
+ ;; Behave as show1cloze
+ (org-drill-present-multicloze-show1))
+ ((not (and (integerp org-drill-cloze-text-weight)
+ (plusp org-drill-cloze-text-weight)))
+ (error "Illegal value for org-drill-cloze-text-weight: %S"
+ org-drill-cloze-text-weight))
+ ((zerop (mod (1+ (org-drill-entry-total-repeats 0))
+ org-drill-cloze-text-weight))
+ ;; Uncommonly, show any item except the last
+ (org-drill-present-multicloze-hide-n -1 nil nil t))
+ (t
+ ;; Commonly, show the LAST item
+ (org-drill-present-multicloze-hide-n -1 nil t))))
(defun org-drill-present-multicloze-show1-firstless ()
- "Three out of every four repetitions, hides all pieces except
-one, where the shown piece is guaranteed NOT to be the first
-piece. One out of every four repetitions, shows any random
-piece. The effect is similar to 'show1cloze' except that the
-first item is much less likely to be the item that is visible."
- (if (zerop (mod (1+ (org-drill-entry-total-repeats 0)) 4))
- ;; 25% of time, show the first item
- (org-drill-present-multicloze-hide-n -1 t)
- ;; 75% of time, show any item, except the first
- (org-drill-present-multicloze-hide-n -1 nil nil t)))
+ "Commonly, hides all pieces except one, where the shown piece
+is guaranteed NOT to be the first piece. Uncommonly, shows any
+random piece. The effect is similar to 'show1cloze' except that
+the first item is much less likely to be the item that is
+visible.
+
+The definitions of 'commonly' and 'uncommonly' are determined by
+the value of `org-drill-cloze-text-weight'."
+ (cond
+ ((null org-drill-cloze-text-weight)
+ ;; Behave as show1cloze
+ (org-drill-present-multicloze-show1))
+ ((not (and (integerp org-drill-cloze-text-weight)
+ (plusp org-drill-cloze-text-weight)))
+ (error "Illegal value for org-drill-cloze-text-weight: %S"
+ org-drill-cloze-text-weight))
+ ((zerop (mod (1+ (org-drill-entry-total-repeats 0))
+ org-drill-cloze-text-weight))
+ ;; Uncommonly, show the first item
+ (org-drill-present-multicloze-hide-n -1 t))
+ (t
+ ;; Commonly, show any item, except the first
+ (org-drill-present-multicloze-hide-n -1 nil nil t))))
(defun org-drill-present-multicloze-show1 ()
@@ -2361,6 +2450,7 @@ than starting a new one."
(org-drill-save-optimal-factor-matrix))
(if org-drill-save-buffers-after-drill-sessions-p
(save-some-buffers))
+ (message "Drill session finished!")
))))
- [nongnu] elpa/org-drill d987e8d734 081/251: Added tag 2.5.0 for changeset 9b098bf2648d, (continued)
- [nongnu] elpa/org-drill d987e8d734 081/251: Added tag 2.5.0 for changeset 9b098bf2648d, ELPA Syncer, 2022/01/17
- [nongnu] elpa/org-drill ec7b5a0cf0 048/251: Added tag 2.3.4 for changeset e472512f0be7, ELPA Syncer, 2022/01/17
- [nongnu] elpa/org-drill d5c55b69f4 061/251: Any LaTeX math fragments in an item will now be rendered inline (if possible), ELPA Syncer, 2022/01/17
- [nongnu] elpa/org-drill c71a218c68 074/251: Added tag 2.4.4 for changeset 0571437aa238, ELPA Syncer, 2022/01/17
- [nongnu] elpa/org-drill eb95d9415a 059/251: New global variable 'org-drill-match'. Now possible to specify a tags/property/, ELPA Syncer, 2022/01/17
- [nongnu] elpa/org-drill ce1a76c6c9 076/251: Added tag 2.4.5 for changeset 69dde321b38c, ELPA Syncer, 2022/01/17
- [nongnu] elpa/org-drill 45237da768 046/251: Added tag 2.3.3 for changeset 1b0cc92cbb6a, ELPA Syncer, 2022/01/17
- [nongnu] elpa/org-drill bd452b9fe1 054/251: The string which separates a hint from the rest of the contents of a cloze is, ELPA Syncer, 2022/01/17
- [nongnu] elpa/org-drill b2f4874178 051/251: - Fixes to try and force display of images during drill sessions., ELPA Syncer, 2022/01/17
- [nongnu] elpa/org-drill f9b4c257af 067/251: Check that org version is >= 7.9.3f (the 'org-schedule' function in older, ELPA Syncer, 2022/01/17
- [nongnu] elpa/org-drill e52080c97b 047/251: New option: org-drill-sm5-initial-interval. Allows users of SM5 algorithm to adjust the first,
ELPA Syncer <=
- [nongnu] elpa/org-drill 8618a532c7 049/251: - Improved progress bar while collecting due items. It is no longer able to overflow, ELPA Syncer, 2022/01/17
- [nongnu] elpa/org-drill 88de357a6c 084/251: Undo previous version change to 2.5.0. The current version is 2.4.7., ELPA Syncer, 2022/01/17
- [nongnu] elpa/org-drill 9ea35e11b6 006/251: Added implementation of SM2 algorithm., ELPA Syncer, 2022/01/17
- [nongnu] elpa/org-drill 1daa7d6de5 009/251: Separate counts of pending new, old, and failed items are displayed in custom colours, ELPA Syncer, 2022/01/17
- [nongnu] elpa/org-drill 2ba02542f8 015/251: Fixed bug causing items to sometimes appear multiple times during a single drill session., ELPA Syncer, 2022/01/17
- [nongnu] elpa/org-drill 2f92356145 016/251: Added tag 1.5 for changeset 42f3700bc748, ELPA Syncer, 2022/01/17
- [nongnu] elpa/org-drill 34f0c03f9a 005/251: Added tag 1.0 for changeset a3f5efca0221, ELPA Syncer, 2022/01/17
- [nongnu] elpa/org-drill 9ab44310d5 021/251: - New option: org-drill-hide-item-headings-p. If non-nil, item headings will be made, ELPA Syncer, 2022/01/17
- [nongnu] elpa/org-drill 17c34adec5 028/251: - At the end of a drill session, when re-presenting items that were failed, ELPA Syncer, 2022/01/17
- [nongnu] elpa/org-drill 2be993c6ce 037/251: Don't warn about a high percentage of failed items when the number of tested, ELPA Syncer, 2022/01/17