Ejemplo n.º 1
0
def test_get_first_unsolved_mission__all_unsolved():
    mission1 = ProblemSet.objects.create(section='1')
    mission2 = ProblemSet.objects.create(section='2')
    domain = Domain.objects.create()
    domain.problemsets.set([mission1, mission2])
    student = Student.objects.create()
    assert get_first_unsolved_mission(domain, student) == mission1
Ejemplo n.º 2
0
def test_get_level_for_new_student():
    mission = ProblemSet.objects.create()
    domain = Domain.objects.create()
    domain.problemsets.set([mission])
    student = Student.objects.create()
    assert get_first_unsolved_mission(domain, student) == mission
    assert get_level(domain, student) == 1
Ejemplo n.º 3
0
def test_get_first_unsolved_mission__single():
    mission = ProblemSet.objects.create()
    domain = Domain.objects.create()
    domain.problemsets.set([mission])
    student = Student.objects.create()
    assert get_first_unsolved_mission(domain, student) == mission
def select_mission(domain, student):
    return get_first_unsolved_mission(domain, student)