mirror of
https://github.com/ankitects/anki.git
synced 2025-09-21 07:22:23 -04:00
only use failedcardmax with 'soon' failed card setting, fix tag unit test
This commit is contained in:
parent
a4e3badf80
commit
231b5fe9e7
2 changed files with 8 additions and 3 deletions
|
@ -147,7 +147,8 @@ class Deck(object):
|
|||
if self.delay0 and self.failedNowCount:
|
||||
return self.s.scalar("select id from failedCards limit 1")
|
||||
# failed card queue too big?
|
||||
if self.delay0 and self.failedSoonCount >= self.failedCardMax:
|
||||
if (self.delay0 and self.failedCardMax and
|
||||
self.failedSoonCount >= self.failedCardMax):
|
||||
return self.s.scalar(
|
||||
"select id from failedCards limit 1")
|
||||
# distribute new cards?
|
||||
|
@ -1555,9 +1556,11 @@ where id = :id""", pending)
|
|||
# custom
|
||||
return
|
||||
self.collapseTime = 0
|
||||
self.failedCardMax = 0
|
||||
if idx == 0:
|
||||
d = 600
|
||||
self.collapseTime = 1
|
||||
self.failedCardMax = 20
|
||||
elif idx == 1:
|
||||
d = 0
|
||||
elif idx == 2:
|
||||
|
@ -1574,9 +1577,11 @@ where id = :id""", pending)
|
|||
return 5
|
||||
d = self.delay0
|
||||
if self.collapseTime == 1:
|
||||
if d == 600:
|
||||
if d == 600 and self.failedCardMax == 20:
|
||||
return 0
|
||||
return 5
|
||||
if self.failedCardMax != 20:
|
||||
return 5
|
||||
if d == 0:
|
||||
return 1
|
||||
elif d == 600:
|
||||
|
|
|
@ -32,7 +32,7 @@ def test_csv_tags():
|
|||
i.doImport()
|
||||
facts = deck.s.query(Fact).all()
|
||||
assert len(facts) == 1
|
||||
assert facts[0].tags == "baz, qux"
|
||||
assert facts[0].tags == "baz qux"
|
||||
deck.s.close()
|
||||
|
||||
def test_mnemosyne10():
|
||||
|
|
Loading…
Reference in a new issue