Exemplo n.º 1
0
def test_new_student_assignment(student, group_assignment):
    data = new_student_assignments(1, group_assignment, student)[0]

    assignment = StudentAssignment.objects.create(**data)
    assert isinstance(assignment, StudentAssignment)
    assert assignment.student == student
    assert assignment.group_assignment == group_assignment
Exemplo n.º 2
0
def students_with_assignment(student_group_assignment):
    students = add_students(new_students(20))
    add_to_group(students, student_group_assignment.group)
    add_student_assignments(
        new_student_assignments(
            len(students), student_group_assignment, students
        )
    )
    return students
Exemplo n.º 3
0
def students_with_assignments(student_group_assignments):
    students = add_students(new_students(20))
    add_to_group(students, [a.group for a in student_group_assignments])
    add_student_assignments(
        new_student_assignments(
            len(students) * len(student_group_assignments),
            student_group_assignments,
            students,
        ))
    return students
Exemplo n.º 4
0
def students_with_assignment_all_answers_correct(
    student_group_assignment_all_answers_correct
):
    students = add_students(new_students(20))
    add_to_group(students, student_group_assignment_all_answers_correct.group)
    add_student_assignments(
        new_student_assignments(
            len(students),
            student_group_assignment_all_answers_correct,
            students,
        )
    )
    return students
Exemplo n.º 5
0
def student_assignment(student, group_assignment):
    add_to_group(student, group_assignment.group)
    return add_student_assignments(
        new_student_assignments(1, group_assignment, student))[0]