-
Notifications
You must be signed in to change notification settings - Fork 3.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: ORA staff grader mfe endpoints upgraded #33600
Closed
nandodev-net
wants to merge
7
commits into
openedx:master
from
eduNEXT:FG/staff_grader_table_endpoints
Closed
Changes from all commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
12b1c6b
feat: /api/ora_staff_grader/initialize upgraded
nandodev-net 9e852d2
feat: generate_assessment_data handler created
nandodev-net 1306b27
fix: style and functions rename
nandodev-net b347841
fix: test submission metadata serializers upgraded
nandodev-net 57e41da
fix: style and some test and docs improvements
nandodev-net 3504707
fix: HTTPStatus conditional
nandodev-net 4b57c21
Merge branch 'master' into FG/staff_grader_table_endpoints
nandodev-net File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -239,6 +239,8 @@ class TestSubmissionMetadataSerializer(TestCase): | |
"submissionUuid": "a", | ||
"username": "foo", | ||
"teamName": "", | ||
'email': "[email protected]", | ||
'fullname': "", | ||
"dateSubmitted": "1969-07-16 13:32:00", | ||
"dateGraded": "None", | ||
"gradedBy": "", | ||
|
@@ -249,6 +251,8 @@ class TestSubmissionMetadataSerializer(TestCase): | |
"b": { | ||
"submissionUuid": "b", | ||
"username": "", | ||
'email': "[email protected]", | ||
'fullname': "Jhon Does", | ||
"teamName": "bar", | ||
"dateSubmitted": "1969-07-20 20:17:40", | ||
"dateGraded": "None", | ||
|
@@ -260,6 +264,8 @@ class TestSubmissionMetadataSerializer(TestCase): | |
"c": { | ||
"submissionUuid": "c", | ||
"username": "baz", | ||
'email': "[email protected]", | ||
'fullname': "Jhon Does", | ||
"teamName": "", | ||
"dateSubmitted": "1969-07-21 21:35:00", | ||
"dateGraded": "1969-07-24 16:44:00", | ||
|
@@ -291,6 +297,8 @@ def test_empty_score(self): | |
submission = { | ||
"submissionUuid": "empty-score", | ||
"username": "WOPR", | ||
'email': "[email protected]", | ||
'fullname': "", | ||
"dateSubmitted": "1983-06-03 00:00:00", | ||
"dateGraded": None, | ||
"gradedBy": None, | ||
|
@@ -302,6 +310,8 @@ def test_empty_score(self): | |
expected_output = { | ||
"submissionUUID": "empty-score", | ||
"username": "WOPR", | ||
'email': "[email protected]", | ||
'fullname': "", | ||
"teamName": None, | ||
"dateSubmitted": "1983-06-03 00:00:00", | ||
"dateGraded": None, | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change | ||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
@@ -24,6 +24,7 @@ | |||||||||||||
from lms.djangoapps.ora_staff_grader.constants import ( | ||||||||||||||
PARAM_ORA_LOCATION, | ||||||||||||||
PARAM_SUBMISSION_ID, | ||||||||||||||
PARAM_ASSESSMENT_FILTER, | ||||||||||||||
) | ||||||||||||||
from lms.djangoapps.ora_staff_grader.errors import ( | ||||||||||||||
BadOraLocationResponse, | ||||||||||||||
|
@@ -43,11 +44,13 @@ | |||||||||||||
get_assessment_info, | ||||||||||||||
get_submission_info, | ||||||||||||||
get_submissions, | ||||||||||||||
get_assessments, | ||||||||||||||
submit_grade, | ||||||||||||||
) | ||||||||||||||
from lms.djangoapps.ora_staff_grader.serializers import ( | ||||||||||||||
FileListSerializer, | ||||||||||||||
InitializeSerializer, | ||||||||||||||
AssessmentFeedbackSerializer, | ||||||||||||||
LockStatusSerializer, | ||||||||||||||
StaffAssessSerializer, | ||||||||||||||
SubmissionFetchSerializer, | ||||||||||||||
|
@@ -147,6 +150,48 @@ def get(self, request, ora_location, *args, **kwargs): | |||||||||||||
return UnknownErrorResponse() | ||||||||||||||
|
||||||||||||||
|
||||||||||||||
class AssessmentFeedbackView(StaffGraderBaseView): | ||||||||||||||
""" | ||||||||||||||
GET data about Assessments by submission_uuid and ora_location | ||||||||||||||
|
||||||||||||||
Response: { | ||||||||||||||
assessments | ||||||||||||||
} | ||||||||||||||
|
||||||||||||||
Errors: | ||||||||||||||
- MissingParamResponse (HTTP 400) for missing params | ||||||||||||||
- BadOraLocationResponse (HTTP 400) for bad ORA location | ||||||||||||||
- XBlockInternalError (HTTP 500) for an issue with ORA | ||||||||||||||
- UnknownError (HTTP 500) for other errors | ||||||||||||||
""" | ||||||||||||||
|
||||||||||||||
@require_params([PARAM_ORA_LOCATION, PARAM_SUBMISSION_ID, PARAM_ASSESSMENT_FILTER]) | ||||||||||||||
def get(self, request, ora_location, submission_uuid, assessment_filter=None, *args, **kwargs): | ||||||||||||||
|
||||||||||||||
try: | ||||||||||||||
assessments_data = {} | ||||||||||||||
|
||||||||||||||
assessments_data["assessments"] = get_assessments(request, ora_location, submission_uuid, assessment_filter) | ||||||||||||||
Comment on lines
+172
to
+174
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||||||||||
|
||||||||||||||
response_data = AssessmentFeedbackSerializer(assessments_data).data | ||||||||||||||
return Response(response_data) | ||||||||||||||
|
||||||||||||||
# Catch bad ORA location | ||||||||||||||
except (InvalidKeyError, ItemNotFoundError): | ||||||||||||||
log.error(f"Bad ORA location provided: {ora_location}") | ||||||||||||||
return BadOraLocationResponse() | ||||||||||||||
|
||||||||||||||
# Issues with the XBlock handlers | ||||||||||||||
except XBlockInternalError as ex: | ||||||||||||||
log.error(ex) | ||||||||||||||
return InternalErrorResponse(context=ex.context) | ||||||||||||||
|
||||||||||||||
# Blanket exception handling in case something blows up | ||||||||||||||
except Exception as ex: | ||||||||||||||
log.exception(ex) | ||||||||||||||
return UnknownErrorResponse() | ||||||||||||||
|
||||||||||||||
|
||||||||||||||
class SubmissionFetchView(StaffGraderBaseView): | ||||||||||||||
""" | ||||||||||||||
GET submission contents and assessment info, if any | ||||||||||||||
|
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why can the
assessment_filter
argument be optional?