mirror of
https://github.com/ankitects/anki.git
synced 2025-09-21 23:42:23 -04:00
new failed card eta from nick cook
This commit is contained in:
parent
9d3fb8d922
commit
f1a2fc7feb
1 changed files with 15 additions and 7 deletions
22
anki/deck.py
22
anki/deck.py
|
@ -736,18 +736,26 @@ and due < :now""", now=time.time())
|
||||||
stats['failed'] = self.failedSoonCount
|
stats['failed'] = self.failedSoonCount
|
||||||
stats['rev'] = self.revCount
|
stats['rev'] = self.revCount
|
||||||
if stats['dAverageTime']:
|
if stats['dAverageTime']:
|
||||||
if self.newCardSpacing == NEW_CARDS_DISTRIBUTE:
|
|
||||||
count = stats['rev'] + stats['new']
|
|
||||||
elif self.newCardSpacing == NEW_CARDS_LAST:
|
|
||||||
count = stats['rev'] or stats['new']
|
|
||||||
count += stats['failed']
|
|
||||||
count *= 1 + stats['gYoungNo%'] / 100.0
|
|
||||||
stats['timeLeft'] = anki.utils.fmtTimeSpan(
|
stats['timeLeft'] = anki.utils.fmtTimeSpan(
|
||||||
stats['dAverageTime'] * count, pad=0, point=1, short=short)
|
self.getETA(stats), pad=0, point=1, short=short)
|
||||||
else:
|
else:
|
||||||
stats['timeLeft'] = _("Unknown")
|
stats['timeLeft'] = _("Unknown")
|
||||||
return stats
|
return stats
|
||||||
|
|
||||||
|
def getETA(self, stats):
|
||||||
|
# rev + new cards first, account for failures
|
||||||
|
count = stats['rev'] + stats['new']
|
||||||
|
count *= 1 + stats['gYoungNo%'] / 100.0
|
||||||
|
left = count * stats['dAverageTime']
|
||||||
|
# failed - higher time per card for higher amount of cards
|
||||||
|
failedBaseMulti = 1.5
|
||||||
|
failedMod = 0.07
|
||||||
|
failedBaseCount = 20
|
||||||
|
factor = (failedBaseMulti +
|
||||||
|
(failedMod * (stats['failed'] - failedBaseCount)))
|
||||||
|
left += stats['failed'] * stats['dAverageTime'] * factor
|
||||||
|
return left
|
||||||
|
|
||||||
def queueForCard(self, card):
|
def queueForCard(self, card):
|
||||||
"Return the queue the current card is in."
|
"Return the queue the current card is in."
|
||||||
if self.cardIsNew(card):
|
if self.cardIsNew(card):
|
||||||
|
|
Loading…
Reference in a new issue