Skip to content

Commit

Permalink
feat: add ora filter for submission step rendering
Browse files Browse the repository at this point in the history
chore: add openedx-filters in base requirements

feat: move trigger of filter to add the context dict

chore: use edues branch for openedx-filters package
  • Loading branch information
BryanttV committed Feb 7, 2024
1 parent 057dcaf commit 84060a5
Show file tree
Hide file tree
Showing 6 changed files with 33 additions and 11 deletions.
9 changes: 9 additions & 0 deletions openassessment/xblock/ui_mixins/legacy/views/submission.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
import logging

from django.core.exceptions import ObjectDoesNotExist
from openedx_filters.learning.filters import ORASubmissionViewRenderStarted
from xblock.exceptions import NoSuchServiceError

from openassessment.xblock.utils.data_conversion import (
Expand Down Expand Up @@ -37,6 +38,14 @@ def render_submission(config, submission_info):
context = get_submission_context(config, submission_info)
path = get_submission_path(submission_info)

if path == "legacy/response/oa_response.html":
try:
# .. filter_implemented_name: ORASubmissionViewRenderStarted
# .. filter_type: org.openedx.learning.ora.submission_view.render.started.v1
context, path = ORASubmissionViewRenderStarted.run_filter(context, path)
except ORASubmissionViewRenderStarted.RenderInvalidTemplate as exc:
context, path = exc.context, exc.template_name

return config.render_assessment(path, context_dict=context)


Expand Down
1 change: 1 addition & 0 deletions requirements/base.in
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ djangorestframework
Xblock
edx-opaque-keys
openedx-events @ git+https://github.com/edunext/[email protected]/edues
openedx-filters @ git+https://github.com/edunext/[email protected]/edues

django
django-simple-history
Expand Down
7 changes: 5 additions & 2 deletions requirements/base.txt
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@ attrs==23.2.0
# via openedx-events
bleach==6.1.0
# via -r requirements/base.in
boto3==1.34.35
boto3==1.34.36
# via -r requirements/base.in
botocore==1.34.35
botocore==1.34.36
# via
# boto3
# s3transfer
Expand Down Expand Up @@ -46,6 +46,7 @@ django==3.2.24
# edx-toggles
# jsonfield
# openedx-events
# openedx-filters
django-crum==0.7.9
# via
# edx-django-utils
Expand Down Expand Up @@ -124,6 +125,8 @@ newrelic==9.6.0
# via edx-django-utils
openedx-events @ git+https://github.com/edunext/[email protected]/edues
# via -r requirements/base.in
openedx-filters @ git+https://github.com/edunext/[email protected]/edues
# via -r requirements/base.in
path==13.1.0
# via
# -c requirements/constraints.txt
Expand Down
9 changes: 6 additions & 3 deletions requirements/quality.txt
Original file line number Diff line number Diff line change
Expand Up @@ -64,13 +64,13 @@ boto==2.49.0
# via
# -r requirements/test.txt
# moto
boto3==1.34.35
boto3==1.34.36
# via
# -r requirements/test.txt
# aws-sam-translator
# fs-s3fs
# moto
botocore==1.34.35
botocore==1.34.36
# via
# -r requirements/test.txt
# aws-xray-sdk
Expand Down Expand Up @@ -184,6 +184,7 @@ django==3.2.24
# edx-toggles
# jsonfield
# openedx-events
# openedx-filters
# xblock-sdk
django-crum==0.7.9
# via
Expand Down Expand Up @@ -239,7 +240,7 @@ exceptiongroup==1.2.0
# pytest
factory-boy==3.3.0
# via -r requirements/test.txt
faker==22.7.0
faker==23.1.0
# via
# -r requirements/test.txt
# factory-boy
Expand Down Expand Up @@ -396,6 +397,8 @@ newrelic==9.6.0
# edx-django-utils
openedx-events @ git+https://github.com/edunext/[email protected]/edues
# via -r requirements/test.txt
openedx-filters @ git+https://github.com/edunext/[email protected]/edues
# via -r requirements/test.txt
packaging==23.2
# via
# -r requirements/test.txt
Expand Down
9 changes: 6 additions & 3 deletions requirements/test-acceptance.txt
Original file line number Diff line number Diff line change
Expand Up @@ -60,13 +60,13 @@ boto==2.49.0
# via
# -r requirements/test.txt
# moto
boto3==1.34.35
boto3==1.34.36
# via
# -r requirements/test.txt
# aws-sam-translator
# fs-s3fs
# moto
botocore==1.34.35
botocore==1.34.36
# via
# -r requirements/test.txt
# aws-xray-sdk
Expand Down Expand Up @@ -174,6 +174,7 @@ django==3.2.24
# edx-toggles
# jsonfield
# openedx-events
# openedx-filters
# xblock-sdk
django-crum==0.7.9
# via
Expand Down Expand Up @@ -227,7 +228,7 @@ exceptiongroup==1.2.0
# pytest
factory-boy==3.3.0
# via -r requirements/test.txt
faker==22.7.0
faker==23.1.0
# via
# -r requirements/test.txt
# factory-boy
Expand Down Expand Up @@ -380,6 +381,8 @@ newrelic==9.6.0
# edx-django-utils
openedx-events @ git+https://github.com/edunext/[email protected]/edues
# via -r requirements/test.txt
openedx-filters @ git+https://github.com/edunext/[email protected]/edues
# via -r requirements/test.txt
packaging==23.2
# via
# -r requirements/test.txt
Expand Down
9 changes: 6 additions & 3 deletions requirements/test.txt
Original file line number Diff line number Diff line change
Expand Up @@ -42,13 +42,13 @@ bleach==6.1.0
# via -r requirements/base.txt
boto==2.49.0
# via moto
boto3==1.34.35
boto3==1.34.36
# via
# -r requirements/base.txt
# aws-sam-translator
# fs-s3fs
# moto
botocore==1.34.35
botocore==1.34.36
# via
# -r requirements/base.txt
# aws-xray-sdk
Expand Down Expand Up @@ -133,6 +133,7 @@ distlib==0.3.8
# edx-toggles
# jsonfield
# openedx-events
# openedx-filters
# xblock-sdk
django-crum==0.7.9
# via
Expand Down Expand Up @@ -180,7 +181,7 @@ exceptiongroup==1.2.0
# via pytest
factory-boy==3.3.0
# via -r requirements/test.in
faker==22.7.0
faker==23.1.0
# via factory-boy
fastavro==1.9.3
# via
Expand Down Expand Up @@ -302,6 +303,8 @@ newrelic==9.6.0
# edx-django-utils
openedx-events @ git+https://github.com/edunext/[email protected]/edues
# via -r requirements/base.txt
openedx-filters @ git+https://github.com/edunext/[email protected]/edues
# via -r requirements/base.txt
packaging==23.2
# via
# docker
Expand Down

0 comments on commit 84060a5

Please sign in to comment.