I am reviewing 1,500 cards on a 500 card daily. I recently updated Anki so I don’t know if it’s a feature but I don’t like and want it. I want it to just count the actual number of reviewed cards and new cards that I actually got done. Any suggestions?
HUMBLE PIE: “distinct cards studied today” statistic
If you want both numbers, here is an edit:
#This Anki 2.0 addon modifies the main window "Studied X cards today" message.
#Originally, Anki counts repeated cards in this statistic.
#This addon changes it so only distinct cards are counted.
#Made by Joseph Yasmeh for Anki 2.0 and 2.1 on Mac. July 12 2019.
#GNU license 3
#
#Code rationale:
#Each card has a unique ID assigned to it, called the cid.
#"Distinct" is a type of SQL command that tell the program that from the data it counts,
#exclude redundant things from whatever second column you chose (in this case, cid).
#Search "revlog" in the Anki manual to learn more.
from aqt.deckbrowser import*
from anki.hooks import wrap
from anki.lang import _
from anki.utils import fmtTimeSpan
# True to prepend to the default text about repetitions instead of replacing,
# False to replace it.
_keepOriginal = True
def _renderStats2(self):
cards, thetime = self.mw.col.db.first("""
select count(distinct cid), sum(time)/1000 from revlog
where id > ?""", (self.mw.col.sched.dayCutoff-86400)*1000)
cards = cards or 0
thetime = thetime or 0
msgp1 = ngettext("<!--studied-->%d distinct card", "<!--studied-->%d distinct cards", cards) % cards
try:
buf = _("Studied %(a)s in %(b)s today.") % dict(a=msgp1,
b=self.mw.col.backend.format_time_span(thetime))
except:
buf = _("Studied %(a)s in %(b)s today.") % dict(a=msgp1,
b=fmtTimeSpan(thetime, unit=1))
return buf
def _addstats(self, _old):
buf = _old(self)
return (_renderStats2(self) + "<br/>" + buf)
if _keepOriginal:
# prepend to the default text
DeckBrowser._renderStats = wrap(DeckBrowser._renderStats, _addstats, "around")
else: # replace the default text
DeckBrowser._renderStats = _renderStats2
1 Like
This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.