diff --git a/anki/stats.py b/anki/stats.py index a55649410..a956f41ef 100644 --- a/anki/stats.py +++ b/anki/stats.py @@ -166,27 +166,32 @@ from revlog where id > ? """+lim, (self.col.sched.dayCutoff-86400)*1000) def bold(s): return ""+str(s)+"" msgp1 = ngettext("%d card", "%d cards", cards) % cards - b += _("Studied %(a)s %(b)s today.") % dict( - a=bold(msgp1), b=bold(fmtTimeSpan(thetime, unit=1, inTime=True))) - # again/pass count - b += "
" + _("Again count: %s") % bold(failed) if cards: - b += " " + _("(%s correct)") % bold( - "%0.1f%%" %((1-failed/float(cards))*100)) - # type breakdown - b += "
" - 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 >= 21 and id > ?"""+lim, (self.col.sched.dayCutoff-86400)*1000) - b += "
" - if mcnt: - b += _("Correct answers on mature cards: %(a)d/%(b)d (%(c).1f%%)") % dict( - a=msum, b=mcnt, c=(msum / float(mcnt) * 100)) + b += _("Studied %(a)s %(b)s today (%(secs).1fs/card)") % dict( + a=bold(msgp1), b=bold(fmtTimeSpan(thetime, unit=1, inTime=True)), + secs=thetime/cards + ) + # again/pass count + b += "
" + _("Again count: %s") % bold(failed) + if cards: + b += " " + _("(%s correct)") % bold( + "%0.1f%%" %((1-failed/float(cards))*100)) + # type breakdown + b += "
" + 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 >= 21 and id > ?"""+lim, (self.col.sched.dayCutoff-86400)*1000) + b += "
" + 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.") else: - b += _("No mature cards were studied today.") + b += _("No cards have been studied today.") return b # Due and cumulative due