Anki/anki
Damien Elmes ed75e4bee2 refactor cloze deletions and text:field, add forecast
Previously cloze deletions were handled by copying the contents of one field
into another and applying transforms to it. This had a number of problems:
- after you add a card, you can't undo the cloze deletion
- if you spot a mistake, you have to edit it twice (or more if you have more
  than one cloze for a sentence)
- making multiple clozes requires copying & pasting the sentence multiple
  times
- this also lead to much bigger decks if the sentences being cloze-deleted are
  large
- related clozes can't be spaced apart as siblings

To address these issues, we introduce the idea of cloze tags in the card
template and fields. If the template has the text:

{{cloze:1:field}}

And a field has the following contents:

{{c1::hello}}

Then the template will automatically replace that part of the text with either
occluded text, or a highlighted answer. All other clozes in the field are
displayed normally.

At the same time, we add support for text: into the template library, instead
of manually creating text: fields in the dict for every field.

Finally, add a forecast routine to get the due counts for the next week, which
is used in the GUI.
2011-04-28 09:23:56 +09:00
..
importing remove progress handling code; we'll do it in the GUI or provide cb 2011-04-28 09:23:55 +09:00
template refactor cloze deletions and text:field, add forecast 2011-04-28 09:23:56 +09:00
__init__.py minor tweaks to doc 2011-04-28 09:23:55 +09:00
cards.py move time taken maximum into group conf 2011-04-28 09:23:56 +09:00
consts.py implement sort fields; make sure they're updated on upgrade 2011-04-28 09:23:54 +09:00
cram.py save creation time in deck flush, update cutoff on reset not deck load 2011-04-28 09:23:56 +09:00
db.py speed up the revlog migration, tweak db handling 2011-04-28 09:23:55 +09:00
deck.py refactor cloze deletions and text:field, add forecast 2011-04-28 09:23:56 +09:00
errors.py drop sqlalchemy; massive refactor 2011-04-28 09:23:53 +09:00
exporting.py remove utcOffset; make it a property of crt instead 2011-04-28 09:23:56 +09:00
facts.py implement new review code, add unit tests 2011-04-28 09:23:56 +09:00
find.py set the new types on upgrade 2011-04-28 09:23:56 +09:00
graphs.py drop sqlalchemy; massive refactor 2011-04-28 09:23:53 +09:00
groups.py move time taken maximum into group conf 2011-04-28 09:23:56 +09:00
hooks.py minor tweaks to doc 2011-04-28 09:23:55 +09:00
lang.py remove self explanatory module docstrings; strip trailing whitespace 2011-04-28 09:21:07 +09:00
latex.py update latex support 2011-04-28 09:23:56 +09:00
media.py update latex support 2011-04-28 09:23:56 +09:00
models.py parse tags when creating fact, add selective study, fix emptyAns default 2011-04-28 09:23:55 +09:00
sched.py refactor cloze deletions and text:field, add forecast 2011-04-28 09:23:56 +09:00
sound.py remove some unused hooks 2011-04-28 09:23:55 +09:00
stats.py update finished msg 2011-04-28 09:23:56 +09:00
stdmodels.py refactor cloze deletions and text:field, add forecast 2011-04-28 09:23:56 +09:00
storage.py refactor cloze deletions and text:field, add forecast 2011-04-28 09:23:56 +09:00
sync.py remove q/a cache, tags in fields, rewrite remaining ids, more 2011-04-28 09:23:53 +09:00
utils.py update latex support 2011-04-28 09:23:56 +09:00