Merge branch 'master' of ssh://repo.or.cz/srv/git/Worg
[Worg.git] / org-contrib / org-drill.org
blob0651e5f2a33346b16e3effb4a1710f93b9c26783
1 # -*- mode: org; coding: utf-8-unix -*-
2 #+TITLE: org-drill.el -- flashcards and spaced repetition for org-mode
3 #+OPTIONS: num:nil ^:{} author:nil
4 #+STARTUP: showall
7 * General
10 Org-Drill is an extension for [[http://orgmode.org/][Org mode]]. Org-Drill uses a [[http://en.wikipedia.org/wiki/Spaced_repetition][spaced repetition]]
11 algorithm to conduct interactive "drill sessions", using org files as sources
12 of facts to be memorised. Each topic is treated as a "flash card". The material
13 to be remembered is presented to the student in random order. The student rates
14 his or her recall of each item, and this information is used to schedule the
15 item for later revision.
17 Each drill session can be restricted to topics in the current buffer
18 (default), one or several files, all agenda files, or a subtree. A single
19 topic can also be drilled.
21 Different "topic types" can be defined, which present their information to the
22 student in different ways.
24 For more on the spaced repetition algorithm, and examples of other programs
25 that use it, see:
26 - [[http://supermemo.com/index.htm][SuperMemo]] (see descriptions of the SM2, SM5 and SM8 algorithms)
27 - [[http://ichi2.net/anki/][Anki]]
28 - [[http://mnemosyne-proj.org/index.php][Mnemosyne]]
30 Org-Drill comes bundled with Org mode, in the "contrib" directory. Org-Drill
31 also has its own repository, which is updated more regularly than the bundled
32 version. The repository is at:
34 http://bitbucket.org/eeeickythump/org-drill
37 * Installation
40 The easiest way is to customise the variable 'org-modules' (=M-x
41 customize-variables RET org-modules=) and make sure 'drill' is
42 ticked. Org-drill will then be loaded when you restart Emacs or restart
43 Org-mode.
45 For manual installation, put the following in your =.emacs=. You will also need
46 to make sure that Org's "contrib/lisp" directory is in the emacs load-path.
48 #+BEGIN_EXAMPLE
49 (require 'org-drill)
50 #+END_EXAMPLE
53 * Demonstration
56 Load the file [[file:spanish.org][spanish.org]]. Press =M-x= and run the function =org-drill=. Follow
57 the prompts at the bottom of the screen.
59 When the drill finishes, you can look at =spanish.org= to get some idea of how
60 drill topics are written.
63 * Writing the questions
66 Org-Drill uses org mode topics as 'drill items'. To be used as a drill item,
67 the topic must have a tag that matches the value of
68 =org-drill-question-tag=. This is =:drill:= by default. Any other org topics
69 will be ignored.
71 Drill items can have other drill items as children. When a drill item is being
72 tested, the contents of any child drill items will be hidden.
74 You don't need to schedule the topics initially.  Unscheduled items are
75 considered to be 'new' and ready for memorisation.
77 How should 'drill topics' be structured? Any org topic is a legal drill topic
78 -- it will simply be shown with all subheadings collapsed, so that only the
79 material beneath the main item heading is visible. After pressing a key, any
80 hidden subheadings will be revealed, and you will be asked to rate your
81 "recall" of the item.
83 This will be adequate for some items, but usually you will want to write items
84 where you have more control over what information is hidden from the user for
85 recall purposes. For this reason, some other card types are defined, including:
86 - [[Two-sided cards]]
87 - [[Multi-sided cards]]
88 - [[Multi-cloze cards]]
89 - [[User-defined card types]]
91 *A note about comments:* In org mode, comment lines start with '#'. The rest of
92 the line is ignored by Org (apart from some special cases). You may sometimes
93 want to put material in comments which you do not want to see when you are
94 being tested on the item. For this reason, comments are always rendered
95 invisible while items are being tested.
98 ** Simple topics
101 The simplest drill topic has no special structure. When such a topic is
102 presented during a drill session, any subheadings are "collapsed" with their
103 contents hidden. So, you could include the question as text beneath the main
104 heading, and the answer within a subheading. For example:
106 #+BEGIN_EXAMPLE
107 * Item                                   :drill:
108 What is the capital city of Estonia?
110 ** The Answer
111 Tallinn.
112 #+END_EXAMPLE
114 When this item is presented for review, the text beneath the main heading will
115 be visible, but the contents of the subheading ("The Answer") will be hidden.
118 ** Cloze deletion
121 Cloze deletion can be used in any drill topic regardless of whether it is
122 otherwise 'simple', or is one of the specialised topic types discussed
123 below. To use cloze deletion, one or more parts of the body of the topic is
124 marked as /cloze text/ by surrounding it with single square brackets, [like
125 so]. When the topic is presented for review, the text within square brackets
126 will be obscured. The text is then revealed after the user presses a key. For
127 example:
130 #+BEGIN_EXAMPLE
131 * Item                                   :drill:
132 The capital city of Estonia is [Tallinn].
133 #+END_EXAMPLE
135 During review, the user will see:
137 #+BEGIN_QUOTE
138 The capital city of Estonia is @<font style="background-color: blue;" color="cyan">
139 @<tt>[...]@</tt>@</font>.
140 #+END_QUOTE
142 When the user presses a key, the text "Tallinn" will become visible.
145 ** Clozed text hints
148 Clozed text can contain a "hint" about the answer. If the text surrounded
149 by single square brackets contains a `|' character (vertical bar), all text
150 after that character is treated as a hint. During testing, the hint text will
151 be visible when the rest of the text is hidden, and invisible when the rest of
152 the text is visible.
154 Example:
156 #+BEGIN_EXAMPLE
157 Type 1 hypersensitivity reactions are mediated by [immunoglobulin E|molecule]
158 and [mast cells|cell type].
159 #+END_EXAMPLE
161 #+BEGIN_QUOTE
162 Type 1 hypersensitivity reactions are mediated by
163 @<font style="background-color: blue;" color="cyan">
164 @<tt>[molecule...]@</tt>@</font>
165 and @<font style="background-color: blue;" color="cyan">
166 @<tt>[cell type...]@</tt>@</font>.
167 #+END_QUOTE
170 ** Two-sided cards
171 # <<Two-sided cards>>
173 The remaining topic types all use the topic property, =DRILL_CARD_TYPE=. This
174 property tells =org-drill= which function to use to present the topic during
175 review. If this property has the value =twosided= then the topic is treated as
176 a "two sided card". When a two sided card is reviewed, /one of the first two/
177 subheadings within the topic will be visible -- all other
178 subheadings will be hidden.
180 Two-sided cards are meant to emulate the type of flipcard where either side is
181 useful as test material (for example, a card with a word in a foreign language
182 on one side, and its translation on the other).
184 A two sided card can have more than 2 subheadings, but all subheadings after
185 the first two are considered as "notes" and will always be hidden during topic
186 review.
188 #+BEGIN_EXAMPLE
189 * Noun                                               :drill:
190     :PROPERTIES:
191     :DRILL_CARD_TYPE: twosided
192     :END:
194 Translate this word.
196 ** Spanish
197 la mujer
199 ** English
200 the woman
202 ** Example sentence
203 ¿Quién fue esa mujer?
204 Who was that woman?
205 #+END_EXAMPLE
207 In this example, the user will be shown the main text -- "Translate this word"
208 -- and either 'la mujer', /or/ 'the woman', at random. The section 'Example
209 sentence' will never be shown until after the user presses a key, because it is
210 not one of the first two 'sides' of the topic.
213 ** Multi-sided cards
214 # <<Multi-sided cards>>
217 The =multisided= card type is similar to =twosided=, except that any
218 subheading has a chance of being presented during the topic review. One
219 subheading is always shown and all others are always hidden.
221 #+BEGIN_EXAMPLE
222 * Noun                                               :drill:
223     :PROPERTIES:
224     :DRILL_CARD_TYPE: multisided
225     :END:
227 Translate.
229 ** Spanish
230 la mesa
232 ** English
233 the table
235 ** Picture
236 [[file:table.jpg][PICTURE]]
237 #+END_EXAMPLE
239 The user will be shown the main text and either 'la mesa', /or/ 'the table',
240 /or/ a picture of a table.
243 ** Multi-cloze cards
244 # <<Multi-cloze cards>>
247 Often, you will wish to create cards out of sentences that express several
248 facts, such as the following:
250 #+BEGIN_EXAMPLE
251 The capital city of New Zealand is Wellington, which is located in the
252 North Island and has a population of about 400,000.
253 #+END_EXAMPLE
255 There is more than one fact in this statement -- you could create a single
256 'simple' card with all the facts marked as cloze text, like so:
258 #+BEGIN_EXAMPLE
259 The capital city of [New Zealand] is [Wellington], which is located in
260 the [North|North/South] Island and has a population of about [400,000].
261 #+END_EXAMPLE
263 But this card will be difficult to remember. If you get just one of the 4
264 hidden facts wrong, you will fail the card. A card like this is likely to
265 become a [[leeches][leech]].
267 A better way to express all these facts using 'simple' cards is to create
268 several cards, with one fact per card. You might end up with something
269 like this:
271 #+BEGIN_EXAMPLE
272 * Fact
273 The capital city of [New Zealand] is Wellington, which has a population of
274 about 400,000.
276 * Fact
277 The capital city of New Zealand is [Wellington], which has a population of
278 about 400,000.
280 * Fact
281 The capital city of New Zealand is Wellington, which has a population of
282 about [400,000].
284 * Fact
285 The capital city of [New Zealand] is Wellington, which is located in the
286 the North Island.
288 * Fact
289 The capital city of New Zealand is [Wellington], which is located in
290 the North Island.
292 * Fact
293 The capital city of New Zealand is Wellington, which is located in
294 the [North|North/South] Island.
295 #+END_EXAMPLE
297 However, this is really cumbersome. Multicloze card types exist for this
298 situation. Multicloze cards behave like 'simple' cards, except that when there
299 is more than one area marked as cloze text, some but not all of the areas
300 can be hidden. There are several types of predefined multicloze card:
302 1. =hide1cloze= -- one of the marked areas is hidden during review; the others
303    all remain visible. The hidden text area is chosen randomly at each review.
304    (Note: this type used to be called 'multicloze', and that card type is
305    retained as a synonym for 'hide1cloze'.)
306 2. =show1cloze= -- only one of the marked areas is visible during review; all
307    the others are hidden. The hidden text area is chosen randomly at each
308    review.
309 3. =hide2cloze= -- like hide1cloze, but 2 marked pieces of text will be hidden,
310    and the rest will be visible.
311 4. =show2cloze= -- like show1cloze, but 2 marked pieces of text will be visible,
312    the rest are hidden.
314 There are also some types of multicloze card where some pieces have an
315 increased or decreased chance of being hidden. These are intended for use when
316 studying languages: generally it is easy to translate a foreign-language
317 sentence into your own language if you have met it before, but it is much
318 harder to translate in the other direction. Therefore, you will want to test
319 the harder direction more often.
320 5. =hide1_firstmore= -- only one of the marked pieces of text will be
321    hidden. 75% of the time (guaranteed), the /first/ piece is hidden; the rest
322    of the time, one of the other pieces is randomly hidden.
323 6. =show1_firstless= -- only one of the marked pieces of text will be
324    visible. Only 25% of the time (guaranteed) will the /first/ piece will be
325    visible; the rest of the time, one of the other pieces is randomly visible.
326 7. =show1_lastmore= -- only one of the marked pieces of text will be
327    visible. 75% of the time (guaranteed), the /last/ piece will be visible;
328    the rest of the time, one of the other pieces is randomly visible.
330 So, for the above example, we can actually use the original 'bad' simple card,
331 but change its card type to 'hide1cloze'. Each time the card is presented for
332 review, one of 'New Zealand', 'Wellington', 'the South Island' or '400,000'
333 will be hidden.
335 #+BEGIN_EXAMPLE
336 * Fact
337   :PROPERTIES:
338   :DRILL_CARD_TYPE: hide1cloze
339   :END:
341 The capital city of [New Zealand] is [Wellington], which is located in
342 the [North|North/South] Island and has a population of about [400,000].
343 #+END_EXAMPLE
346 ** User-defined card types
347 # <<User-defined card types>>
350 Finally, you can write your own emacs lisp functions to define new kinds of
351 topics. Any new topic type will need to be added to
352 =org-drill-card-type-alist=, and cards using that topic type will need to have
353 it as the value of their =DRILL_CARD_TYPE= property. For examples, see the
354 functions at the end of org-drill.el -- these include:
355 - =org-drill-present-verb-conjugation=, which implements the 'conjugate'
356   card type. This asks the user to conjugate a verb in a particular tense. It
357   demonstrates how the appearance of an entry can be completely altered during
358   a drill session, both during testing and during the display of the answer.
359 - =org-drill-present-translate-number=, which uses a third-party emacs lisp
360   library ([[http://www.emacswiki.org/emacs/spell-number.el][spell-number.el]]) to prompt the user to translate random numbers
361   to and from any language recognised by that library.
362 - =org-drill-present-spanish-verb=, which defines the new topic type
363   =spanish_verb=. This illustrates how a function can control which of an
364   item's subheadings are visible during the drill session.
366 See the file [[file:spanish.org][spanish.org]] for a full set of example material, including examples
367 of all the card types discussed above.
370 ** Empty cards
373 If the body of a drill item is completely empty (ignoring properties and child
374 items), then the item will be skipped during drill sessions. The purpose of
375 this behaviour is to allow you to paste in 'skeletons' of complex items, then
376 fill in missing information later. For example, you may wish to include an
377 empty drill item for each tense of a newly learned verb, then paste in the
378 actual conjugation later as you learn each tense.
380 Note that if an item is empty, any child drill items will *not* be ignored,
381 unless they are empty as well.
383 If you have an item with an empty body, but still want it to be included in a
384 drill session, put a brief comment ('# ...')  in the item body.
387 * Running the drill session
390 Start a drill session with =M-x org-drill=. By default, this includes all
391 non-hidden topics in the current buffer. =org-drill= takes an optional
392 argument, SCOPE, which allows it to take drill items from other
393 sources. See [[scope][below]] for details.
395 During a drill session, you will be presented with each item, then asked to
396 rate your recall of it by pressing a key between 0 and 5. The meaning of these
397 numbers is (taken from =org-learn=):
399 | Quality | SuperMemo label | Fail? | Meaning                                              |
400 |---------+-----------------+-------+------------------------------------------------------|
401 |       0 | NULL            | Yes   | Wrong, and the answer is unfamiliar when you see it. |
402 |       1 | BAD             | Yes   | Wrong answer.                                        |
403 |       2 | FAIL            | Yes   | Almost, but not quite correct.                       |
404 |       3 | PASS            | No    | Correct answer, but with much effort.                |
405 |       4 | GOOD            | No    | Correct answer, with a little thought.               |
406 |       5 | BRIGHT          | No    | Correct answer, effortless.                          |
408 You can press '?'  at the prompt if you have trouble remembering what the
409 numbers 0--5 signify.
411 At any time you can press 'q' to finish the drill early (your progress up to
412 that point will be saved), 's' to skip the current item without viewing the
413 answer, or 'e' to escape from the drill and jump to the current topic for
414 editing (again, your progress up to that point will be saved).
416 After exiting the drill session with 'e' or 'q', you can resume where you left
417 off, using the command =org-drill-resume=. This will return you to the item
418 that you were viewing when you left the session. For example, if you are shown
419 an item and realise that it is poorly formulated, or contains an error, you can
420 press 'e' to leave the drill, then correct the item, then press
421 =M-x org-drill-resume= and continue where you left off.
423 Note that 'drastic' edits, such as deleting or moving items, can sometimes
424 cause Org-Drill to "lose its place" in the file, preventing it from
425 successfully resuming the session. In that case you will need to start a new
426 session.
429 * Multiple sequential drill sessions
432 Org-Drill has to scan your entire item database each time you start a new drill
433 session. This can be slow if you have a large item collection. If you have a
434 large number of 'due' items and want to run a second drill session after
435 finishing one session, you can use the command =org-drill-again= to run a new
436 drill session that draws from the pool of remaining due items that were not
437 tested during the previous session, without re-scanning the item collection.
439 Also note that if you run =org-drill-resume= and you have actually finished the
440 drill session, you will be asked whether you want to start another drill
441 session without re-scanning (as if you had run =org-drill-again=).
444 * Cram mode
447 There are some situations, such as before an exam, where you will want to
448 revise all of your cards regardless of when they are next due for review.
450 To do this, run a /cram session/ with the =org-drill-cram= command (=M-x
451 org-drill-cram RET=). This works the same as a normal drill session, except
452 that all items are considered due for review unless you reviewed them within
453 the last 12 hours (you can change the number of hours by customising the
454 variable =org-drill-cram-hours=).
457 * Leeches
458 # <<leeches>>
460 From the Anki website, http://ichi2.net/anki/wiki/Leeches:
462 #+BEGIN_QUOTE
463 Leeches are cards that you keep on forgetting. Because they require so many
464 reviews, they take up a lot more of your time than other cards.
465 #+END_QUOTE
467 Like Anki, Org-Drill defines leeches as cards that you have "failed" many
468 times. The number of times an item must be failed before it is considered a
469 leech is set by the variable =org-drill-leech-failure-threshold= (15 by
470 default). When you fail to remember an item more than this many times, the item
471 will be given the =:leech:= tag.
473 Leech items can be handled in one of three ways. You can choose how Org-Drill
474 handles leeches by setting the variable =org-drill-leech-method= to one of the
475 following values:
476 - nil :: Leech items are tagged with the =leech= tag, but otherwise treated the
477          same as normal items.
478 - skip :: Leech items are not included in drill sessions.
479 - warn :: Leech items are still included in drill sessions, but a warning
480   message is printed when each leech item is presented.
482 The best way to deal with a leech is either to delete it, or reformulate it so
483 that it is easier to remember, for example by splitting it into more than one
484 card.
486 See [[http://www.supermemo.com/help/leech.htm][the SuperMemo website]] for more on leeches.
489 * Customisation
492 Org-Drill has several settings which you change using
493 =M-x customize-group org-drill <RET>=. Alternatively you can change these
494 settings by adding elisp code to your configuration file (=.emacs=).
497 ** Visual appearance of items during drill sessions
500 If you want cloze-deleted text to show up in a special font within Org mode
501 buffers, add this to your .emacs:
503 #+BEGIN_EXAMPLE
504 (setq org-drill-use-visible-cloze-face-p t)
505 #+END_EXAMPLE
507 Item headings may contain information that "gives away" the answer to the item,
508 either in the heading text or in tags. If you want item headings to be made
509 invisible while each item is being tested, add:
511 #+BEGIN_EXAMPLE
512 (setq org-drill-hide-item-headings-p t)
513 #+END_EXAMPLE
516 ** Duration of drill sessions
519 By default, a drill session will end when either 30 items have been
520 successfully reviewed, or 20 minutes have passed. To change this behaviour, use
521 the following settings.
523 #+BEGIN_EXAMPLE
524 (setq org-drill-maximum-items-per-session 40)
525 (setq org-drill-maximum-duration 30)   ; 30 minutes
526 #+END_EXAMPLE
528 If either of these variables is set to nil, then item count or elapsed time
529 will not count as reasons to end the session. If both variables are nil, the
530 session will not end until /all/ outstanding items have been reviewed.
533 ** Saving buffers after drill sessions
536 By default, you will be prompted to save all unsaved buffers at the end of a
537 drill session. If you don't like this behaviour, use the following setting:
539 #+BEGIN_EXAMPLE
540 (setq org-drill-save-buffers-after-drill-sessions-p nil)
541 #+END_EXAMPLE
544 ** Sources of items for drill sessions (scope)
545 # <<scope>>
547 By default, Org-Drill gathers drill items from the current buffer only,
548 ignoring any non-visible items. There may be times when you want Org-Drill to
549 gather drill items from other sources. You can do this by changing the value of
550 the variable =org-drill-scope=. Possible values are:
552 - file :: The current buffer, ignoring hidden items. This is the default.
553 - tree :: The subtree starting with the entry at the cursor. (Alternatively you
554           can use =M-x org=drill-tree= to run the drill session -- this will
555           behave the same as =org-drill= if 'tree' was used as the value of
556           SCOPE.)
557 - file-no-restriction :: The current buffer, including both hidden and
558      non-hidden items.
559 - file-with-archives :: The current buffer, and any archives associated with it.
560 - agenda :: All agenda files.
561 - agenda-with-archives :: All agenda files with any archive files associated
562      with them.
563 - directory :: All files with the extension '.org' in the same directory as the
564                current file. (The current file will also be included if its
565                extension is .org)
566 - (file1 file2 ...) :: A list of filenames. All files in the list will be
567      scanned.
571 ** Definition of old and overdue items
574 Org-Drill prioritises /overdue/ items in each drill session, presenting them
575 before other items are seen. Overdue items are defined in terms of how far in
576 the past the item is scheduled for review. The threshold is defined in terms
577 of a proportion rather than an absolute number of days. If days overdue is
578 greater than
580 : last-interval * (factor - 1)
582 and is at least one day overdue, then the item is considered 'overdue'. The
583 default factor is 1.2, meaning that the due date can overrun by 20% before the
584 item is considered overdue.
586 To change the factor that determines when items become overdue, use something
587 like the following in your .emacs. Note that the value should never be less
588 than 1.0.
590 #+BEGIN_EXAMPLE
591 (setq org-drill-overdue-interval-factor 1.1)
592 #+END_EXAMPLE
594 After prioritising overdue items, Org-Drill next prioritises /young/
595 items. These are items which were recently learned (or relearned in the case of
596 a failure), and which therefore have short inter-repetition intervals.
597 "Recent" is defined as an inter-repetition interval less than a fixed number of
598 days, rather than a number of repetitions. This ensures that more difficult
599 items are reviewed more often than easier items before they stop being 'young'.
601 The default definition of a young item is one with an inter-repetition interval
602 of 10 days or less. To change this, use the following:
604 #+BEGIN_EXAMPLE
605 (setq org-drill-days-before-old 7)
606 #+END_EXAMPLE
609 ** Spaced repetition algorithm
612 *** Choice of algorithm
615 Org-Drill supports three different spaced repetition algorithms, all based on
616 SuperMemo algorithms. These are:
617 - [[http://www.supermemo.com/english/ol/sm2.htm][SM2]] :: an early algorithm, used in SuperMemo 2.0 (1988), which remains very
618   popular -- Anki and Mnemosyne, two of the most popular spaced repetition
619   programs, use SM2. This algorithm stores an 'ease factor' for each item,
620   which is modified each time you rate your recall of the item.
621 - [[http://www.supermemo.com/english/ol/sm5.htm][SM5]] (default) :: used in SuperMemo 5.0 (1989). This algorithm uses 'ease
622      factors' but also uses a persistent, per-user 'matrix of optimal factors'
623      which is also modified after each item repetition.
624 - Simple8 :: an experimental algorithm based on the [[http://www.supermemo.com/english/algsm8.htm][SM8]] algorithm. SM8 is used
625              in SuperMemo 8.0 (1998) and is almost identical to SM11 which is
626              used in SuperMemo 2002. Like SM5, it uses a matrix of optimal
627              factors. Simple8 differs from SM8 in that it does not adapt the
628              matrix to the individual user, though it does adapt each item's
629              'ease factor'.
632 If you want Org-Drill to use the =SM2= algorithm, put the following in your
633 =.emacs=:
635 #+BEGIN_EXAMPLE
636 (setq org-drill-spaced-repetition-algorithm 'sm2)
637 #+END_EXAMPLE
640 *** Random variation of repetition intervals
643 The intervals generated by the SM2 and SM5 algorithms are pretty
644 deterministic. If you tend to add items in large, infrequent batches, the lack
645 of variation in interval scheduling can lead to the problem of "lumpiness" --
646 one day a large batch of items are due for review, the next there is almost
647 nothing, a few days later another big pile of items is due.
649 This problem can be ameliorated by adding some random "noise" to the interval
650 scheduling algorithm. The author of SuperMemo actually recommends this approach
651 for the SM5 algorithm, and Org-Drill's implementation uses [[http://www.supermemo.com/english/ol/sm5.htm][his code]].
653 To enable random "noise" for item intervals, set the variable
654 =org-drill-add-random-noise-to-intervals-p= to true by putting the following in
655 your =.emacs=:
657 #+BEGIN_EXAMPLE
658 (setq org-drill-add-random-noise-to-intervals-p t)
659 #+END_EXAMPLE
662 *** Adjustment for early or late review of items
665 Reviewing items earlier or later than their scheduled review date may affect
666 how soon the next review date should be scheduled. Code to make this adjustment
667 is also presented on the SuperMemo website. It can be enabled with:
669 #+BEGIN_EXAMPLE
670 (setq org-drill-adjust-intervals-for-early-and-late-repetitions-p t)
671 #+END_EXAMPLE
673 This will affect both early and late repetitions if the Simple8 algorithm is
674 used. For the SM5 algorithm it will affect early repetitions only. It has no
675 effect on the SM2 algorithm.
678 *** Adjusting item difficulty globally
681 The =learn fraction= is a global value which affects how quickly the intervals
682 (times between each retest of an item) increase with successive repetitions,
683 for /all/ items. The default value is 0.5, and this is the value used in
684 SuperMemo. For some collections of information, you may find that you are
685 reviewing items too often (they are too easy and the workload is too high), or
686 too seldom (you are failing them too often). In these situations, it is
687 possible to alter the learn fraction from its default in order to increase or
688 decrease the frequency of repetition of items over time. Increasing the value
689 will make the time intervals grow faster, and lowering it will make them grow
690 more slowly. The table below shows the growth in intervals (in days) with some
691 different values of the learn fraction (F). The table assumes that the item is
692 successfully recalled each time, with an average quality of just under 4.
695 | Repetition | F=0.3 | F=0.4 | *F=0.5* | F=0.6 | F=0.7 |
696 |------------+-------+-------+---------+-------+-------|
697 | 1st        |     2 |     2 |       2 |     2 |     2 |
698 | 2nd        |     7 |     7 |       7 |     7 |     7 |
699 | 5th        |    26 |    34 |      46 |    63 |    85 |
700 | 10th       |    85 |   152 |     316 |   743 |  1942 |
701 | 15th       |   233 |   501 |    1426 |  5471 | 27868 |
703 To alter the learn fraction, put the following in your .emacs:
705 #+BEGIN_EXAMPLE
706 (setq org-drill-learn-fraction 0.45)   ; change the value as desired
707 #+END_EXAMPLE
710 ** Per-file customisation settings
711 # <<per-file settings>>
713 Most of Org-Drill's customisation settings are safe as file-local
714 variables. This means you can include a commented section like this at the end
715 of your .org file to apply special settings when running a Drill session using
716 that file:
718 #+BEGIN_EXAMPLE
719 # Local Variables:
720 # org-drill-maximum-items-per-session:    50
721 # org-drill-spaced-repetition-algorithm:  simple8
722 # End:
723 #+END_EXAMPLE
725 You can achieve the same effect by including the settings in the 'mode line'
726 (this must be the *first line* in the file), like so:
728 #+BEGIN_EXAMPLE
729 # -*- org-drill-maximum-items-per-session: 50; org-drill-spaced-repetition-algorithm: simple8 -*-
730 #+END_EXAMPLE
732 In either case you will need to save, close and re-open the file for the
733 changes to take effect.
736 * Coping with large collections
739 If you keep all your items in a single file, it may eventually get very
740 large. The file will be slow to load, and Emacs may have trouble
741 syntax-highlighting the file contents correctly.
743 The easiest steps to solve this problem are:
744 1. Move your file into its own dedicated directory.
745 2. Divide the file into two or more smaller files.
746 3. Within each file, set =org-drill-scope= to 'directory'. See
747    [[per-file settings]] above for instructions about how to do this.
750 * Sharing, merging and synchronising item collections
753 Every drill item is automatically given a persistent unique "ID" the first time
754 it is seen by Org-Drill. This means that if two different people subsequently
755 edit or reschedule that item, Org-Drill can still tell that it is the same
756 item. This in turn means that collections of items can be shared and edited in
757 a collaborative manner.
759 There are two commands that are useful in this regard:
760 1. =org-drill-strip-all-data= - this command deletes all user-specific
761    scheduling data from every item in the current collection. (It takes the
762    same optional 'scope' argument as =org-drill= to define which items will
763    be processed by the command). User-specific data includes scheduling dates,
764    ease factors, number of failures and repetitions, and so on. All items are
765    reset to 'new' status. This command is useful if you want to share your
766    item collection with someone else.
767 2. =org-drill-merge-buffers= - When called from buffer A, it prompts you for
768    another buffer (B), which must also be loaded into Emacs. This command
769    imports all the user-specific scheduling data from buffer B into buffer A,
770    and deletes any such information in A. Matching items are identified by
771    their ID. Any items in B that do not exist in A are copied to A, in
772    the same hierarchical location if all the parent headings exist, otherwise
773    at the end of the buffer.
775 An example scenario:
777 Tim decides to learn Swedish using an item collection (=.org= file) made
778 publically available by Jane.  (Before publishing it Jane used
779 'org-drill-strip-all-data' to remove her personal scheduling data from the
780 collection.)  A few weeks later, Jane updates her collection, adding new items
781 and revising some old ones. Tim downloads the new collection and imports his
782 progress from his copy of the old collection, using 'org-drill-merge-buffers',
783 using the new collection as buffer A and the old one as buffer B. He can then
784 discard the old copy. Any items HE added to HIS copy of the old collection
785 (buffer B) will not be lost -- they will be appended to his copy of the new
786 collection.
788 Of course the sharing does not need to be 'public'. You and a friend might be
789 learning a language or some other topic together. You each maintain a card
790 collection. Periodically your friend sends you a copy of their collection --
791 you run =org-drill-merge-buffers= on it, always using your own collection as
792 buffer B so that your own scheduling progress is carried over. Other times you
793 send your friend a copy of your collection, and he or she follows the same
794 procedure.
797 * Incremental reading
800 An innovative feature of the program SuperMemo is so-called "incremental
801 reading". This refers to the ability to quickly and easily make drill items
802 from selected portions of text as you read an article (a web page for
803 example). See [[http://www.supermemo.com/help/read.htm][the SuperMemo website]] for more on incremental reading.
805 Much of the infrastructure for incremental reading is already provided by Org
806 Mode, with the help of some other emacs packages. You can provide yourself with
807 an incremental reading facility by using 'org-capture' alongside a package that
808 allows you to browse web pages either in emacs (w3 or [[http://www.emacswiki.org/emacs/emacs-w3m][emacs-w3m]]) or in the
809 external browser of your choice ([[http://orgmode.org/worg/org-contrib/org-protocol.php][org-protocol]]).
811 Another important component of incremental reading is the ability to save your
812 exact place in a document, so you can read it /incrementally/ rather than all
813 at once. There is a large variety of bookmarking packages for emacs which
814 provide advanced bookmarking functionality: see the [[http://www.emacswiki.org/emacs/BookMarks][Emacs Wiki]] for details.
815 Bookmarking exact webpage locations in an external browser seems to be a bit
816 more difficult. For Firefox, the [[http://www.wired-marker.org/][Wired Marker]] addon works well.
818 An example of using Org-Drill for incremental reading is given below. First,
819 and most importantly, we need to define a couple of =org-capture= templates for
820 captured facts.
822 #+BEGIN_EXAMPLE
823 (setq org-capture-templates
824        `(("u"
825          "Task: Read this URL"
826          entry
827          (file+headline "tasks.org" "Articles To Read")
828          ,(concat "* TODO Read article: '%:description'\nURL: %c\n\n")
829          :empty-lines 1
830          :immediate-finish t)
832         ("w"
833          "Capture web snippet"
834          entry
835          (file+headline "my-facts.org" "Inbox")
836          ,(concat "* Fact: '%:description'        :"
837                   (format "%s" org-drill-question-tag)
838                   ":\n:PROPERTIES:\n:DATE_ADDED: %u\n:SOURCE_URL: %c\n:END:\n\n%i\n%?\n")
839          :empty-lines 1
840          :immediate-finish t)
841         ;; ...other capture templates...
842     ))
843 #+END_EXAMPLE
845 Using these templates and =org-protocol=, you can set up buttons in your web
846 browser to:
847 - Create a task telling you to read the URL of the currently viewed webpage
848 - Turn a region of selected text on a webpage, into a new fact which is saved
849   to whichever file and heading you nominate in the template. The fact will
850   contain a timestamp, and a hyperlink back to the webpage where you created
851   it.
853 For example, suppose you are reading the Wikipedia entry on tuberculosis [[http://en.wikipedia.org/wiki/Tuberculosis][here]].
855 You read the following:
857 #+BEGIN_QUOTE
858 The classic symptoms of tuberculosis are a chronic cough with blood-tinged
859 sputum, fever, night sweats, and weight loss. Infection of other organs causes
860 a wide range of symptoms. Treatment is difficult and requires long courses of
861 multiple antibiotics. Antibiotic resistance is a growing problem in
862 (extensively) multi-drug-resistant tuberculosis. Prevention relies on screening
863 programs and vaccination, usually with Bacillus Calmette-Guérin vaccine.
864 #+END_QUOTE
866 You decide you want to remember that "Bacillus Calmette-Guérin vaccine" is the
867 name of the vaccine against tuberculosis. First, you select the `interesting'
868 portion of the text with the mouse:
870 #+BEGIN_QUOTE
871 The classic symptoms of tuberculosis are a chronic cough with blood-tinged
872 sputum, fever, night sweats, and weight loss. Infection of other organs causes
873 a wide range of symptoms. Treatment is difficult and requires long courses of
874 multiple antibiotics. Antibiotic resistance is a growing problem in
875 (extensively) multi-drug-resistant tuberculosis.
876 @<font style="background-color: yellow;">Prevention relies
877 on screening programs and vaccination, usually with Bacillus Calmette-Guérin
878 vaccine.@</font>
879 #+END_QUOTE
881 Then you press the button you created when setting up =org-protocol=, which is
882 configured to activate the capture template "w: Capture web snippet". The
883 selected text will be sent to Emacs, turned into a new fact using the template,
884 and filed away for your later attention.
886 (Note that it might be more efficient to turn the entire paragraph into a drill
887 item -- since it contains several important facts -- then split it up into
888 multiple items when you edit it later in Emacs.)
890 Once you have had enough of reading the article, save your place, then go to
891 your "fact" file in Emacs. You should see that each piece of text you selected
892 has been turned into a drill item. Continuing the above example, you would see
893 something like:
895 #+BEGIN_EXAMPLE
896 ** Fact: 'Tuberculosis - Wikipedia, the Free Encyclopedia'        :drill:
898 Prevention relies on screening programs and vaccination, usually with Bacillus
899 Calmette-Guérin vaccine.
900 #+END_EXAMPLE
902 You need to edit this fact so it makes sense independent of its context, as
903 that is how it will be presented to you in future. The easiest way to turn the
904 text into a 'question' is by cloze deletion. All you need to do is surround the
905 'hidden' parts of the text with square brackets.
907 : Prevention of tuberculosis relies on screening programs and vaccination,
908 : usually with [Bacillus Calmette-Guérin vaccine].
911 You can of course define browser buttons that use several different "fact"
912 templates, each of which might send its fact to a different file or subheading,
913 or give it different tags or properties, for example.
916 * Author
918 Org-Drill is written by Paul Sexton.