Commit graph

70 commits

Author SHA1 Message Date
Damien Elmes
9c7c52b99c cache deck name->obj map to improve many decks case 2018-05-29 19:30:13 +10:00
Damien Elmes
a585c21082 add old sched code back 2018-01-14 16:55:07 +10:00
Damien Elmes
c56760802c rename new sched code to schedv2.py 2018-01-14 16:54:48 +10:00
Damien Elmes
1e0b97f25b support a second filter in filtered decks 2018-01-14 13:08:38 +10:00
Damien Elmes
a062e1bc29 store day rollover relative to local time 2018-01-14 12:16:53 +10:00
Damien Elmes
be0429479a make sure we log the correct type when card.type=3 2018-01-14 12:16:53 +10:00
Damien Elmes
21023ed3e5 don't fetch reviews in deck order
- fetch reviews from all child decks at once, sorted by due order
- shuffle the gathered cards as we did previously
- review limits on child decks are ignored - only the current deck and
its parents control what the limit is
- to make the deck list consistent with actual counts, we can't sum the
child counts, as the sum in the parent limit>child limit case may not
reflect the actual number of cards that would be presented
2018-01-14 12:16:53 +10:00
Damien Elmes
4e52f43365 distinguish between buried siblings and manually buried cards 2018-01-14 12:16:53 +10:00
Damien Elmes
62c1fa4a17 preserve learning/filtered state when suspending/burying
add new card type of 3 so we can distinguish cards in relearning from
normal reviews
2018-01-14 12:16:53 +10:00
Damien Elmes
ba87fc7736 experiment with simple resched=off case to 'preview mode'
the previous approach meant we weren't able to preserve the card state
exactly when cards were in learning, since we didn't record the step
position prior to cards being moved into the filtered deck.

it also meant the answer buttons needed to change depending on state - 4
for cards in learning/review, but 2 when the card is on the final step
or is a review.

instead, in preview mode cards always have 2 buttons: again will repeat
again after a delay, and good immediately removes the card and restores
it to its previous state.

to accomplish this, we use a separate queue #, as the learn count
always needs to have a 1:1 correspondence to the number of cards
2018-01-14 12:16:53 +10:00
Damien Elmes
575f61c384 tweaks to interval constraining
- move fuzzing into _constrainedIvl() so it's applied prior to limits
like maxIvl

- don't fuzz early reviews, so cards get the same interval if a filtered
deck is rebuilt again
2018-01-14 12:16:53 +10:00
Damien Elmes
765ec0fb36 use the review queue for undue reviews 2018-01-14 12:16:53 +10:00
Damien Elmes
4070f4eef8 schedtest changes, squashed from local branch 2018-01-14 12:16:53 +10:00
Rémy Léone
4446b85ef2 Simplify comparisons 2017-09-10 15:32:51 +02:00
Damien Elmes
1d257c05ce 'oldest first' now uses the revlog for correct ordering 2017-09-06 13:02:52 +10:00
Damien Elmes
506f999581 Merge branch 'master' of github.com:dae/anki 2017-02-08 17:28:30 +10:00
Damien Elmes
227ca090db use a constant for the starting factor 2017-02-08 17:28:12 +10:00
Illia Volochii
13b7e01044 Stop inheriting from object
It is not needed in Python 3.
2017-02-07 00:21:33 +02:00
Damien Elmes
4175b6de5b Merge pull request #131 from ankitest/patch-5
next interval >= prev interval + 1
2016-07-04 16:32:57 +10:00
Dmitry Mikheev
2b922b3055 PEP8 2016-05-27 18:47:48 +05:00
Dmitry Mikheev
181c6f6f91 Refactoring a little bit
the current code just doesn't do it in the right order.
2016-05-27 01:33:46 +05:00
Dmitry Mikheev
cdfdffd608 To respect the max interval the user has set. 2016-05-27 00:55:05 +05:00
Dmitry Mikheev
c94b6a24bd next interval >= prev interval + 1
http://ankisrs.net/docs/manual.html#reviews

One final thing to note is that Anki forces a new interval to be at least 1 day longer than it was previously so that you don’t get stuck reviewing with the same interval forever. 

https://anki.tenderapp.com/discussions/ankidesktop/18382-new-interval-does-not-seem-to-be-updated-with-ease-at-130-and-current-interval-at-7-days

In some cases interval does not grow in fact.
2016-05-27 00:26:48 +05:00
Damien Elmes
15b349e3a8 start port to python 3
unit tests pass and main screens of GUI load
2016-05-12 14:45:35 +10:00
Damien Elmes
b0f7ddfefb don't bump mod time when moving cards into/out of a filtered deck
fixes the following:
- create a filtered deck and sync it
- review cards in the filtered deck and delete it
- sync again

The filtered deck deletion was bumping the mod time on cards at the
start of the sync, preventing the reviews from being synced from the
other side, leading to lost reviews and sanity check errors.
2015-03-19 15:35:04 +11:00
dae
24e83abe22 fix empty search in filtered deck
was broken by bbc8f75d70
2014-06-03 17:54:15 +09:00
Damien Elmes
bbc8f75d70 make sure OR clause doesn't allow suspended cards in filtered deck
fixes http://help.ankisrs.net/discussions/ankidesktop/6673-filter-decks-can-unsuspend-cards
2014-05-03 12:07:18 +09:00
Damien Elmes
96eeacbf69 increase filtered deck size limit to 99999 2014-01-14 15:12:45 +09:00
Damien Elmes
19b1446758 automatically remove from filtered deck before reschedule
commit 79ed57a445 prevented reschedule
on cards in a filtered deck, but it is more user friendly to
automatically move back to the home deck instead. we also don't need
to removeLrn() for review cards, because we're updating type+queue+odue
ourselves
2013-11-26 03:23:03 +09:00
Damien Elmes
ae8074ec01 make sure we reset odue when rescheduling as new
if we fail to do this for a relearning card, it sticks around
until it causes problems later
2013-11-17 16:03:58 +09:00
Damien Elmes
853faa90cd don't bother logging sortCards() 2013-11-13 16:51:40 +09:00
Damien Elmes
1df385db12 cards must be removed from filtered decks before they're buried
if not, removeLrn() resets due=odue and odue=0, leading to an invalid
delay calculation when they're later reviewed in the filtered deck

to fix this we'll need to make the same changes required to support
learning cards retaining their state when being emptied from a
filtered deck
2013-11-13 09:06:48 +09:00
Damien Elmes
433f2b06f9 make sure suspended/buried cards are reset on export too 2013-11-03 16:12:43 +09:00
Damien Elmes
1f3a57104c fix new cards not being shown in new order 2013-11-01 17:32:02 +09:00
Damien Elmes
e5d7a69631 fix an issue where non-new cards were not reset on export
only happened for cards in a filtered deck
2013-10-30 23:28:52 +09:00
Damien Elmes
d8149910eb don't terminate review abruptly when sibs removed from queue 2013-10-30 23:07:21 +09:00
Damien Elmes
3348b091d0 tweak logging
- log only sched getCard(), not all getCard calls
- don't log sched.today unless it's changed
2013-10-30 22:42:32 +09:00
Damien Elmes
a9c9452271 bury card option 2013-10-22 14:28:45 +09:00
Damien Elmes
cf51f33c66 add separate is:buried and use with filtered deck 2013-10-22 14:20:31 +09:00
Damien Elmes
0a750005b9 do not bump usn/mod when automatically unburying
in the upcoming daily unburying, this could lead to a state
where the remote end unburies just at the start of sync
and clobbers more recent changes made on the local end
2013-10-19 12:22:17 +09:00
Damien Elmes
0fbc94c186 more logging tweaks
- disable in browser, note.cards()
- in getCard() we want the calling frame, not us
- log current day
- show card/note id in card info stat
2013-10-18 14:20:20 +09:00
Damien Elmes
b99533a5ad add logging to some scheduling and syncing code 2013-10-18 11:52:21 +09:00
Damien Elmes
9baa3e197a add option to disable burying of reviews 2013-10-18 10:38:29 +09:00
Damien Elmes
7725a93d24 don't say tomorrow for burying until we introduce the new change 2013-10-02 03:50:59 +09:00
Damien Elmes
8277233827 remove invalid line 2013-09-27 17:13:26 +09:00
Damien Elmes
79ed57a445 reschedule should not operate on filtered/suspended/buried
this should fix some issues with rescheduled cards ending up in an invalid
state
2013-09-27 13:30:39 +09:00
Damien Elmes
d348179ad4 add internal option to disable burying on answer 2013-09-20 19:39:19 +09:00
Damien Elmes
aa2b31a82b honor home deck's new card bury setting 2013-09-11 15:43:26 +09:00
Damien Elmes
c1827e0561 unbury from overview shouldn't unbury all decks 2013-09-11 15:33:27 +09:00
Damien Elmes
0bef1d8530 unbury on open/close and make sure we set usn when unburying 2013-09-04 04:38:00 +09:00