Skip to content

Commit

Permalink
feat: add ora filter for submission step rendering
Browse files Browse the repository at this point in the history
  • Loading branch information
BryanttV committed Feb 6, 2024
1 parent f86007d commit f369257
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 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 @@ -61,6 +62,17 @@ def get_submission_path(submission_info):
}
full_paths = {k: f"{template_dir}/{path}.html" for (k, path) in submission_template_paths.items()}

template_name = full_paths["default"]
try:
# .. filter_implemented_name: ORASubmissionViewRenderStarted
# .. filter_type: org.openedx.learning.ora.submission_view.render.started.v1
template_name = ORASubmissionViewRenderStarted.run_filter(template_name)
except ORASubmissionViewRenderStarted.RenderInvalidTemplate as exc:
template_name = exc.template
full_paths["default"] = template_name
else:
full_paths["default"] = template_name

# Response is unavailable (not yet open or past due date)
if not submission_info.has_submitted and submission_info.problem_is_inaccessible:
if submission_info.is_past_due:
Expand Down

0 comments on commit f369257

Please sign in to comment.