include average answer time for today

This commit is contained in:
Damien Elmes 2018-01-31 17:35:22 +10:00
parent 3d71d6873e
commit 6d7dd08e1e

View file

@ -166,8 +166,11 @@ from revlog where id > ? """+lim, (self.col.sched.dayCutoff-86400)*1000)
def bold(s): def bold(s):
return "<b>"+str(s)+"</b>" return "<b>"+str(s)+"</b>"
msgp1 = ngettext("<!--studied-->%d card", "<!--studied-->%d cards", cards) % cards msgp1 = ngettext("<!--studied-->%d card", "<!--studied-->%d cards", cards) % cards
b += _("Studied %(a)s %(b)s today.") % dict( if cards:
a=bold(msgp1), b=bold(fmtTimeSpan(thetime, unit=1, inTime=True))) 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 # again/pass count
b += "<br>" + _("Again count: %s") % bold(failed) b += "<br>" + _("Again count: %s") % bold(failed)
if cards: if cards:
@ -187,6 +190,8 @@ where lastIvl >= 21 and id > ?"""+lim, (self.col.sched.dayCutoff-86400)*1000)
a=msum, b=mcnt, c=(msum / float(mcnt) * 100)) a=msum, b=mcnt, c=(msum / float(mcnt) * 100))
else: else:
b += _("No mature cards were studied today.") b += _("No mature cards were studied today.")
else:
b += _("No cards have been studied today.")
return b return b
# Due and cumulative due # Due and cumulative due