def test_provisionally_done(self): """ Test to ensure that blocking steps, such as peer, are not considered done and do not display a score if the submitter's requirements have not yet been met, even if a staff score has been recorded. This test also ensures that a user may submit peer assessments after having been staff assessed, which was a bug that had been previously present. """ # Tim(student) makes a submission, for a problem that requires peer assessment tim_sub, _ = TestStaffAssessment._create_student_and_submission( "Tim", "Tim's answer", problem_steps=['peer']) # Bob(student) also makes a submission for that problem bob_sub, bob = TestStaffAssessment._create_student_and_submission( "Bob", "Bob's answer", problem_steps=['peer']) # Define peer requirements. Note that neither submission will fulfill must_be_graded_by requirements = {"peer": {"must_grade": 1, "must_be_graded_by": 2}} staff_score = "none" # Dumbledore(staff) uses override ability to provide a score for both submissions staff_api.create_assessment( tim_sub["uuid"], "Dumbledore", OPTIONS_SELECTED_DICT[staff_score]["options"], dict(), "", RUBRIC, ) staff_api.create_assessment( bob_sub["uuid"], "Dumbledore", OPTIONS_SELECTED_DICT[staff_score]["options"], dict(), "", RUBRIC, ) # Bob completes his peer assessment duties, Tim does not peer_api.get_submission_to_assess(bob_sub["uuid"], 1) peer_assess(bob_sub["uuid"], bob["student_id"], OPTIONS_SELECTED_DICT["most"]["options"], dict(), "", RUBRIC, requirements["peer"]["must_be_graded_by"]) # Verify that Bob's submission is marked done and returns the proper score bob_workflow = workflow_api.get_workflow_for_submission( bob_sub["uuid"], requirements) self.assertEqual(bob_workflow["score"]["points_earned"], OPTIONS_SELECTED_DICT[staff_score]["expected_points"]) self.assertEqual(bob_workflow["status"], "done") # Verify that Tim's submission is not marked done, and he cannot get his score tim_workflow = workflow_api.get_workflow_for_submission( tim_sub["uuid"], requirements) self.assertEqual(tim_workflow["score"], None) self.assertNotEqual(tim_workflow["status"], "done")
def test_provisionally_done(self): """ Test to ensure that blocking steps, such as peer, are not considered done and do not display a score if the submitter's requirements have not yet been met, even if a staff score has been recorded. This test also ensures that a user may submit peer assessments after having been staff assessed, which was a bug that had been previously present. """ # Tim(student) makes a submission, for a problem that requires peer assessment tim_sub, _ = TestStaffAssessment._create_student_and_submission("Tim", "Tim's answer", problem_steps=['peer']) # Bob(student) also makes a submission for that problem bob_sub, bob = TestStaffAssessment._create_student_and_submission("Bob", "Bob's answer", problem_steps=['peer']) # Define peer requirements. Note that neither submission will fulfill must_be_graded_by requirements = {"peer": {"must_grade": 1, "must_be_graded_by": 2}} staff_score = "none" # Dumbledore(staff) uses override ability to provide a score for both submissions staff_api.create_assessment( tim_sub["uuid"], "Dumbledore", OPTIONS_SELECTED_DICT[staff_score]["options"], dict(), "", RUBRIC, ) staff_api.create_assessment( bob_sub["uuid"], "Dumbledore", OPTIONS_SELECTED_DICT[staff_score]["options"], dict(), "", RUBRIC, ) # Bob completes his peer assessment duties, Tim does not peer_api.get_submission_to_assess(bob_sub["uuid"], 1) peer_assess( bob_sub["uuid"], bob["student_id"], OPTIONS_SELECTED_DICT["most"]["options"], dict(), "", RUBRIC, requirements["peer"]["must_be_graded_by"] ) # Verify that Bob's submission is marked done and returns the proper score bob_workflow = workflow_api.get_workflow_for_submission(bob_sub["uuid"], requirements) self.assertEqual(bob_workflow["score"]["points_earned"], OPTIONS_SELECTED_DICT[staff_score]["expected_points"]) self.assertEqual(bob_workflow["status"], "done") # Verify that Tim's submission is not marked done, and he cannot get his score tim_workflow = workflow_api.get_workflow_for_submission(tim_sub["uuid"], requirements) self.assertEqual(tim_workflow["score"], None) self.assertNotEqual(tim_workflow["status"], "done")
def _peer_assess(scores): """ Helper to fulfill peer assessment requirements. """ bob_sub, bob = TestStaffAssessment._create_student_and_submission("Bob", "Bob's answer", problem_steps=['peer']) peer_api.get_submission_to_assess(bob_sub["uuid"], 1) return peer_assess(bob_sub["uuid"], bob["student_id"], scores, dict(), "", RUBRIC, 1)
def _peer_assess(scores): """ Helper to fulfill peer assessment requirements. """ bob_sub, bob = TestStaffAssessment._create_student_and_submission("Bob", "Bob's answer", problem_steps=['peer']) peer_api.get_submission_to_assess(bob_sub["uuid"], 1) return peer_assess(bob_sub["uuid"], bob["student_id"], scores, {}, "", RUBRIC, 1)
def _peer_assess(sub, scorer_id, scores): bob_sub, bob = TestStaffAssessment._create_student_and_submission("Bob", "Bob's answer", problem_steps=['peer']) peer_api.get_submission_to_assess(bob_sub["uuid"], 1) return peer_assess(bob_sub["uuid"], bob["student_id"], scores, dict(), "", RUBRIC, 1)
def _peer_assess(sub, scorer_id, scores): bob_sub, bob = TestStaffAssessment._create_student_and_submission( "Bob", "Bob's answer", problem_steps=['peer']) peer_api.get_submission_to_assess(bob_sub["uuid"], 1) return peer_assess(bob_sub["uuid"], bob["student_id"], scores, dict(), "", RUBRIC, 1)