space cards to next session if per-day off

This commit is contained in:
Damien Elmes 2011-01-02 17:43:53 +09:00
parent b45f071581
commit b235461d8b

View file

@ -890,7 +890,7 @@ where id in """
self.s.statement(""" self.s.statement("""
update cards set update cards set
combinedDue = (case combinedDue = (case
when type = 1 then :daycut when type = 1 then :cut
when type = 2 then :new when type = 2 then :new
end), end),
modified = :now, isDue = 0 modified = :now, isDue = 0
@ -898,8 +898,7 @@ 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, daycut=self.failedCutoff, cut=self.dueCutoff, new=new)
new=new)
# update local cache of seen facts # update local cache of seen facts
self.spacedFacts[card.factId] = new self.spacedFacts[card.factId] = new