diff --git a/anki/stats.py b/anki/stats.py index f2e96aae2..d4e33fde4 100644 --- a/anki/stats.py +++ b/anki/stats.py @@ -331,62 +331,92 @@ class DeckStats(object): html += _("Total number of cards:") + " %d
" % total html += _("Total number of facts:") + " %d

" % d.factCount - html += "" + _("Card counts") + "
" + html += "" + _("Card Maturity") + "
" html += _("Mature cards: ") + " %(old)d (%(oldP)s)
" % { 'old': stats['old'], 'oldP' : fmtPerc(stats['oldP'])} html += _("Young cards: ") + " %(young)d (%(youngP)s)
" % { 'young': stats['young'], 'youngP' : fmtPerc(stats['youngP'])} - html += _("Unseen cards:") + " %(new)d (%(newP)s)

" % { + html += _("Unseen cards:") + " %(new)d (%(newP)s)
" % { 'new': stats['new'], 'newP' : fmtPerc(stats['newP'])} - html += "" + _("Correct answers") + "
" + avgInt = self.getAverageInterval() + if avgInt: + html += _("Average interval: ") + ("%s ") % fmtFloat(avgInt) + _("days") + html += "
" + html += "
" + inactive = d.inactiveCardCount() + suspended = d.suspendedCardCount() + active = total - inactive - suspended + inactiveP = inactive / float(total) * 100 + suspendedP = suspended / float(total) * 100 + activeP = active / float(total) * 100 + html += "" + _("Card State") + "
" + html += _("Active cards:") + " %(a)d (%(b)s)
" % { + 'a': active, 'b' : fmtPerc(activeP)} + html += _("Inactive cards:") + " %(a)d (%(b)s)
" % { + 'a': inactive, 'b' : fmtPerc(inactiveP)} + html += _("Suspended cards:") + " %(a)d (%(b)s)

" % { + 'a': suspended, 'b' : fmtPerc(suspendedP)} + html += "" + _("Correct Answers") + "
" html += _("Mature cards: ") + " " + fmtPerc(stats['gMatureYes%']) + ( - " " + _("%(partOf)d of %(totalSum)d") % { + " " + _("(%(partOf)d of %(totalSum)d)") % { 'partOf' : stats['gMatureYes'], 'totalSum' : stats['gMatureTotal'] } + "
") html += _("Young cards: ") + " " + fmtPerc(stats['gYoungYes%']) + ( - " " + _("%(partOf)d of %(totalSum)d") % { + " " + _("(%(partOf)d of %(totalSum)d)") % { 'partOf' : stats['gYoungYes'], 'totalSum' : stats['gYoungTotal'] } + "
") html += _("First-seen cards:") + " " + fmtPerc(stats['gNewYes%']) + ( - " " + _("%(partOf)d of %(totalSum)d") % { + " " + _("(%(partOf)d of %(totalSum)d)") % { 'partOf' : stats['gNewYes'], 'totalSum' : stats['gNewTotal'] } + "

") # average pending time existing = d.cardCount - d.newCountToday - avgInt = self.getAverageInterval() def tr(a, b): return "%s%s" % (a, b) if existing and avgInt: - html += "" + _("Averages") + "" + html += "" + _("Average Reviews") + "" if sys.platform.startswith("darwin"): html += "" else: html += "
" - html += tr(_("Interval"), ("%s ") % fmtFloat(avgInt) + _("days") ) - html += tr(_("Average reps"), ("%s ") % ( + html += tr(_("Deck life"), ("%s ") % ( fmtFloat(self.getSumInverseRoundInterval())) + _("cards/day")) - html += tr(_("Reps next week"), ("%s ") % ( + html += tr(_("In next week"), ("%s ") % ( fmtFloat(self.getWorkloadPeriod(7))) + _("cards/day")) - html += tr(_("Reps next month"), ("%s ") % ( + html += tr(_("In next month"), ("%s ") % ( fmtFloat(self.getWorkloadPeriod(30))) + _("cards/day")) - html += tr(_("Reps last week"), ("%s ") % ( + html += tr(_("In last week"), ("%s ") % ( fmtFloat(self.getPastWorkloadPeriod(7))) + _("cards/day")) - html += tr(_("Reps last month"), ("%s ") % ( + html += tr(_("In last month"), ("%s ") % ( fmtFloat(self.getPastWorkloadPeriod(30))) + _("cards/day")) - html += tr(_("Avg. added"), _("%(a)s/day, %(b)s/mon") % { + html += "
" + + html += "

" + _("Average Added") + "" + if sys.platform.startswith("darwin"): + html += "" + else: + html += "
" + html += tr(_("Deck life"), _("%(a)s/day, %(b)s/mon") % { 'a': fmtFloat(self.newAverage()), 'b': fmtFloat(self.newAverage()*30)}) np = self.getNewPeriod(7) - html += tr(_("Added last week"), _("%(a)d (%(b)s/day)") % ( + html += tr(_("In last week"), _("%(a)d (%(b)s/day)") % ( {'a': np, 'b': fmtFloat(np / float(7))})) np = self.getNewPeriod(30) - html += tr(_("Added last month"), _("%(a)d (%(b)s/day)") % ( + html += tr(_("In last month"), _("%(a)d (%(b)s/day)") % ( {'a': np, 'b': fmtFloat(np / float(30))})) + html += "
" + + html += "

" + _("Average New Seen") + "" + if sys.platform.startswith("darwin"): + html += "" + else: + html += "
" np = self.getFirstPeriod(7) - html += tr(_("First last week"), _("%(a)d (%(b)s/day)") % ( + html += tr(_("In last week"), _("%(a)d (%(b)s/day)") % ( {'a': np, 'b': fmtFloat(np / float(7))})) np = self.getFirstPeriod(30) - html += tr(_("First last month"), _("%(a)d (%(b)s/day)") % ( + html += tr(_("In last month"), _("%(a)d (%(b)s/day)") % ( {'a': np, 'b': fmtFloat(np / float(30))})) html += "
" return html