Skip to content

Commit

Permalink
fix: serialization of unfinished, unscored peer assignments (#2142)
Browse files Browse the repository at this point in the history
* fix: fix serializing of null assessments in score

* chore: bump ORA to 6.0.16
  • Loading branch information
nsprenkle authored Dec 13, 2023
1 parent 902836e commit dc4a5a9
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 5 deletions.
2 changes: 1 addition & 1 deletion openassessment/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@
Initialization Information for Open Assessment Module
"""

__version__ = '6.0.15'
__version__ = '6.0.16'
2 changes: 1 addition & 1 deletion openassessment/assessment/models/peer.py
Original file line number Diff line number Diff line change
Expand Up @@ -528,7 +528,7 @@ def _get_assessments(cls, submission_uuid, scored):
return Assessment.objects.filter(
pk__in=[
item.assessment.pk for item in PeerWorkflowItem.objects.filter(
submission_uuid=submission_uuid, scored=scored
submission_uuid=submission_uuid, scored=scored, assessment__isnull=False
)
]
)
Expand Down
13 changes: 13 additions & 0 deletions openassessment/assessment/test/test_peer.py
Original file line number Diff line number Diff line change
Expand Up @@ -1243,6 +1243,19 @@ def test_get_assessment_feedback_error(self, mock_filter):
tim_answer, __ = self._create_student_and_submission("Tim", "Tim's answer", MONDAY)
peer_api.get_assessment_feedback(tim_answer['uuid'])

def test_get_assessments_null(self):
# Test to fix serialization of incomplete, unscored assessments

# Tim & Buffy submit
tim_answer, _ = self._create_student_and_submission("Tim", "Tim's answer")
buffy_answer, _ = self._create_student_and_submission("Buffy", "Buffy's answer")

# Buffy starts but does not finish assessing Tim's answer
peer_api.get_submission_to_assess(buffy_answer['uuid'], REQUIRED_GRADED_BY)

# Tim gets unscored assessments, this used to throw an error
PeerWorkflowItem.get_unscored_assessments(tim_answer["uuid"])

@patch('openassessment.assessment.models.peer.PeerWorkflowItem.get_scored_assessments')
def test_set_assessment_feedback_error(self, mock_filter):
with raises(peer_api.PeerAssessmentInternalError):
Expand Down
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "edx-ora2",
"version": "6.0.15",
"version": "6.0.16",
"repository": "https://github.com/openedx/edx-ora2.git",
"dependencies": {
"@edx/frontend-build": "8.0.6",
Expand Down

0 comments on commit dc4a5a9

Please sign in to comment.