mirror of
https://github.com/ankitects/anki.git
synced 2025-09-21 15:32: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:
|
if self.delay0 and self.failedNowCount:
|
||||||
return self.s.scalar("select id from failedCards limit 1")
|
return self.s.scalar("select id from failedCards limit 1")
|
||||||
# failed card queue too big?
|
# 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(
|
return self.s.scalar(
|
||||||
"select id from failedCards limit 1")
|
"select id from failedCards limit 1")
|
||||||
# distribute new cards?
|
# distribute new cards?
|
||||||
|
@ -1555,9 +1556,11 @@ where id = :id""", pending)
|
||||||
# custom
|
# custom
|
||||||
return
|
return
|
||||||
self.collapseTime = 0
|
self.collapseTime = 0
|
||||||
|
self.failedCardMax = 0
|
||||||
if idx == 0:
|
if idx == 0:
|
||||||
d = 600
|
d = 600
|
||||||
self.collapseTime = 1
|
self.collapseTime = 1
|
||||||
|
self.failedCardMax = 20
|
||||||
elif idx == 1:
|
elif idx == 1:
|
||||||
d = 0
|
d = 0
|
||||||
elif idx == 2:
|
elif idx == 2:
|
||||||
|
@ -1574,9 +1577,11 @@ where id = :id""", pending)
|
||||||
return 5
|
return 5
|
||||||
d = self.delay0
|
d = self.delay0
|
||||||
if self.collapseTime == 1:
|
if self.collapseTime == 1:
|
||||||
if d == 600:
|
if d == 600 and self.failedCardMax == 20:
|
||||||
return 0
|
return 0
|
||||||
return 5
|
return 5
|
||||||
|
if self.failedCardMax != 20:
|
||||||
|
return 5
|
||||||
if d == 0:
|
if d == 0:
|
||||||
return 1
|
return 1
|
||||||
elif d == 600:
|
elif d == 600:
|
||||||
|
|
|
@ -32,7 +32,7 @@ def test_csv_tags():
|
||||||
i.doImport()
|
i.doImport()
|
||||||
facts = deck.s.query(Fact).all()
|
facts = deck.s.query(Fact).all()
|
||||||
assert len(facts) == 1
|
assert len(facts) == 1
|
||||||
assert facts[0].tags == "baz, qux"
|
assert facts[0].tags == "baz qux"
|
||||||
deck.s.close()
|
deck.s.close()
|
||||||
|
|
||||||
def test_mnemosyne10():
|
def test_mnemosyne10():
|
||||||
|
|
Loading…
Reference in a new issue