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
  • Loading branch information
BryanttV committed Feb 7, 2024
1 parent 057dcaf commit 395e8fc
Show file tree
Hide file tree
Showing 11 changed files with 58 additions and 112 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/openedx-filters.git@bav/ora-student-view-filter

django
django-simple-history
Expand Down
11 changes: 7 additions & 4 deletions requirements/base.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#
# This file is autogenerated by pip-compile with Python 3.8
# This file is autogenerated by pip-compile with Python 3.10
# by the following command:
#
# make upgrade
Expand All @@ -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/openedx-filters.git@bav/ora-student-view-filter
# via -r requirements/base.in
path==13.1.0
# via
# -c requirements/constraints.txt
Expand Down Expand Up @@ -193,7 +196,7 @@ typing-extensions==4.9.0
# via
# asgiref
# edx-opaque-keys
urllib3==1.26.18
urllib3==2.0.7
# via
# botocore
# requests
Expand Down
2 changes: 1 addition & 1 deletion requirements/ci.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#
# This file is autogenerated by pip-compile with Python 3.8
# This file is autogenerated by pip-compile with Python 3.10
# by the following command:
#
# make upgrade
Expand Down
29 changes: 12 additions & 17 deletions requirements/docs.txt
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
#
# This file is autogenerated by pip-compile with Python 3.8
# This file is autogenerated by pip-compile with Python 3.10
# by the following command:
#
# make upgrade
#
accessible-pygments==0.0.4
# via pydata-sphinx-theme
alabaster==0.7.13
alabaster==0.7.16
# via sphinx
babel==2.14.0
# via
Expand All @@ -20,7 +20,7 @@ charset-normalizer==3.3.2
# via requests
colorama==0.4.6
# via sphinx-autobuild
docutils==0.17.1
docutils==0.20.1
# via
# pydata-sphinx-theme
# sphinx
Expand All @@ -40,15 +40,13 @@ packaging==23.2
# via
# pydata-sphinx-theme
# sphinx
pydata-sphinx-theme==0.13.3
pydata-sphinx-theme==0.15.2
# via sphinx-book-theme
pygments==2.17.2
# via
# accessible-pygments
# pydata-sphinx-theme
# sphinx
pytz==2024.1
# via babel
requests==2.31.0
# via sphinx
six==1.16.0
Expand All @@ -57,42 +55,39 @@ snowballstemmer==2.2.0
# via sphinx
soupsieve==2.5
# via beautifulsoup4
sphinx==4.3.2
sphinx==7.2.6
# via
# -r requirements/docs.in
# pydata-sphinx-theme
# sphinx-autobuild
# sphinx-book-theme
# sphinx-copybutton
# sphinxcontrib-contentui
sphinx-autobuild==2021.3.14
sphinx-autobuild==2024.2.4
# via -r requirements/docs.in
sphinx-book-theme==1.0.1
sphinx-book-theme==1.1.0
# via -r requirements/docs.in
sphinx-copybutton==0.5.2
# via -r requirements/docs.in
sphinxcontrib-applehelp==1.0.4
sphinxcontrib-applehelp==1.0.8
# via sphinx
sphinxcontrib-contentui==0.2.5
# via -r requirements/docs.in
sphinxcontrib-devhelp==1.0.2
sphinxcontrib-devhelp==1.0.6
# via sphinx
sphinxcontrib-htmlhelp==2.0.1
sphinxcontrib-htmlhelp==2.0.5
# via sphinx
sphinxcontrib-jsmath==1.0.1
# via sphinx
sphinxcontrib-mermaid==0.9.2
# via -r requirements/docs.in
sphinxcontrib-qthelp==1.0.3
sphinxcontrib-qthelp==1.0.7
# via sphinx
sphinxcontrib-serializinghtml==1.1.5
sphinxcontrib-serializinghtml==1.1.10
# via sphinx
tornado==6.4
# via livereload
typing-extensions==4.9.0
# via pydata-sphinx-theme
urllib3==2.2.0
# via requests

# The following packages are considered to be unsafe in a requirements file:
# setuptools
6 changes: 1 addition & 5 deletions requirements/pip-tools.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#
# This file is autogenerated by pip-compile with Python 3.8
# This file is autogenerated by pip-compile with Python 3.10
# by the following command:
#
# make upgrade
Expand All @@ -8,8 +8,6 @@ build==1.0.3
# via pip-tools
click==8.1.7
# via pip-tools
importlib-metadata==7.0.1
# via build
packaging==23.2
# via build
pip-tools==7.3.0
Expand All @@ -23,8 +21,6 @@ tomli==2.0.1
# pyproject-hooks
wheel==0.42.0
# via pip-tools
zipp==3.17.0
# via importlib-metadata

# The following packages are considered to be unsafe in a requirements file:
# pip
Expand Down
2 changes: 1 addition & 1 deletion requirements/pip.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#
# This file is autogenerated by pip-compile with Python 3.8
# This file is autogenerated by pip-compile with Python 3.10
# by the following command:
#
# make upgrade
Expand Down
38 changes: 8 additions & 30 deletions requirements/quality.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#
# This file is autogenerated by pip-compile with Python 3.8
# This file is autogenerated by pip-compile with Python 3.10
# by the following command:
#
# make upgrade
Expand Down Expand Up @@ -44,12 +44,6 @@ aws-xray-sdk==2.12.1
# via
# -r requirements/test.txt
# moto
backports-zoneinfo[tzdata]==0.2.1
# via
# -r requirements/test.txt
# backports-zoneinfo
# celery
# kombu
billiard==4.2.0
# via
# -r requirements/test.txt
Expand All @@ -64,13 +58,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 +178,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 +234,7 @@ exceptiongroup==1.2.0
# pytest
factory-boy==3.3.0
# via -r requirements/test.txt
faker==22.7.0
faker==23.0.0
# via
# -r requirements/test.txt
# factory-boy
Expand Down Expand Up @@ -275,11 +270,6 @@ idna==2.8
# -r requirements/test.txt
# moto
# requests
importlib-resources==6.1.1
# via
# -r requirements/test.txt
# jsonschema
# jsonschema-specifications
iniconfig==2.0.0
# via
# -r requirements/test.txt
Expand Down Expand Up @@ -396,6 +386,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/openedx-filters.git@bav/ora-student-view-filter
# via -r requirements/test.txt
packaging==23.2
# via
# -r requirements/test.txt
Expand All @@ -417,10 +409,6 @@ pbr==6.0.0
# jschema-to-python
# sarif-om
# stevedore
pkgutil-resolve-name==1.3.10
# via
# -r requirements/test.txt
# jsonschema
platformdirs==4.2.0
# via
# -r requirements/test.txt
Expand Down Expand Up @@ -653,23 +641,17 @@ types-python-dateutil==2.8.19.20240106
typing-extensions==4.9.0
# via
# -r requirements/test.txt
# annotated-types
# asgiref
# astroid
# aws-sam-translator
# edx-opaque-keys
# faker
# kombu
# pydantic
# pydantic-core
# pylint
# rich
tzdata==2023.4
# via
# -r requirements/test.txt
# backports-zoneinfo
# celery
urllib3==1.26.18
urllib3==2.0.7
# via
# -r requirements/test.txt
# botocore
Expand Down Expand Up @@ -728,10 +710,6 @@ xmltodict==0.13.0
# via
# -r requirements/test.txt
# moto
zipp==3.17.0
# via
# -r requirements/test.txt
# importlib-resources

# The following packages are considered to be unsafe in a requirements file:
# setuptools
Loading

0 comments on commit 395e8fc

Please sign in to comment.