(self)
return b
We need to overwrite the entire method to change the mature ivl
We need to overwrite the entire method to change the mature ivl
We need to overwrite the entire method to change the mature ivl
def todayStats_old(self):
    """We need to overwrite the entire method to change the mature ivl"""
    b = self._title(_("Today"))
    # studied today
    lim = self._revlogLimit()
    if lim:
        lim = " and " + lim
    cards, thetime, failed, lrn, rev, relrn, filt = self.col.db.first("""
select count(), sum(time)/1000,
sum(case when ease = 1 then 1 else 0 end), /* failed */
sum(case when type = 0 then 1 else 0 end), /* learning */
sum(case when type = 1 then 1 else 0 end), /* review */
sum(case when type = 2 then 1 else 0 end), /* relearn */
sum(case when type = 3 then 1 else 0 end) /* filter */
from revlog where id > ? """+lim, (self.col.sched.dayCutoff-86400)*1000)
    cards = cards or 0
    thetime = thetime or 0
    failed = failed or 0
    lrn = lrn or 0
    rev = rev or 0
    relrn = relrn or 0
    filt = filt or 0
    # studied
    if anki_version.startswith("2.0."):
        def bold(s):
            return "<b>"+unicode(s)+"</b>"
    else:
        def bold(s):
            return "<b>"+str(s)+"</b>"
    msgp1 = ngettext("<!--studied-->%d card", "<!--studied-->%d cards", cards) % cards
    b += _("Studied %(a)s in %(b)s today.") % dict(
        a=bold(msgp1), b=bold(fmtTimeSpan(thetime, unit=1)))
    # again/pass count
    b += "<br>" + _("Again count: %s") % bold(failed)
    if cards:
        b += " " + _("(%s correct)") % bold(
            "%0.1f%%" %((1-failed/float(cards))*100))
    # type breakdown
    b += "<br>"
    b += (_("Learn: %(a)s, Review: %(b)s, Relearn: %(c)s, Filtered: %(d)s")
          % dict(a=bold(lrn), b=bold(rev), c=bold(relrn), d=bold(filt)))
    # mature today
    mcnt, msum = self.col.db.first("""
select count(), sum(case when ease = 1 then 0 else 1 end) from revlog
where lastIvl >= %d and id > ?""" % MATURE_IVL +lim, (self.col.sched.dayCutoff-86400)*1000)
    b += "<br>"
    if mcnt:
        b += _("Correct answers on mature cards: %(a)d/%(b)d (%(c).1f%%)") % dict(
            a=msum, b=mcnt, c=(msum / float(mcnt) * 100))
    else:
        b += _("No mature cards were studied today.")
    return b
def todayStats_old ( self ) : b = self . _title ( _ ( "Today" ) ) # studied today lim = self . _revlogLimit ( ) if lim : lim = " and " + lim cards , thetime , failed , lrn , rev , relrn , filt = self . col . db . first ( """
select count(), sum(time)/1000,
sum(case when ease = 1 then 1 else 0 end), /* failed */
sum(case when type = 0 then 1 else 0 end), /* learning */
sum(case when type = 1 then 1 else 0 end), /* review */
sum(case when type = 2 then 1 else 0 end), /* relearn */
sum(case when type = 3 then 1 else 0 end) /* filter */
from revlog where id > ? """ + lim , ( self . col . sched . dayCutoff - 86400 ) * 1000 ) cards = cards or 0 thetime = thetime or 0 failed = failed or 0 lrn = lrn or 0 rev = rev or 0 relrn = relrn or 0 filt = filt or 0 # studied if anki_version . startswith ( "2.0." ) : def bold ( s ) : return "<b>" + unicode ( s ) + "</b>" else : def bold ( s ) : return "<b>" + str ( s ) + "</b>" msgp1 = ngettext ( "<!--studied-->%d card" , "<!--studied-->%d cards" , cards ) % cards b += _ ( "Studied %(a)s in %(b)s today." ) % dict ( a = bold ( msgp1 ) , b = bold ( fmtTimeSpan ( thetime , unit = 1 ) ) ) # again/pass count b += "<br>" + _ ( "Again count: %s" ) % bold ( failed ) if cards : b += " " + _ ( "(%s correct)" ) % bold ( "%0.1f%%" % ( ( 1 - failed / float ( cards ) ) * 100 ) ) # type breakdown b += "<br>" b += ( _ ( "Learn: %(a)s, Review: %(b)s, Relearn: %(c)s, Filtered: %(d)s" ) % dict ( a = bold ( lrn ) , b = bold ( rev ) , c = bold ( relrn ) , d = bold ( filt ) ) ) # mature today mcnt , msum = self . col . db . first ( """
select count(), sum(case when ease = 1 then 0 else 1 end) from revlog
where lastIvl >= %d and id > ?""" % MATURE_IVL + lim , ( self . col . sched . dayCutoff - 86400 ) * 1000 ) b += "<br>" if mcnt : b += _ ( "Correct answers on mature cards: %(a)d/%(b)d (%(c).1f%%)" ) % dict ( a = msum , b = mcnt , c = ( msum / float ( mcnt ) * 100 ) ) else : b += _ ( "No mature cards were studied today." ) return b