mirror of
https://github.com/ankitects/anki.git
synced 2025-09-23 16:26:40 -04:00
always space rev cards to the next day
This commit is contained in:
parent
7065abcf4f
commit
5eb00296d5
1 changed files with 9 additions and 2 deletions
11
anki/deck.py
11
anki/deck.py
|
@ -877,12 +877,18 @@ where id in """
|
||||||
select count() from cards
|
select count() from cards
|
||||||
where factId = :fid and id != :cid
|
where factId = :fid and id != :cid
|
||||||
and combinedDue < :cut and type = 2
|
and combinedDue < :cut and type = 2
|
||||||
|
""", cid=card.id, fid=card.factId, cut=self.dueCutoff)
|
||||||
|
# update due counts
|
||||||
|
self.revCount -= self.s.scalar("""
|
||||||
|
select count() from cards
|
||||||
|
where factId = :fid and id != :cid
|
||||||
|
and combinedDue < :cut and type = 1
|
||||||
""", cid=card.id, fid=card.factId, cut=self.dueCutoff)
|
""", cid=card.id, fid=card.factId, cut=self.dueCutoff)
|
||||||
# space cards
|
# space cards
|
||||||
self.s.statement("""
|
self.s.statement("""
|
||||||
update cards set
|
update cards set
|
||||||
combinedDue = (case
|
combinedDue = (case
|
||||||
when type = 1 then :cut - 1
|
when type = 1 then :daycut
|
||||||
when type = 2 then :new
|
when type = 2 then :new
|
||||||
end),
|
end),
|
||||||
modified = :now, isDue = 0
|
modified = :now, isDue = 0
|
||||||
|
@ -890,7 +896,8 @@ where id != :id and factId = :factId
|
||||||
and combinedDue < :cut
|
and combinedDue < :cut
|
||||||
and type between 1 and 2""",
|
and type between 1 and 2""",
|
||||||
id=card.id, now=time.time(), factId=card.factId,
|
id=card.id, now=time.time(), factId=card.factId,
|
||||||
cut=self.dueCutoff, new=new)
|
cut=self.dueCutoff, daycut=self.failedCutoff,
|
||||||
|
new=new)
|
||||||
# update local cache of seen facts
|
# update local cache of seen facts
|
||||||
self.spacedFacts[card.factId] = new
|
self.spacedFacts[card.factId] = new
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue