diff --git a/lms/djangoapps/ora_staff_grader/ora_staff_grader.postman_collection.json b/lms/djangoapps/ora_staff_grader/ora_staff_grader.postman_collection.json index ed3b64a126..ff32a81c86 100644 --- a/lms/djangoapps/ora_staff_grader/ora_staff_grader.postman_collection.json +++ b/lms/djangoapps/ora_staff_grader/ora_staff_grader.postman_collection.json @@ -129,7 +129,7 @@ } ], "cookie": [], - "body": "{\n \"courseMetadata\": {\n \"title\": \"ORA Smoke Testing\",\n \"org\": \"DevX\",\n \"number\": \"ORA101\",\n \"courseId\": \"course-v1:DevX+ORA101+T12020\"\n },\n \"oraMetadata\": {\n \"name\": \"Open Response Assessment\",\n \"prompts\": [\n {\n \"description\": \"

Enter a text/files response.

\"\n }\n ],\n \"type\": \"individual\",\n \"textResponseConfig\": \"optional\",\n \"fileUploadResponseConfig\": \"required\",\n \"rubricConfig\": {\n \"feedbackPrompt\": \"(Optional) What aspects of this response stood out to you? What did it do well? How could it be improved?\\n\",\n \"criteria\": [\n {\n \"label\": \"Ideas\",\n \"prompt\": \"Determine if there is a unifying theme or main idea.\",\n \"feedback\": \"optional\",\n \"name\": \"Ideas\",\n \"orderNum\": 0,\n \"options\": [\n {\n \"label\": \"Poor\",\n \"points\": 0,\n \"explanation\": \"Difficult for the reader to discern the main idea. Too brief or too repetitive to establish or maintain a focus.\",\n \"name\": \"Poor\",\n \"orderNum\": 0\n },\n {\n \"label\": \"Fair\",\n \"points\": 3,\n \"explanation\": \"Presents a unifying theme or main idea, but may include minor tangents. Stays somewhat focused on topic and task.\",\n \"name\": \"Fair\",\n \"orderNum\": 1\n },\n {\n \"label\": \"Good\",\n \"points\": 5,\n \"explanation\": \"Presents a unifying theme or main idea without going off on tangents. Stays completely focused on topic and task.\",\n \"name\": \"Good\",\n \"orderNum\": 2\n }\n ]\n },\n {\n \"label\": \"Content\",\n \"prompt\": \"Assess the content of the submission\",\n \"feedback\": \"disabled\",\n \"name\": \"Content\",\n \"orderNum\": 1,\n \"options\": [\n {\n \"label\": \"Poor\",\n \"points\": 0,\n \"explanation\": \"Includes little information with few or no details or unrelated details. Unsuccessful in attempts to explore any facets of the topic.\",\n \"name\": \"Poor\",\n \"orderNum\": 0\n },\n {\n \"label\": \"Fair\",\n \"points\": 1,\n \"explanation\": \"Includes little information and few or no details. Explores only one or two facets of the topic.\",\n \"name\": \"Fair\",\n \"orderNum\": 1\n },\n {\n \"label\": \"Good\",\n \"points\": 3,\n \"explanation\": \"Includes sufficient information and supporting details. (Details may not be fully developed; ideas may be listed.) Explores some facets of the topic.\",\n \"name\": \"Good\",\n \"orderNum\": 2\n },\n {\n \"label\": \"Excellent\",\n \"points\": 5,\n \"explanation\": \"Includes in-depth information and exceptional supporting details that are fully developed. Explores all facets of the topic.\",\n \"name\": \"Excellent\",\n \"orderNum\": 3\n }\n ]\n }\n ]\n }\n },\n \"submissions\": {\n \"034442b6-2ae8-4b17-815f-0c2e08aaa7ab\": {\n \"submissionUUID\": \"034442b6-2ae8-4b17-815f-0c2e08aaa7ab\",\n \"username\": \"test1\",\n \"teamName\": null,\n \"dateSubmitted\": \"2020-12-09 21:02:29.493046+00:00\",\n \"dateGraded\": \"2020-12-09 21:06:04.235926+00:00\",\n \"gradedBy\": \"staff\",\n \"gradingStatus\": \"graded\",\n \"lockStatus\": \"unlocked\",\n \"score\": {\n \"pointsEarned\": 6,\n \"pointsPossible\": 10\n }\n },\n \"a80465d1-cf77-405d-9d6d-94a0f94ff13a\": {\n \"submissionUUID\": \"a80465d1-cf77-405d-9d6d-94a0f94ff13a\",\n \"username\": \"test2\",\n \"teamName\": null,\n \"dateSubmitted\": \"2020-12-09 21:09:46.286584+00:00\",\n \"dateGraded\": \"2020-12-09 21:13:53.798227+00:00\",\n \"gradedBy\": \"staff\",\n \"gradingStatus\": \"graded\",\n \"lockStatus\": \"in-progress\",\n \"score\": {\n \"pointsEarned\": 4,\n \"pointsPossible\": 10\n }\n },\n \"e273d6b6-77dc-4161-9efa-ad35ea0ca6af\": {\n \"submissionUUID\": \"e273d6b6-77dc-4161-9efa-ad35ea0ca6af\",\n \"username\": \"verified\",\n \"teamName\": null,\n \"dateSubmitted\": \"2021-03-04 21:01:26.295960+00:00\",\n \"dateGraded\": \"2021-10-27 14:49:16.236821+00:00\",\n \"gradedBy\": \"staff\",\n \"gradingStatus\": \"graded\",\n \"lockStatus\": \"unlocked\",\n \"score\": {\n \"pointsEarned\": 4,\n \"pointsPossible\": 10\n }\n },\n \"3e34fdba-befd-490c-a2bd-a8d2e4dae028\": {\n \"submissionUUID\": \"3e34fdba-befd-490c-a2bd-a8d2e4dae028\",\n \"username\": \"staff\",\n \"teamName\": null,\n \"dateSubmitted\": \"2021-05-19 16:42:36.078273+00:00\",\n \"dateGraded\": \"2021-10-27 14:49:45.967842+00:00\",\n \"gradedBy\": \"staff\",\n \"gradingStatus\": \"graded\",\n \"lockStatus\": \"unlocked\",\n \"score\": {\n \"pointsEarned\": 10,\n \"pointsPossible\": 10\n }\n }\n }\n}" + "body": "{\n \"courseMetadata\": {\n \"title\": \"ORA Smoke Testing\",\n \"org\": \"DevX\",\n \"number\": \"ORA101\",\n \"courseId\": \"course-v1:DevX+ORA101+T12020\"\n },\n \"oraMetadata\": {\n \"name\": \"Open Response Assessment\",\n \"prompts\": [\n {\n \"description\": \"

Enter a text/files response.

\"\n }\n ],\n \"type\": \"individual\",\n \"textResponseConfig\": \"optional\",\n \"fileUploadResponseConfig\": \"required\",\n \"rubricConfig\": {\n \"feedbackPrompt\": \"(Optional) What aspects of this response stood out to you? What did it do well? How could it be improved?\\n\",\n \"criteria\": [\n {\n \"label\": \"Ideas\",\n \"prompt\": \"Determine if there is a unifying theme or main idea.\",\n \"feedback\": \"optional\",\n \"name\": \"Ideas\",\n \"orderNum\": 0,\n \"options\": [\n {\n \"label\": \"Poor\",\n \"points\": 0,\n \"explanation\": \"Difficult for the reader to discern the main idea. Too brief or too repetitive to establish or maintain a focus.\",\n \"name\": \"Poor\",\n \"orderNum\": 0\n },\n {\n \"label\": \"Fair\",\n \"points\": 3,\n \"explanation\": \"Presents a unifying theme or main idea, but may include minor tangents. Stays somewhat focused on topic and task.\",\n \"name\": \"Fair\",\n \"orderNum\": 1\n },\n {\n \"label\": \"Good\",\n \"points\": 5,\n \"explanation\": \"Presents a unifying theme or main idea without going off on tangents. Stays completely focused on topic and task.\",\n \"name\": \"Good\",\n \"orderNum\": 2\n }\n ]\n },\n {\n \"label\": \"Content\",\n \"prompt\": \"Assess the content of the submission\",\n \"feedback\": \"disabled\",\n \"name\": \"Content\",\n \"orderNum\": 1,\n \"options\": [\n {\n \"label\": \"Poor\",\n \"points\": 0,\n \"explanation\": \"Includes little information with few or no details or unrelated details. Unsuccessful in attempts to explore any facets of the topic.\",\n \"name\": \"Poor\",\n \"orderNum\": 0\n },\n {\n \"label\": \"Fair\",\n \"points\": 1,\n \"explanation\": \"Includes little information and few or no details. Explores only one or two facets of the topic.\",\n \"name\": \"Fair\",\n \"orderNum\": 1\n },\n {\n \"label\": \"Good\",\n \"points\": 3,\n \"explanation\": \"Includes sufficient information and supporting details. (Details may not be fully developed; ideas may be listed.) Explores some facets of the topic.\",\n \"name\": \"Good\",\n \"orderNum\": 2\n },\n {\n \"label\": \"Excellent\",\n \"points\": 5,\n \"explanation\": \"Includes in-depth information and exceptional supporting details that are fully developed. Explores all facets of the topic.\",\n \"name\": \"Excellent\",\n \"orderNum\": 3\n }\n ]\n }\n ]\n }\n },\n \"submissions\": {\n \"034442b6-2ae8-4b17-815f-0c2e08aaa7ab\": {\n \"submissionUUID\": \"034442b6-2ae8-4b17-815f-0c2e08aaa7ab\",\n \"username\": \"test1\",\n \"teamName\": null,\n \"dateSubmitted\": \"2020-12-09 21:02:29.493046+00:00\",\n \"dateGraded\": \"2020-12-09 21:06:04.235926+00:00\",\n \"gradedBy\": \"staff\",\n \"gradeStatus\": \"graded\",\n \"lockStatus\": \"unlocked\",\n \"score\": {\n \"pointsEarned\": 6,\n \"pointsPossible\": 10\n }\n },\n \"a80465d1-cf77-405d-9d6d-94a0f94ff13a\": {\n \"submissionUUID\": \"a80465d1-cf77-405d-9d6d-94a0f94ff13a\",\n \"username\": \"test2\",\n \"teamName\": null,\n \"dateSubmitted\": \"2020-12-09 21:09:46.286584+00:00\",\n \"dateGraded\": \"2020-12-09 21:13:53.798227+00:00\",\n \"gradedBy\": \"staff\",\n \"gradeStatus\": \"graded\",\n \"lockStatus\": \"in-progress\",\n \"score\": {\n \"pointsEarned\": 4,\n \"pointsPossible\": 10\n }\n },\n \"e273d6b6-77dc-4161-9efa-ad35ea0ca6af\": {\n \"submissionUUID\": \"e273d6b6-77dc-4161-9efa-ad35ea0ca6af\",\n \"username\": \"verified\",\n \"teamName\": null,\n \"dateSubmitted\": \"2021-03-04 21:01:26.295960+00:00\",\n \"dateGraded\": \"2021-10-27 14:49:16.236821+00:00\",\n \"gradedBy\": \"staff\",\n \"gradeStatus\": \"graded\",\n \"lockStatus\": \"unlocked\",\n \"score\": {\n \"pointsEarned\": 4,\n \"pointsPossible\": 10\n }\n },\n \"3e34fdba-befd-490c-a2bd-a8d2e4dae028\": {\n \"submissionUUID\": \"3e34fdba-befd-490c-a2bd-a8d2e4dae028\",\n \"username\": \"staff\",\n \"teamName\": null,\n \"dateSubmitted\": \"2021-05-19 16:42:36.078273+00:00\",\n \"dateGraded\": \"2021-10-27 14:49:45.967842+00:00\",\n \"gradedBy\": \"staff\",\n \"gradeStatus\": \"graded\",\n \"lockStatus\": \"unlocked\",\n \"score\": {\n \"pointsEarned\": 10,\n \"pointsPossible\": 10\n }\n }\n }\n}" }, { "name": "Missing Param", @@ -2025,7 +2025,7 @@ } ], "cookie": [], - "body": "{\n \"95c8cc70-2ef6-4846-99e0-bae5f934b2ec\": {\n \"submissionUuid\": \"95c8cc70-2ef6-4846-99e0-bae5f934b2ec\",\n \"dateSubmitted\": \"2021-06-02 16:19:56.255097+00:00\",\n \"dateGraded\": \"2021-06-02 16:20:58.562861+00:00\",\n \"gradingStatus\": \"graded\",\n \"lockStatus\": \"unlocked\",\n \"gradedBy\": \"staff\",\n \"username\": \"staff\",\n \"score\": {\n \"pointsEarned\": 10,\n \"pointsPossible\": 10\n }\n },\n \"31014c5f-6971-4052-8fac-ec9c4e26000a\": {\n \"submissionUuid\": \"31014c5f-6971-4052-8fac-ec9c4e26000a\",\n \"dateSubmitted\": \"2021-11-24 16:55:12.170170+00:00\",\n \"dateGraded\": \"None\",\n \"gradingStatus\": \"ungraded\",\n \"lockStatus\": \"unlocked\",\n \"gradedBy\": \"staff\",\n \"username\": \"audit\",\n \"score\": {}\n },\n \"b086331a-5c50-428a-8348-5a85e5029299\": {\n \"submissionUuid\": \"b086331a-5c50-428a-8348-5a85e5029299\",\n \"dateSubmitted\": \"2021-11-30 21:55:06.784024+00:00\",\n \"dateGraded\": \"2021-11-30 22:28:38.333610+00:00\",\n \"gradingStatus\": \"graded\",\n \"lockStatus\": \"unlocked\",\n \"gradedBy\": \"staff\",\n \"username\": \"verified\",\n \"score\": {\n \"pointsEarned\": 8,\n \"pointsPossible\": 10\n }\n }\n}" + "body": "{\n \"95c8cc70-2ef6-4846-99e0-bae5f934b2ec\": {\n \"submissionUuid\": \"95c8cc70-2ef6-4846-99e0-bae5f934b2ec\",\n \"dateSubmitted\": \"2021-06-02 16:19:56.255097+00:00\",\n \"dateGraded\": \"2021-06-02 16:20:58.562861+00:00\",\n \"gradeStatus\": \"graded\",\n \"lockStatus\": \"unlocked\",\n \"gradedBy\": \"staff\",\n \"username\": \"staff\",\n \"score\": {\n \"pointsEarned\": 10,\n \"pointsPossible\": 10\n }\n },\n \"31014c5f-6971-4052-8fac-ec9c4e26000a\": {\n \"submissionUuid\": \"31014c5f-6971-4052-8fac-ec9c4e26000a\",\n \"dateSubmitted\": \"2021-11-24 16:55:12.170170+00:00\",\n \"dateGraded\": \"None\",\n \"gradeStatus\": \"ungraded\",\n \"lockStatus\": \"unlocked\",\n \"gradedBy\": \"staff\",\n \"username\": \"audit\",\n \"score\": {}\n },\n \"b086331a-5c50-428a-8348-5a85e5029299\": {\n \"submissionUuid\": \"b086331a-5c50-428a-8348-5a85e5029299\",\n \"dateSubmitted\": \"2021-11-30 21:55:06.784024+00:00\",\n \"dateGraded\": \"2021-11-30 22:28:38.333610+00:00\",\n \"gradeStatus\": \"graded\",\n \"lockStatus\": \"unlocked\",\n \"gradedBy\": \"staff\",\n \"username\": \"verified\",\n \"score\": {\n \"pointsEarned\": 8,\n \"pointsPossible\": 10\n }\n }\n}" }, { "name": "List Team Submissions (Not Supported)", @@ -3215,4 +3215,4 @@ "value": "" } ] -} \ No newline at end of file +} diff --git a/lms/djangoapps/ora_staff_grader/serializers.py b/lms/djangoapps/ora_staff_grader/serializers.py index ad01f5212a..bf34897c6d 100644 --- a/lms/djangoapps/ora_staff_grader/serializers.py +++ b/lms/djangoapps/ora_staff_grader/serializers.py @@ -140,7 +140,7 @@ class SubmissionMetadataSerializer(serializers.Serializer): dateSubmitted = serializers.DateTimeField() dateGraded = serializers.DateTimeField(allow_null=True) gradedBy = serializers.CharField(allow_null=True) - gradingStatus = GradeStatusField() + gradeStatus = GradeStatusField(source="gradingStatus") lockStatus = LockStatusField() score = ScoreField() @@ -152,7 +152,7 @@ class SubmissionMetadataSerializer(serializers.Serializer): "dateSubmitted", "dateGraded", "gradedBy", - "gradingStatus", + "gradeStatus", "lockStatus", "score", ] diff --git a/lms/djangoapps/ora_staff_grader/tests/test_serializers.py b/lms/djangoapps/ora_staff_grader/tests/test_serializers.py index 58719473a8..648f053772 100644 --- a/lms/djangoapps/ora_staff_grader/tests/test_serializers.py +++ b/lms/djangoapps/ora_staff_grader/tests/test_serializers.py @@ -260,10 +260,13 @@ class TestSubmissionMetadataSerializer(TestCase): for submission_id, submission_data in self.submission_data.items(): data = SubmissionMetadataSerializer(submission_data).data - # For each submission, the only transform is to change "submissionUuid" to "submissionUUID" + # For each submission, there are only a few transforms: + # 1) "submissionUuid" to "submissionUUID" + # 2) "gradingStatus" to "gradeStatus" # Create that "expected" object here by updating the key name expected_data = self.submission_data[submission_id].copy() expected_data["submissionUUID"] = expected_data.pop("submissionUuid") + expected_data["gradeStatus"] = expected_data.pop("gradingStatus") assert data == expected_data @@ -289,7 +292,7 @@ class TestSubmissionMetadataSerializer(TestCase): "dateSubmitted": "1983-06-03 00:00:00", "dateGraded": None, "gradedBy": None, - "gradingStatus": "ungraded", + "gradeStatus": "ungraded", "lockStatus": "unlocked", "score": None, }