Esempio n. 1
0
def test_expired__expired(group, assignment):
    student_group_assignment = add_student_group_assignments(
        new_student_group_assignments(1,
                                      group,
                                      assignment,
                                      due_date=datetime.now(pytz.utc)))[0]
    assert student_group_assignment.expired
Esempio n. 2
0
def test_expired__not_expired(group, assignment):
    student_group_assignment = add_student_group_assignments(
        new_student_group_assignments(
            1,
            group,
            assignment,
            due_date=datetime.now(pytz.utc) + timedelta(days=1),
        ))[0]
    assert not student_group_assignment.expired
Esempio n. 3
0
def test_new_student_group_assignment(group, assignment):
    data = new_student_group_assignments(1, group, assignment)[0]
    n_questions = assignment.questions.count()
    student_group_assignment = StudentGroupAssignment.objects.create(**data)
    assert isinstance(student_group_assignment, StudentGroupAssignment)
    assert student_group_assignment.group == data["group"]
    assert student_group_assignment.assignment == data["assignment"]
    assert student_group_assignment.order == ",".join(
        map(str, range(n_questions)))
Esempio n. 4
0
def student_group_assignment_all_answers_correct(
    group, assignment_all_answers_correct
):
    return add_student_group_assignments(
        new_student_group_assignments(1, group, assignment_all_answers_correct)
    )[0]
Esempio n. 5
0
def student_group_assignment(group, assignment):
    return add_student_group_assignments(
        new_student_group_assignments(1, group, assignment)
    )[0]
Esempio n. 6
0
def student_group_assignments(groups, assignments):
    return add_student_group_assignments(
        new_student_group_assignments(
            len(groups) * len(assignments), groups, assignments))