Beispiel #1
0
def test_moveVersions():
    col = _getEmptyCol(schedVer=1)

    n = col.newNote()
    n['Front'] = "one"
    col.addNote(n)

    # make it a learning card
    col.reset()
    c = col.sched.getCard()
    col.sched.answerCard(c, 1)

    # the move to v2 should reset it to new
    col.changeSchedulerVer(2)
    c.load()
    assert c.queue == 0
    assert c.type == 0

    # fail it again, and manually bury it
    col.reset()
    c = col.sched.getCard()
    col.sched.answerCard(c, 1)
    col.sched.buryCards([c.id])
    c.load()
    assert c.queue == -3

    # revert to version 1
    col.changeSchedulerVer(1)

    # card should have moved queues
    c.load()
    assert c.queue == -2

    # and it should be new again when unburied
    col.sched.unburyCards()
    c.load()
    assert c.queue == c.type == 0

    # make sure relearning cards transition correctly to v1
    col.changeSchedulerVer(2)
    # card with 100 day interval, answering again
    col.sched.reschedCards([c.id], 100, 100)
    c.load()
    c.due = 0
    c.flush()
    col.sched._cardConf(c)['lapse']['mult'] = 0.5
    col.sched.reset()
    c = col.sched.getCard()
    col.sched.answerCard(c, 1)
    # due should be correctly set when removed from learning early
    col.changeSchedulerVer(1)
    c.load()
    assert c.due == 50
Beispiel #2
0
def test_moveVersions():
    col = _getEmptyCol(schedVer=1)

    n = col.newNote()
    n['Front'] = "one"
    col.addNote(n)

    # make it a learning card
    col.reset()
    c = col.sched.getCard()
    col.sched.answerCard(c, 1)

    # the move to v2 should reset it to new
    col.changeSchedulerVer(2)
    c.load()
    assert c.queue == 0
    assert c.type == 0

    # fail it again, and manually bury it
    col.reset()
    c = col.sched.getCard()
    col.sched.answerCard(c, 1)
    col.sched.buryCards([c.id])
    c.load()
    assert c.queue == -3

    # revert to version 1
    col.changeSchedulerVer(1)

    # card should have moved queues
    c.load()
    assert c.queue == -2

    # and it should be new again when unburied
    col.sched.unburyCards()
    c.load()
    assert c.queue == c.type == 0
Beispiel #3
0
def test_moveVersions():
    col = _getEmptyCol(schedVer=1)

    n = col.newNote()
    n['Front'] = "one"
    col.addNote(n)

    # make it a learning card
    col.reset()
    c = col.sched.getCard()
    col.sched.answerCard(c, 1)

    # the move to v2 should reset it to new
    col.changeSchedulerVer(2)
    c.load()
    assert c.queue == 0
    assert c.type == 0

    # fail it again, and manually bury it
    col.reset()
    c = col.sched.getCard()
    col.sched.answerCard(c, 1)
    col.sched.buryCards([c.id])
    c.load()
    assert c.queue == -3

    # revert to version 1
    col.changeSchedulerVer(1)

    # card should have moved queues
    c.load()
    assert c.queue == -2

    # and it should be new again when unburied
    col.sched.unburyCards()
    c.load()
    assert c.queue == c.type == 0
Beispiel #4
0
def getEmptyCol():
    return _getEmptyCol(scheduler='anki.schedv2.Scheduler')
Beispiel #5
0
def getEmptyCol():
    return _getEmptyCol(schedVer=2)
Beispiel #6
0
def getEmptyCol():
    return _getEmptyCol(schedVer=2)