コード例 #1
0
ファイル: test_api.py プロジェクト: johnny-nan/edx-platform
 def test_submit_nonrescorable_modules(self):
     # confirm that a rescore of an existent but unscorable module returns an exception
     # (Note that it is easier to test a scoreable but non-rescorable module in test_tasks,
     # where we are creating real modules.)
     problem_url = self.problem_section.location
     request = None
     with self.assertRaises(NotImplementedError):
         submit_rescore_problem_for_student(request, problem_url, self.student)
     with self.assertRaises(NotImplementedError):
         submit_rescore_problem_for_all_students(request, problem_url)
コード例 #2
0
 def test_submit_nonrescorable_modules(self):
     # confirm that a rescore of an existent but unscorable module returns an exception
     # (Note that it is easier to test a scoreable but non-rescorable module in test_tasks,
     # where we are creating real modules.)
     problem_url = self.problem_section.location
     request = None
     with self.assertRaises(NotImplementedError):
         submit_rescore_problem_for_student(request, problem_url, self.student)
     with self.assertRaises(NotImplementedError):
         submit_rescore_problem_for_all_students(request, problem_url)
コード例 #3
0
ファイル: test_api.py プロジェクト: johnny-nan/edx-platform
 def test_submit_nonexistent_modules(self):
     # confirm that a rescore of a non-existent module returns an exception
     problem_url = InstructorTaskModuleTestCase.problem_location("NonexistentProblem")
     request = None
     with self.assertRaises(ItemNotFoundError):
         submit_rescore_problem_for_student(request, problem_url, self.student)
     with self.assertRaises(ItemNotFoundError):
         submit_rescore_problem_for_all_students(request, problem_url)
     with self.assertRaises(ItemNotFoundError):
         submit_reset_problem_attempts_for_all_students(request, problem_url)
     with self.assertRaises(ItemNotFoundError):
         submit_delete_problem_state_for_all_students(request, problem_url)
コード例 #4
0
 def test_submit_nonexistent_modules(self):
     # confirm that a rescore of a non-existent module returns an exception
     problem_url = InstructorTaskModuleTestCase.problem_location("NonexistentProblem")
     request = None
     with self.assertRaises(ItemNotFoundError):
         submit_rescore_problem_for_student(request, problem_url, self.student)
     with self.assertRaises(ItemNotFoundError):
         submit_rescore_problem_for_all_students(request, problem_url)
     with self.assertRaises(ItemNotFoundError):
         submit_reset_problem_attempts_for_all_students(request, problem_url)
     with self.assertRaises(ItemNotFoundError):
         submit_delete_problem_state_for_all_students(request, problem_url)
コード例 #5
0
 def submit_rescore_all_student_answers(self, instructor, problem_url_name):
     """Submits the particular problem for rescoring"""
     return submit_rescore_problem_for_all_students(
         self.create_task_request(instructor),
         self.course.id,
         InstructorTaskModuleTestCase.problem_location(problem_url_name),
     )
コード例 #6
0
 def submit_rescore_all_student_answers(self, instructor, problem_url_name):
     """Submits the particular problem for rescoring"""
     return submit_rescore_problem_for_all_students(
         self.create_task_request(instructor),
         InstructorTaskModuleTestCase.problem_location(problem_url_name))