'Check the number attempts for all students is the same'

def _assert_num_attempts(self, students, num_attempts):

    for student in students:
        module = StudentModule.objects.get(course_id=self.course.id, student=student, module_state_key=self.location)
        state = json.loads(module.state)
        self.assertEquals(state['attempts'], num_attempts)
