mirror of
https://github.com/ankitects/anki.git
synced 2025-09-19 14:32:22 -04:00
Add some more types
This commit is contained in:
parent
f8af9c509b
commit
7c971837ff
2 changed files with 6 additions and 6 deletions
|
@ -639,7 +639,7 @@ did = ? and queue = {QUEUE_TYPE_DAY_LEARN_RELEARN} and due <= ? limit ?""",
|
||||||
card.queue = QUEUE_TYPE_DAY_LEARN_RELEARN
|
card.queue = QUEUE_TYPE_DAY_LEARN_RELEARN
|
||||||
self._logLrn(card, ease, conf, leaving, type, lastLeft)
|
self._logLrn(card, ease, conf, leaving, type, lastLeft)
|
||||||
|
|
||||||
def _delayForGrade(self, conf: Dict[str, Any], left: int) -> Union[int, float]:
|
def _delayForGrade(self, conf: Dict[str, Any], left: int) -> float:
|
||||||
left = left % 1000
|
left = left % 1000
|
||||||
try:
|
try:
|
||||||
delay = conf["delays"][-left]
|
delay = conf["delays"][-left]
|
||||||
|
@ -923,7 +923,7 @@ select id from cards where did in %s and queue = {QUEUE_TYPE_REV} and due <= ? l
|
||||||
self._rescheduleRev(card, ease)
|
self._rescheduleRev(card, ease)
|
||||||
self._logRev(card, ease, delay)
|
self._logRev(card, ease, delay)
|
||||||
|
|
||||||
def _rescheduleLapse(self, card: Card) -> Union[int, float]:
|
def _rescheduleLapse(self, card: Card) -> float:
|
||||||
conf = self._lapseConf(card)
|
conf = self._lapseConf(card)
|
||||||
card.lastIvl = card.ivl
|
card.lastIvl = card.ivl
|
||||||
if self._resched(card):
|
if self._resched(card):
|
||||||
|
@ -977,7 +977,7 @@ select id from cards where did in %s and queue = {QUEUE_TYPE_REV} and due <= ? l
|
||||||
card.odid = 0
|
card.odid = 0
|
||||||
card.odue = 0
|
card.odue = 0
|
||||||
|
|
||||||
def _logRev(self, card: Card, ease: int, delay: Union[int, float]) -> None:
|
def _logRev(self, card: Card, ease: int, delay: float) -> None:
|
||||||
def log():
|
def log():
|
||||||
self.col.db.execute(
|
self.col.db.execute(
|
||||||
"insert into revlog values (?,?,?,?,?,?,?,?,?)",
|
"insert into revlog values (?,?,?,?,?,?,?,?,?)",
|
||||||
|
@ -1409,7 +1409,7 @@ To study outside of the normal schedule, click the Custom Study button below."""
|
||||||
return self._nextRevIvl(card, ease) * 86400
|
return self._nextRevIvl(card, ease) * 86400
|
||||||
|
|
||||||
# this isn't easily extracted from the learn code
|
# this isn't easily extracted from the learn code
|
||||||
def _nextLrnIvl(self, card: Card, ease: int) -> Union[int, float]:
|
def _nextLrnIvl(self, card: Card, ease: int) -> float:
|
||||||
if card.queue == 0:
|
if card.queue == 0:
|
||||||
card.left = self._startingLeft(card)
|
card.left = self._startingLeft(card)
|
||||||
conf = self._lrnConf(card)
|
conf = self._lrnConf(card)
|
||||||
|
|
|
@ -992,7 +992,7 @@ select id from cards where did in %s and queue = {QUEUE_TYPE_REV} and due <= ? l
|
||||||
ivl = max(1, conf["minInt"], int(card.ivl * conf["mult"]))
|
ivl = max(1, conf["minInt"], int(card.ivl * conf["mult"]))
|
||||||
return ivl
|
return ivl
|
||||||
|
|
||||||
def _rescheduleRev(self, card: Card, ease: int, early: Union[bool, int]) -> None:
|
def _rescheduleRev(self, card: Card, ease: int, early: bool) -> None:
|
||||||
# update interval
|
# update interval
|
||||||
card.lastIvl = card.ivl
|
card.lastIvl = card.ivl
|
||||||
if early:
|
if early:
|
||||||
|
@ -1075,7 +1075,7 @@ select id from cards where did in %s and queue = {QUEUE_TYPE_REV} and due <= ? l
|
||||||
return [ivl - fuzz, ivl + fuzz]
|
return [ivl - fuzz, ivl + fuzz]
|
||||||
|
|
||||||
def _constrainedIvl(
|
def _constrainedIvl(
|
||||||
self, ivl: Union[int, float], conf: Dict[str, Any], prev: int, fuzz: bool
|
self, ivl: float, conf: Dict[str, Any], prev: int, fuzz: bool
|
||||||
) -> int:
|
) -> int:
|
||||||
ivl = int(ivl * conf.get("ivlFct", 1))
|
ivl = int(ivl * conf.get("ivlFct", 1))
|
||||||
if fuzz:
|
if fuzz:
|
||||||
|
|
Loading…
Reference in a new issue