def problem_errors(assignment) -> dict:
    """ Takes an assignment object and returns a
        dictionary of each of the problems in the
        assignment and the number of errors all
        students made on that problem.
    """

    problems = {}
    problem_number = 1

    for problem in assignment.problems.all():
        problems[problem_number] = len(problem.errors.all())
        problem_number += 1
    return problems