Commit graph

43 commits

Author SHA1 Message Date
Damien Elmes
2613143fe9 improve dynamic indices, implement new queue 2011-04-28 09:23:28 +09:00
Damien Elmes
4e7e8b03bc moving scheduling code into separate file, some preliminary refactoring 2011-04-28 09:23:28 +09:00
Damien Elmes
9aa2f8dc40 refactor cards
Cards had developed quite a lot of cruft from incremental changes, and a
number of important attributes were stored in names that had no bearing to
their actual use.

Added:

- position, which new cards will be sorted on in the future
- flags, which is reserved for future use

Renamed:

- type to queue
- relativeDelay to type
- noCount to lapses

Removed:

- all new/young/matureEase counts; the information is in the revlog
- firstAnswered, lastDue, lastFactor, averageTime and totalTime for the same
  reason
- isDue, spaceUntil and combinedDue, because they are no longer used. Spaced
  cards will be implemented differently in a coming commit.
- priority
- yesCount, because it can be inferred from reps & lapses
- tags; they've been stored in facts for a long time now

Also compatibility with deck versions less than 65 has been dropped, so decks
will need to be upgraded to 1.2 before they can be upgraded by the dev code.
All shared decks are on 1.2, so this should hopefully not be a problem.
2011-04-28 09:23:27 +09:00
Damien Elmes
f828393de3 rename deck.s to a more understable deck.db; keep s for compat 2011-04-28 09:21:07 +09:00
Damien Elmes
9421a037f6 remove self explanatory module docstrings; strip trailing whitespace 2011-04-28 09:21:07 +09:00
Damien Elmes
4302306fe9 use a checksum for field values; fixed import->update number
Previously we had an index on the value field, which was very expensive for
long fields. Instead we use a separate column and take the first 8 characters
of the field value's md5sum, and index that. In decks with lots of text in
fields, it can cut the deck size by 30% or more, and many decks improve by
10-20%. Decks with only a few characters in fields may increase in size
slightly, but this is offset by the fact that we only generate a checksum for
fields that have uniqueness checking on.

Also, fixed import->update reporting the total # of available facts instead of
the number of facts that were imported.
2011-04-28 09:21:06 +09:00
Damien Elmes
28604b9d29 remove priorities 2011-04-28 09:21:06 +09:00
Damien Elmes
7fc593a2ce fix tag update 2010-12-08 17:05:19 +09:00
Damien Elmes
e3dd736460 add ability to update fields when importing 2010-11-26 01:36:24 +09:00
Damien Elmes
6ec898ca4b Require explicit reset for most queue-modifying functions
When you call operations like deleteCards(), suspendCards() and so on, it is
now necessary to call deck.reset() afterwards. This allows the calling code to
delay a reset if necessary. If the calling code calls a function that says the
caller must reset, the caller should be sure to call .reset() and fetch the
current card again. Failure to do the latter will result in answerCard()
attempting to remove the card from the queue, when the queue has been cleared.
2010-11-23 17:41:36 +09:00
Damien Elmes
b69fd48768 more type handling updates; don't munge counts on sync
In various parts of the code we need to get all cards of a given category
(new, failed, etc) regardless of whether they're suspended, buried, etc. So we
store the true type in the obsolete relativeDelay column and add in index for
it, because it's cheaper than putting indices on reps & successive.
2010-11-13 18:39:24 +09:00
Damien Elmes
1f20442921 require dingsbums decks to use a different name so we don't conflict 2010-10-24 13:26:51 +09:00
Damien Elmes
be4dea39b1 more scheduler updates
- reimplement reviewEarly and newEarly by replacing parts of the scheduler,
  instead of adding special conditions
- remove references to isDue and priority (1,2,3,4) which is not necessary
  anymore
- add option to switch between per-day scheduling and due now scheduling
- newCardsToday() -> newCardsDoneToday()
- don't decrement counts for suspended cards
- make sure to update type when suspending/unsuspending
- fix findCards()
- set hardInterval = 1-1.1 on upgrade, or the default per day scheduling doesn't
  make sense
2010-10-18 18:01:19 +09:00
Damien Elmes
ad743d850d start work on scheduling refactor
Previously we used getCard() to fetch a card at the time. This required a
number of indices to perform efficiently, and the indices were expensive in
terms of disk space and time required to keep them up to date. Instead we now
gather a bunch of cards at once.

- Drop checkDue()/isDue so writes are not necessary to the DB when checking
for due cards
- Due counts checked on deck load, and only updated once a day or at the end
of a session. This prevents cards from expiring during reviews, leading to
confusing undo behaviour and due counts that go up instead of down as you
review. The default will be to only expire cards once a day, which represents
a change from the way things were done previously.
- Set deck var defaults on deck load/create instead of upgrade, which should
fix upgrade issues
- The scheduling code can now have bits and pieces switched out, which should
make review early / cram etc easier to integrate
- Cards with priority <= 0 now have their type incremented by three, so we can
get access to schedulable cards with a single column.
- rebuildQueue() -> reset()
- refresh() -> refreshSession()
- Views and many of the indices on the cards table are now obsolete and will
  be removed in the future. I won't remove them straight away, so as to not
  break backward compatibility.
- Use bigger intervals between successive card templates, as the previous
intervals were too small to represent in doubles in some circumstances

Still to do:

- review early
- learn more
- failing mature cards where delay1 > delay0
2010-10-18 14:35:11 +09:00
Damien Elmes
a68366b5c4 fix card ordering when generating cards by basing card creation off fact 2010-07-21 19:46:27 +09:00
Damien Elmes
4769bfa7a5 another hack for w32's low timer resolution 2010-02-12 16:03:48 +09:00
Damien Elmes
c90828349c remove obsolete reference to card tags, don't store card tags on import 2010-01-23 10:59:40 +09:00
Damien Elmes
84b88507a2 tweak importing message 2009-11-27 19:53:24 +09:00
Rick Gruber-Riemer
4971069856 Added importing for DingsBums?! decks 2009-11-08 14:39:09 +09:00
Jean-Baptiste Mazon
fe19dd806d rewrite field names as tags when importing with tagDuplicates 2009-10-31 00:35:46 +01:00
Damien Elmes
8bc7e0c945 enforce ordinal ordering when importing 2009-08-17 05:05:50 +09:00
Damien Elmes
fe99ff7518 add supermemo importer from Petr Michalec 2009-07-09 23:03:23 +09:00
Damien Elmes
0d0b9fc81e make sure card count is properly updated in importing 2009-07-04 15:40:36 +09:00
Damien Elmes
2b86cd6b33 add ability to customize separato in csv import 2009-06-26 07:13:14 +09:00
Damien Elmes
e62967ecb1 switch to python csv 2009-06-18 05:21:47 +09:00
Damien Elmes
90f726e634 remove version numbers from import, as osx gets confused 2009-04-25 03:57:56 +09:00
Damien Elmes
94df742a59 fix bug with zero imports, improve speed with zero imports 2009-04-23 02:00:52 +09:00
Damien Elmes
155de15101 greatly improve import speed on large decks, randomize too 2009-04-23 01:58:40 +09:00
Damien Elmes
e9e5994248 make sure cards are tagged correctly when importing tags 2009-03-28 14:32:38 +09:00
Damien Elmes
36421cf166 use pure field model order when importing 2009-02-27 15:30:11 +09:00
Damien Elmes
ebaa37fe55 update tags when importing 2009-02-20 00:11:44 +09:00
Damien Elmes
a4e3badf80 update importing for new tag handling 2009-02-09 21:54:19 +09:00
Damien Elmes
e50ccf22e5 canonify tags when importing 2009-01-20 02:16:15 +09:00
Damien Elmes
f5feaaa782 change wording 2009-01-17 23:00:51 +09:00
Damien Elmes
ff4cc7b0af add importing tag support, fix audio 2009-01-17 22:36:14 +09:00
Damien Elmes
334d126237 recording & noise profile support on linux 2009-01-17 01:05:39 +09:00
Damien Elmes
1fa7466dd9 progress for importing 2009-01-16 20:22:46 +09:00
Damien Elmes
91e90d8092 card model > card template 2009-01-05 06:10:10 +09:00
Damien Elmes
1e98f8bf81 add card tags to fact 2008-11-30 05:47:36 +09:00
Damien Elmes
9b224263a9 fix mnemosyne import of due cards 2008-11-14 16:09:04 +09:00
Damien Elmes
b2d0e5d3df wip 2008-11-07 18:44:49 +09:00
Damien Elmes
baa1bbba5f support any file when tab separated, always use review for mnem 2008-10-28 00:12:37 +09:00
Damien Elmes
5da3a0f5d3 initial commit from hg 2008-09-27 23:50:03 +09:00