Skip to content

Commit

Permalink
feat: updated blocked submission lookup query (batch update) (#2077)
Browse files Browse the repository at this point in the history
  • Loading branch information
jszewczulak authored Oct 17, 2023
1 parent ab631ae commit a2f652a
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 4 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__ = '5.5.5'
__version__ = '5.5.6'
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ def test_get_blocked_peer_workflows(self):
_tim_sub, _tim = self._create_student_and_submission("Tim", "Tim's answer")
self._create_student_and_submission("Miles", "Miles's answer")
_pat_sub, _pat = self._create_student_and_submission("Pat", "Pat's answer")
_wayne_sub, _wayne = self._create_student_and_submission("Wayne", "Wayne's answer")

blocked = update_api.get_blocked_peer_workflows()
# we expect 0 blocked submissions as they were just created
Expand All @@ -42,8 +43,14 @@ def test_get_blocked_peer_workflows(self):
pw_tim.created_at = timezone.now() - datetime.timedelta(days=8)
pw_tim.completed_at = timezone.now() - datetime.timedelta(days=3)
pw_tim.save()
# set Wayne's submission as cancelled
pw_wayne = PeerWorkflow.objects.get(student_id=_wayne["student_id"])
pw_wayne.created_at = timezone.now() - datetime.timedelta(days=8)
pw_wayne.completed_at = timezone.now() - datetime.timedelta(days=3)
pw_wayne.cancelled_at = timezone.now() - datetime.timedelta(days=3)
pw_wayne.save()
blocked = update_api.get_blocked_peer_workflows()
# we expect 1 blocked submission
# we expect 1 blocked submission (Tim's)
self.assertEqual(len(blocked), 1)

# set Pat's submission create_at date to >7 days ago and set completed_at date
Expand Down
3 changes: 2 additions & 1 deletion openassessment/workflow/workflow_batch_update_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -267,7 +267,8 @@ def get_blocked_peer_workflows(course_id=None, item_id=None, submission_uuid=Non
filters = {
'created_at__lte': timezone.now() - datetime.timedelta(days=7),
'grading_completed_at__isnull': True,
'completed_at__isnull': False
'completed_at__isnull': False,
'cancelled_at__isnull': True
}
if course_id is not None:
filters['course_id'] = course_id
Expand Down
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": "5.5.5",
"version": "5.5.6",
"repository": "https://github.com/openedx/edx-ora2.git",
"dependencies": {
"@edx/frontend-build": "^6.1.1",
Expand Down

0 comments on commit a2f652a

Please sign in to comment.