re-enable leech notification for test scheduler
This commit is contained in:
parent
dbbcb3e38c
commit
99081e422b
@ -379,13 +379,18 @@ class Reviewer:
|
|||||||
if not proceed:
|
if not proceed:
|
||||||
return
|
return
|
||||||
|
|
||||||
if v3 := self._v3:
|
if (v3 := self._v3) and (sched := cast(V3Scheduler, self.mw.col.sched)):
|
||||||
assert isinstance(self.mw.col.sched, V3Scheduler)
|
answer = sched.build_answer(
|
||||||
answer = self.mw.col.sched.build_answer(
|
|
||||||
card=self.card, states=v3.next_states, rating=v3.rating_from_ease(ease)
|
card=self.card, states=v3.next_states, rating=v3.rating_from_ease(ease)
|
||||||
)
|
)
|
||||||
|
|
||||||
|
def after_answer(changes: OpChanges) -> None:
|
||||||
|
self._after_answering(ease)
|
||||||
|
if sched.state_is_leech(answer.new_state):
|
||||||
|
self.onLeech()
|
||||||
|
|
||||||
answer_card(parent=self.mw, answer=answer).success(
|
answer_card(parent=self.mw, answer=answer).success(
|
||||||
lambda _: self._after_answering(ease)
|
after_answer
|
||||||
).run_in_background(initiator=self)
|
).run_in_background(initiator=self)
|
||||||
else:
|
else:
|
||||||
self.mw.col.sched.answerCard(self.card, ease)
|
self.mw.col.sched.answerCard(self.card, ease)
|
||||||
@ -823,10 +828,11 @@ time = %(time)d;
|
|||||||
# Leeches
|
# Leeches
|
||||||
##########################################################################
|
##########################################################################
|
||||||
|
|
||||||
def onLeech(self, card: Card) -> None:
|
def onLeech(self, card: Optional[Card] = None) -> None:
|
||||||
# for now
|
# for now
|
||||||
s = tr.studying_card_was_a_leech()
|
s = tr.studying_card_was_a_leech()
|
||||||
if card.queue < 0:
|
# v3 scheduler doesn't report this
|
||||||
|
if card and card.queue < 0:
|
||||||
s += f" {tr.studying_it_has_been_suspended()}"
|
s += f" {tr.studying_it_has_been_suspended()}"
|
||||||
tooltip(s)
|
tooltip(s)
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user