Convert HiddenDescriptor to an XBlock.

The class name has been retained because the class path is
specified in the modulestore config in a number of places.
This commit is contained in:
Usman Khalid
2020-12-25 17:02:54 +05:00
parent 53dcec616e
commit 9116599f00
3 changed files with 63 additions and 19 deletions

View File

@@ -33,7 +33,10 @@ from common.djangoapps.edxmako.shortcuts import render_to_string
from xmodule.seq_module import SequenceModule
from xmodule.util.xmodule_django import add_webpack_to_fragment
from xmodule.vertical_block import VerticalBlock
from xmodule.x_module import PREVIEW_VIEWS, STUDIO_VIEW, XModule, XModuleDescriptor, shim_xmodule_js
from xmodule.x_module import (
PREVIEW_VIEWS, STUDENT_VIEW, STUDIO_VIEW,
XModule, XModuleDescriptor, shim_xmodule_js,
)
log = logging.getLogger(__name__)
@@ -110,6 +113,9 @@ def wrap_xblock(
)
]
if view == STUDENT_VIEW and getattr(block, 'HIDDEN', False):
css_classes.append('is-hidden')
if isinstance(block, (XModule, XModuleDescriptor)) or getattr(block, 'uses_xmodule_styles_setup', False):
if view in PREVIEW_VIEWS:
# The block is acting as an XModule
@@ -118,9 +124,6 @@ def wrap_xblock(
# The block is acting as an XModuleDescriptor
css_classes.append('xmodule_edit')
if getattr(block, 'HIDDEN', False):
css_classes.append('is-hidden')
css_classes.append('xmodule_' + markupsafe.escape(class_name))
if isinstance(block, (XModule, XModuleDescriptor)):