def test_get_the_cancelled_workflow(self): # Create the submission and assessment workflow. submission = sub_api.create_submission(ITEM_1, ANSWER_1) workflow = workflow_api.create_workflow(submission["uuid"], ["peer"]) requirements = {"peer": {"must_grade": 1, "must_be_graded_by": 1}} # Check the workflow is not cancelled. self.assertFalse(workflow_api.is_workflow_cancelled( submission["uuid"])) # Check the status is not cancelled. self.assertNotEqual(workflow.get('status'), 'cancelled') # Check the points_earned are not 0 self.assertNotEqual(workflow['score'], 0) cancelled_workflow = workflow_api.get_assessment_workflow_cancellation( submission["uuid"]) self.assertIsNone(cancelled_workflow) # Cancel the workflow for submission. workflow_api.cancel_workflow(submission_uuid=submission["uuid"], comments="Inappropriate language", cancelled_by_id=ITEM_2['student_id'], assessment_requirements=requirements) # Check workflow is cancelled. self.assertTrue(workflow_api.is_workflow_cancelled(submission["uuid"])) workflow = workflow_api.get_assessment_workflow_cancellation( submission["uuid"]) self.assertIsNotNone(workflow)
def test_cancel_the_assessment_workflow(self): # Create the submission and assessment workflow. submission = sub_api.create_submission(ITEM_1, ANSWER_1) workflow = workflow_api.create_workflow(submission["uuid"], ["peer"]) requirements = {"peer": {"must_grade": 1, "must_be_graded_by": 1}} # Check the workflow is not cancelled. self.assertFalse(workflow_api.is_workflow_cancelled( submission["uuid"])) # Check the status is not cancelled. self.assertNotEqual(workflow.get('status'), 'cancelled') # Check the points_earned are not 0 self.assertNotEqual(workflow['score'], 0) # Cancel the workflow for submission. workflow_api.cancel_workflow(submission_uuid=submission["uuid"], comments="Inappropriate language", cancelled_by_id=ITEM_2['student_id'], assessment_requirements=requirements) # Check workflow is cancelled. self.assertTrue(workflow_api.is_workflow_cancelled(submission["uuid"])) # Status for workflow should be cancelled. workflow = AssessmentWorkflow.get_by_submission_uuid( submission["uuid"]) self.assertEqual(workflow.status, 'cancelled') # Score points_earned should be 0. # In case of 0 earned points the score would be None. self.assertEqual(workflow.score, None)
def test_cancel_the_assessment_workflow_does_not_exist(self): # Create the submission and assessment workflow. submission = sub_api.create_submission(ITEM_1, ANSWER_1) workflow = workflow_api.create_workflow(submission["uuid"], ["peer"]) requirements = { "peer": { "must_grade": 1, "must_be_graded_by": 1 } } # Check if workflow is cancelled. self.assertFalse(workflow_api.is_workflow_cancelled(submission["uuid"])) self.assertNotEqual(workflow.get('status'), 'cancelled') # Cancel the workflow raises DoesNotExist. with self.assertRaises(workflow_api.AssessmentWorkflowError): workflow_api.cancel_workflow( submission_uuid="1234567098789", comments="Inappropriate language", cancelled_by_id=ITEM_2['student_id'], assessment_requirements=requirements ) # Status for workflow should not be cancelled. workflow = AssessmentWorkflow.get_by_submission_uuid(submission["uuid"]) self.assertNotEqual(workflow.status, 'cancelled')
def test_cancel_the_assessment_workflow(self): # Create the submission and assessment workflow. submission = sub_api.create_submission(ITEM_1, ANSWER_1) workflow = workflow_api.create_workflow(submission["uuid"], ["peer"]) requirements = { "peer": { "must_grade": 1, "must_be_graded_by": 1 } } # Check the workflow is not cancelled. self.assertFalse(workflow_api.is_workflow_cancelled(submission["uuid"])) # Check the status is not cancelled. self.assertNotEqual(workflow.get('status'), 'cancelled') # Check the points_earned are not 0 self.assertNotEqual(workflow['score'], 0) # Cancel the workflow for submission. workflow_api.cancel_workflow( submission_uuid=submission["uuid"], comments="Inappropriate language", cancelled_by_id=ITEM_2['student_id'], assessment_requirements=requirements ) # Check workflow is cancelled. self.assertTrue(workflow_api.is_workflow_cancelled(submission["uuid"])) # Status for workflow should be cancelled. workflow = AssessmentWorkflow.get_by_submission_uuid(submission["uuid"]) self.assertEqual(workflow.status, 'cancelled') # Score points_earned should be 0. # In case of 0 earned points the score would be None. self.assertEqual(workflow.score, None)
def test_get_the_cancelled_workflow(self): # Create the submission and assessment workflow. submission = sub_api.create_submission(ITEM_1, ANSWER_1) workflow = workflow_api.create_workflow(submission["uuid"], ["peer"]) requirements = { "peer": { "must_grade": 1, "must_be_graded_by": 1 } } # Check the workflow is not cancelled. self.assertFalse(workflow_api.is_workflow_cancelled(submission["uuid"])) # Check the status is not cancelled. self.assertNotEqual(workflow.get('status'), 'cancelled') # Check the points_earned are not 0 self.assertNotEqual(workflow['score'], 0) cancelled_workflow = workflow_api.get_assessment_workflow_cancellation(submission["uuid"]) self.assertIsNone(cancelled_workflow) # Cancel the workflow for submission. workflow_api.cancel_workflow( submission_uuid=submission["uuid"], comments="Inappropriate language", cancelled_by_id=ITEM_2['student_id'], assessment_requirements=requirements ) # Check workflow is cancelled. self.assertTrue(workflow_api.is_workflow_cancelled(submission["uuid"])) workflow = workflow_api.get_assessment_workflow_cancellation(submission["uuid"]) self.assertIsNotNone(workflow)