Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Django settings flags to roll out the extracted XBlocks #35549

Merged
merged 7 commits into from
Dec 2, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions xmodule/annotatable_block.py
Original file line number Diff line number Diff line change
Expand Up @@ -207,3 +207,4 @@ def studio_view(self, _context):
_ExtractedAnnotatableBlock if settings.USE_EXTRACTED_ANNOTATABLE_BLOCK
else _BuiltInAnnotatableBlock
)
AnnotatableBlock.__name__ = "AnnotatableBlock"
1 change: 1 addition & 0 deletions xmodule/capa_block.py
Original file line number Diff line number Diff line change
Expand Up @@ -2516,3 +2516,4 @@ def randomization_bin(seed, problem_id):
_ExtractedProblemBlock if settings.USE_EXTRACTED_PROBLEM_BLOCK
else _BuiltInProblemBlock
)
ProblemBlock.__name__ = "ProblemBlock"
1 change: 1 addition & 0 deletions xmodule/discussion_block.py
Original file line number Diff line number Diff line change
Expand Up @@ -283,3 +283,4 @@ def _apply_metadata_and_policy(cls, block, node, runtime):
_ExtractedDiscussionXBlock if settings.USE_EXTRACTED_DISCUSSION_BLOCK
else _BuiltInDiscussionXBlock
)
DiscussionXBlock.__name__ = "DiscussionXBlock"
3 changes: 2 additions & 1 deletion xmodule/html_block.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,6 @@ class HtmlBlockMixin( # lint-amnesty, pylint: disable=abstract-method
The HTML XBlock mixin.
This provides the base class for all Html-ish blocks (including the HTML XBlock).
"""
is_extracted = False

display_name = String(
display_name=_("Display Name"),
Expand Down Expand Up @@ -361,6 +360,7 @@ class _BuiltInHtmlBlock(HtmlBlockMixin): # lint-amnesty, pylint: disable=abstra
This is the actual HTML XBlock.
Nothing extra is required; this is just a wrapper to include edxnotes support.
"""
is_extracted = False


class AboutFields: # lint-amnesty, pylint: disable=missing-class-docstring
Expand Down Expand Up @@ -498,3 +498,4 @@ def safe_parse_date(date):
_ExtractedHtmlBlock if settings.USE_EXTRACTED_HTML_BLOCK
else _BuiltInHtmlBlock
)
HtmlBlock.__name__ = "HtmlBlock"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We need to ensure that the HTML subclasses (CourseInfoBlock, AboutBlock, and StaticTabBlock) are based on the extracted HTML block code rather than the built-in code, as they are now. This may require exposing a new HTMLMixin class from xblocks-contrib.

This can be done in a follow-up.

1 change: 1 addition & 0 deletions xmodule/lti_block.py
Original file line number Diff line number Diff line change
Expand Up @@ -990,3 +990,4 @@ def is_past_due(self):
_ExtractedLTIBlock if settings.USE_EXTRACTED_LTI_BLOCK
else _BuiltInLTIBlock
)
LTIBlock.__name__ = "LTIBlock"
1 change: 1 addition & 0 deletions xmodule/poll_block.py
Original file line number Diff line number Diff line change
Expand Up @@ -253,3 +253,4 @@ def add_child(xml_obj, answer): # lint-amnesty, pylint: disable=unused-argument
_ExtractedPollBlock if settings.USE_EXTRACTED_POLL_QUESTION_BLOCK
else _BuiltInPollBlock
)
PollBlock.__name__ = "PollBlock"
1 change: 1 addition & 0 deletions xmodule/video_block/video_block.py
Original file line number Diff line number Diff line change
Expand Up @@ -1267,3 +1267,4 @@ def _poster(self):
_ExtractedVideoBlock if settings.USE_EXTRACTED_VIDEO_BLOCK
else _BuiltInVideoBlock
)
VideoBlock.__name__ = "VideoBlock"
1 change: 1 addition & 0 deletions xmodule/word_cloud_block.py
Original file line number Diff line number Diff line change
Expand Up @@ -320,3 +320,4 @@ def index_dictionary(self):
_ExtractedWordCloudBlock if settings.USE_EXTRACTED_WORD_CLOUD_BLOCK
else _BuiltInWordCloudBlock
)
WordCloudBlock.__name__ = "WordCloudBlock"