예제 #1
0
 def test_staff_assess_handler_regrade(self, xblock):
     """
     To test regrade we first need to create/setup xblock, create an initial team submission and then
     regrade it.
     """
     # create initial team submission
     submission = self._setup_xblock_and_create_team_submission(xblock)
     submission["uuid"] = str(submission["submission_uuids"][0])
     # assesss initial team submission
     self.submit_staff_assessment(xblock,
                                  submission,
                                  assessment=TEAM_GOOD_ASSESSMENT)
     # get assessment via API for asserts
     assessment = teams_api.get_latest_staff_assessment(
         submission['team_submission_uuid'])
     self._assert_team_assessment(assessment, submission,
                                  self.expected_answer)
     # assess the submission as a regrade by passing in a modified assessment
     self.submit_staff_assessment(xblock,
                                  submission,
                                  assessment=TEAM_GOOD_ASSESSMENT_REGRADE)
     # get the assessment via API for asserts
     assessment = teams_api.get_latest_staff_assessment(
         submission['team_submission_uuid'])
     self._assert_team_assessment(assessment, submission,
                                  self.regrade_expected_answer)
예제 #2
0
    def test_get_latest_assessment_none(self):
        # Given no assessments for a team, when I try to get latest
        team_submission = self._create_test_submission_for_team()
        assessment = teams_api.get_latest_staff_assessment(team_submission['team_submission_uuid'])

        # Then None is returned
        self.assertIsNone(assessment)
예제 #3
0
    def test_get_latest_assessment(self):
        # Given an assessment for a team submission
        team_submission_uuid = self._create_test_submission_for_team()['team_submission_uuid']
        assessments = self._create_test_assessments_for_team(team_submission_uuid)

        # When I ask the API for the latest
        returned_assessment = teams_api.get_latest_staff_assessment(team_submission_uuid)

        # Then the correct assessment is returned
        self.assertIsNotNone(returned_assessment)
        self.assertEqual(returned_assessment['id'], assessments[-1]['id'])
예제 #4
0
    def test_staff_assess_handler(self, xblock):

        submission = self._setup_xblock_and_create_team_submission(xblock)
        submission["uuid"] = str(submission["submission_uuids"][0])

        self.submit_staff_assessment(xblock,
                                     submission,
                                     assessment=TEAM_GOOD_ASSESSMENT)

        assessment = teams_api.get_latest_staff_assessment(
            submission['team_submission_uuid'])
        self._assert_team_assessment(assessment, submission,
                                     self.expected_answer)