From 87b4e72f47aebe86c839267c3dae3b14398edd0e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Susanna=20Bj=C3=B6rverud?= Date: Fri, 10 Apr 2009 10:57:49 +0200 Subject: [PATCH] Experimenting with selecting cards that are both new and spaced --- anki/deck.py | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/anki/deck.py b/anki/deck.py index 03203f428..135f83ead 100644 --- a/anki/deck.py +++ b/anki/deck.py @@ -701,11 +701,12 @@ and priority in (1,2,3,4) and type in (0, 1)""", time=time) def deckFinishedMsg(self): self.resetAfterReviewEarly() spaceSusp = "" - c = self.spacedCardCount() - newLeft = self.newCardsPerDay - self.newCardsToday() - if c and newLeft: - spaceSusp += ngettext('There is %d delayed card.', - 'There are %d delayed cards.', + #c = self.spacedCardCount() + #newLeft = self.newCardsPerDay - self.newCardsToday() + c= self.newSpacedCount() + if c: # and newLeft: + spaceSusp += ngettext('There is %d delayed new card.', + 'There are %d delayed new cards.', c) % c c2 = self.suspendedCardCount() if c2: @@ -837,6 +838,13 @@ and due < :now""", now=time.time()) "All new cards, including spaced." return self.s.scalar( "select count(id) from cards where type = 2") + + def newSpacedCount(self): + "Cards that are both spaced and new." + return self.s.scalar(""" + select count(cards.id) from cards where +type = 2 and isDue = 0 and priority in (1,2,3,4) and combinedDue > :now +and due < :now""", now=time.time()) # Card predicates ##########################################################################