'Common helper to verify the results of rescoring for a single
student and all students are as expected.'

def verify_rescore_results(self, problem_edit, new_expected_scores, new_expected_max, rescore_if_higher):

    problem_url_name = 'H1P1'
    self.define_option_problem(problem_url_name)
    location = InstructorTaskModuleTestCase.problem_location(problem_url_name)
    descriptor = self.module_store.get_item(location)
    self.submit_student_answer('u1', problem_url_name, [OPTION_1, OPTION_1])
    self.submit_student_answer('u2', problem_url_name, [OPTION_1, OPTION_2])
    self.submit_student_answer('u3', problem_url_name, [OPTION_2, OPTION_1])
    self.submit_student_answer('u4', problem_url_name, [OPTION_2, OPTION_2])
    expected_original_scores = (2, 1, 1, 0)
    expected_original_max = 2
    for (i, user) in enumerate(self.users):
        self.check_state(user, descriptor, expected_original_scores[i], expected_original_max)
    self.redefine_option_problem(problem_url_name, **problem_edit)
    self.render_problem('u1', problem_url_name)
    self.check_state(self.user1, descriptor, expected_original_scores[0], expected_original_max)
    self.submit_rescore_one_student_answer('instructor', problem_url_name, self.user1, rescore_if_higher)
    self.check_state(self.user1, descriptor, new_expected_scores[0], new_expected_max)
    for (i, user) in enumerate(self.users[1:], start=1):
        self.check_state(user, descriptor, expected_original_scores[i], expected_original_max)
    self.submit_rescore_all_student_answers('instructor', problem_url_name, rescore_if_higher)
    for (i, user) in enumerate(self.users):
        self.check_state(user, descriptor, new_expected_scores[i], new_expected_max)
