* feat: ora date config reflected in dates tab * docs: update docstrings * style: quality * feat: Upgrade Python dependency ora2 (#33119) temp upgrade so tests pass Commit generated by workflow `openedx/edx-platform/.github/workflows/upgrade-one-python-dependency.yml@refs/heads/master` Co-authored-by: jansenk <jansenk@users.noreply.github.com> * fix: unbound variable * fix: don't show dates for steps with no concept of due * feat: Upgrade Python dependency ora2 (#33176) bump to ora version to include ora date config changes Commit generated by workflow `openedx/edx-platform/.github/workflows/upgrade-one-python-dependency.yml@refs/heads/master` Co-authored-by: jansenk <jansenk@users.noreply.github.com> --------- Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> Co-authored-by: jansenk <jansenk@users.noreply.github.com>
47 lines
1.3 KiB
Python
47 lines
1.3 KiB
Python
"""
|
|
Courseware BlockTransformer implementations
|
|
"""
|
|
|
|
from openedx.core.djangoapps.content.block_structure.transformer import (
|
|
BlockStructureTransformer,
|
|
FilteringTransformerMixin,
|
|
)
|
|
|
|
|
|
class OpenAssessmentDateTransformer(FilteringTransformerMixin, BlockStructureTransformer):
|
|
"""
|
|
BlockTransformer to collect all fields related to dates for openassessment problems.
|
|
"""
|
|
WRITE_VERSION = 2
|
|
READ_VERSION = 1
|
|
|
|
@classmethod
|
|
def name(cls):
|
|
"""
|
|
Unique identifier for the transformer's class;
|
|
same identifier used in setup.py.
|
|
"""
|
|
return 'open_assessment_transformer'
|
|
|
|
@classmethod
|
|
def collect(cls, block_structure):
|
|
"""
|
|
Collects any information that's necessary to execute this
|
|
transformer's transform method.
|
|
"""
|
|
block_structure.request_xblock_fields(
|
|
'valid_assessments',
|
|
'submission_start',
|
|
'submission_due',
|
|
'title',
|
|
'graded',
|
|
'format',
|
|
'has_score',
|
|
'date_config_type',
|
|
)
|
|
|
|
def transform_block_filters(self, usage_info, block_structure):
|
|
# This Transformer exists only to collect fields needed by other code, so it
|
|
# doesn't transform the tree.
|
|
return block_structure.create_universal_filter()
|