Previously, we'd been avoiding PLS due dates for ORA *sections*. That is, if a section had only ORA content, we'd not set a PLS due date for anything in that section. If any content in that section had non-ORA graded content however, we would set dates on all subsections, including the ORA one. This resulted in some ORA-only subsections showing up twice on the dates tab. So this patch simply brings down the ORA-only check to a *subsection* level, not a section one.
46 lines
1.3 KiB
Python
46 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 = 1
|
|
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',
|
|
)
|
|
|
|
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()
|