Commit graph

445 commits

Author SHA1 Message Date
Damien Elmes
6f8a5d6a24 fix wrong priority code in rebuildTypes() 2010-11-14 08:11:28 +09:00
Damien Elmes
1f8adc791a a few failed cards related fixes
- make sure cardLimit() matches on sql statements that are broken over lines
- fix logic in getCardId()
- don't increment failed count if delay1>0 and card was mature
2010-11-13 21:39:52 +09:00
Damien Elmes
7502fba5ce change failed card handling
The old delay1 behaviour isn't easy to achieve with the queue code, as we only
refresh the queue when it's emptied, and if the user has delay1 set to say 9
hours, failed mature cards sitting in the queue could prevent subsequent young
failures from being displayed. Instead we convert delay1 to a count in days in
which to offset failed mature cards. 0 means the same time as delay0, 1 means
show the card a day later, and so on. This means users will lose the ability
to delay mature cards for x number of minutes more than young cards, but a
scan of AnkiOnline decks indicates that's not often done.

We also need to use a separate cutoff for failed cards, since we need to be
able to display them as they expire if the user has disabled per-day
scheduling.

And instead of marking cards as due in the future, we set their due time to
the current time, and move the delay0 calculation to getCardId(). This means
that if the user changes their failed card settings from say 1 hour to 10
minutes, the changes apply to the currently failed cards and not just cards
failed in the future.
2010-11-13 21:15:41 +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
268d2645fd delete cards that have the wrong card model 2010-11-13 16:33:39 +09:00
Damien Elmes
274017036a add sanity limits to cutoff calculation 2010-11-13 12:00:01 +09:00
Damien Elmes
919353c57d only require due to be past cutoff if the card was passed 2010-11-12 12:51:53 +09:00
Damien Elmes
3a7f343464 fix typo - been writing too much javascript lately! 2010-11-12 12:50:07 +09:00
Damien Elmes
1b411938bf add inactive argument to cramCardTags() so it performs like standard 2010-11-12 12:49:30 +09:00
Damien Elmes
9d6b0f35f4 ensure cards are scheduled past cutoff, more
- because the cutoff adds a few hours past midnight, it's possible for a card
  that's scheduled for 1.0 days ahead to fall within the current cutoff, so we
  need to make sure that doesn't happen
- set spaceUntil=0 when answering card again
- fix randomizeNewCards() query. the whole codebase needs auditing for type
  references which need updating
2010-11-07 06:48:35 +09:00
Damien Elmes
61610d8351 adjust some queries so sqlite uses the correct index 2010-11-06 08:57:47 +09:00
Damien Elmes
328a1a86a4 make sure we reset rev early cards too on deck load 2010-11-06 06:03:34 +09:00
Damien Elmes
172505a707 fix broken card type calculation in error msg 2010-11-05 02:40:30 +09:00
Damien Elmes
4c50729946 temp debug info for requeueCard() 2010-11-04 02:32:37 +09:00
Damien Elmes
b766a9164e fix thinko in previous answerCard() update 2010-11-04 02:28:08 +09:00
Damien Elmes
4524fd84fe collapse spacing when cramming 2010-11-04 02:23:15 +09:00
Damien Elmes
cc12c8c573 need to rebuild counts when cutoff updated 2010-11-04 01:51:16 +09:00
Damien Elmes
0535f0561c redundant code in answerCard() 2010-11-03 23:45:44 +09:00
Damien Elmes
3f3f797348 don't space failed cards; make sure card type is calculated after stats update 2010-11-03 00:29:56 +09:00
Damien Elmes
a68334220a fix suspensions 2010-11-02 22:30:57 +09:00
Damien Elmes
73119c93cf restore inactive tags with a more efficient query 2010-11-02 02:33:13 +09:00
Damien Elmes
37c15a320e make sure we don't fail if attempting to reset revearly cards before upgrade 2010-11-02 02:04:54 +09:00
Damien Elmes
2c5ac66083 type/priority changes, cram/rev early refactor, more
* Adjust type to remove cards from the queues, so we don't have to rebuild
  priorities to restore them:

Type -= 3 when suspending
Type += 3 when burying
Type += 6 when cramming / reviewing early

We still need to adjust priorities for backwards compatibility, but this can
be removed in the future.

* Factor out scheduler-specific code in answerCard(), so the different
  schedulers are now fully modular

* Differentiate between a card's current queue and its type

* Make sure dueCutoff cuts off at the chosen offset instead of midnight
2010-11-02 01:59:20 +09:00
Damien Elmes
785ddc3786 make sure to set card limit on scheduler change 2010-10-31 18:59:49 +09:00
Damien Elmes
ce82861357 make sure to update field cache when adding fact 2010-10-31 18:17:49 +09:00
Damien Elmes
c4a1f807ec update cram for new cardActive() handling 2010-10-31 18:12:16 +09:00
Damien Elmes
cc8f619458 remove support for inactive tags
Unlike active tags, they are not able to be implemented efficiently, and they
duplicate the functionality of manually suspending cards
2010-10-29 21:31:40 +09:00
Damien Elmes
2967819882 fix fid queries 2010-10-29 19:41:40 +09:00
Damien Elmes
621d11a6da don't generate cards if the question is blank, again 2010-10-29 01:05:33 +09:00
Damien Elmes
7e6f4907b0 make sure we don't count/grab cards multiple times 2010-10-28 20:33:19 +09:00
Damien Elmes
46ba2db87a use new field cache so we can ignore html in std search 2010-10-27 21:22:29 +09:00
Damien Elmes
731c4100f9 wrap the remaining really long lines 2010-10-27 21:06:45 +09:00
Damien Elmes
4cce768c70 update search code for new scheduler 2010-10-27 21:03:48 +09:00
Damien Elmes
8c7322c974 merge marcus' searching code 2010-10-27 20:54:42 +09:00
Damien Elmes
8ce0ff5b8b add a field cache for searching without html 2010-10-27 19:00:49 +09:00
Damien Elmes
9f9841cb22 use a join instead of a subquery as sqlite can optimize it better 2010-10-26 20:21:59 +09:00
Damien Elmes
c50b7e61cb new indices, make sure to set type when reviewing early
- new type, combinedDue for failed cards & count checks
- only reset() on deck load if not already done
- remove isDue from dynamic indices but leave old ones around for now
2010-10-26 20:10:05 +09:00
Damien Elmes
5bc7c390a0 make sure to respect failed card timing, fix default hard times 2010-10-26 11:46:35 +09:00
Damien Elmes
27b7ccb41f set deck vars before updating the cutoff 2010-10-25 15:46:58 +09:00
Damien Elmes
71de076309 no need to adjust types when rebuilding priorities 2010-10-25 15:38:50 +09:00
Damien Elmes
c1d79b856f superfluous rowcount 2010-10-25 15:36:43 +09:00
Damien Elmes
33e6a17141 make sure to set isDue=0 for spaced cards too, for backwards compat 2010-10-25 15:28:59 +09:00
Damien Elmes
b0e4748a1c make sure to update combinedDue with the new value 2010-10-25 14:35:05 +09:00
Damien Elmes
de18f59474 compat hack for suspended cards on older platforms 2010-10-24 14:21:21 +09:00
Damien Elmes
ecc99780e4 add bury support 2010-10-24 13:06:16 +09:00
Damien Elmes
1d89be0a1e make sure to set isDue=0 when answering a card for compatibility reasons 2010-10-24 13:01:13 +09:00
Damien Elmes
4c76d25b05 remove obsolete 'inactive' from findCards() 2010-10-24 12:55:33 +09:00
Damien Elmes
a3040d1fb4 suspend leeches after they've been removed from the queue 2010-10-24 12:32:40 +09:00
Damien Elmes
fbae42d8ef tweak deck stats for new scheduling 2010-10-24 12:26:18 +09:00
Damien Elmes
1e2d88dccf make sure to consider active tags when calculating next due card 2010-10-24 11:47:47 +09:00