mirror of
https://github.com/ankitects/anki.git
synced 2025-11-11 15:17:12 -05:00
fix forecost avg calculation
This commit is contained in:
parent
02b1494a10
commit
5dc418060e
1 changed files with 6 additions and 6 deletions
|
|
@ -143,11 +143,12 @@ table * { font-size: 14px; }
|
||||||
txt += self._graph(id="due", data=data, conf=dict(
|
txt += self._graph(id="due", data=data, conf=dict(
|
||||||
xaxis=xaxis,
|
xaxis=xaxis,
|
||||||
yaxes=[dict(), dict(tickDecimals=0, position="right")]))
|
yaxes=[dict(), dict(tickDecimals=0, position="right")]))
|
||||||
txt += self._dueInfo(tot, len(totd))
|
txt += self._dueInfo(tot, len(totd)*chunk)
|
||||||
return txt
|
return txt
|
||||||
|
|
||||||
def _dueInfo(self, tot, num):
|
def _dueInfo(self, tot, num):
|
||||||
txt = _("Average: <b>%s</b>") % self._dayWeekMonth(
|
txt = _("Total: <b>%s reviews</b>") % tot
|
||||||
|
txt += "<br>" + _("Average: <b>%s</b>") % self._avgDay(
|
||||||
tot, num, _("reviews"))
|
tot, num, _("reviews"))
|
||||||
return txt
|
return txt
|
||||||
|
|
||||||
|
|
@ -233,7 +234,6 @@ group by day order by day""" % (self._limit(), lim),
|
||||||
period = self._periodDays()
|
period = self._periodDays()
|
||||||
if not period:
|
if not period:
|
||||||
period = first
|
period = first
|
||||||
print period, first
|
|
||||||
txt = _("Days studied: <b>%(pct)d%%</b> (%(x)s of %(y)s)") % dict(
|
txt = _("Days studied: <b>%(pct)d%%</b> (%(x)s of %(y)s)") % dict(
|
||||||
x=studied, y=period, pct=studied/float(period)*100)
|
x=studied, y=period, pct=studied/float(period)*100)
|
||||||
if convHours:
|
if convHours:
|
||||||
|
|
@ -245,9 +245,9 @@ group by day order by day""" % (self._limit(), lim),
|
||||||
if convHours:
|
if convHours:
|
||||||
# convert to minutes
|
# convert to minutes
|
||||||
tot *= 60
|
tot *= 60
|
||||||
txt += "<br>"+_("Average over studied: <b>%s</b>") % self._dayWeekMonth(
|
txt += "<br>"+_("Average over studied: <b>%s</b>") % self._avgDay(
|
||||||
tot, studied, unit)
|
tot, studied, unit)
|
||||||
txt += "<br>"+_("If you studied every day: <b>%s</b>") % self._dayWeekMonth(
|
txt += "<br>"+_("If you studied every day: <b>%s</b>") % self._avgDay(
|
||||||
tot, period, unit)
|
tot, period, unit)
|
||||||
return txt
|
return txt
|
||||||
|
|
||||||
|
|
@ -608,7 +608,7 @@ $(function () {
|
||||||
else:
|
else:
|
||||||
return None
|
return None
|
||||||
|
|
||||||
def _dayWeekMonth(self, tot, num, unit):
|
def _avgDay(self, tot, num, unit):
|
||||||
vals = []
|
vals = []
|
||||||
try:
|
try:
|
||||||
vals.append(_("%d %s/day") % (tot/float(num), unit))
|
vals.append(_("%d %s/day") % (tot/float(num), unit))
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue