Skip to content

Commit

Permalink
chore: Chagnes in word cloud block
Browse files Browse the repository at this point in the history
  • Loading branch information
farhan committed Nov 7, 2024
1 parent 8ec9686 commit 6c91c56
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion xmodule/word_cloud_block.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
from xblock.fields import Boolean, Dict, Integer, List, Scope, String
from xmodule.editing_block import EditingMixin
from xmodule.raw_block import EmptyDataRawMixin
from xmodule.toggles import USE_EXTRACTED_WORD_CLOUD_BLOCK
from xmodule.util.builtin_assets import add_webpack_js_to_fragment, add_css_to_fragment
from xmodule.xml_block import XmlMixin
from xmodule.x_module import (
Expand All @@ -23,6 +24,7 @@
XModuleMixin,
XModuleToXBlockMixin,
)
from xblocks_contrib.word_cloud import WordCloudBlock as _ExtractedWordCloudBlock
log = logging.getLogger(__name__)

# Make '_' a no-op so we can scrape strings. Using lambda instead of
Expand All @@ -41,7 +43,7 @@ def pretty_bool(value):


@XBlock.needs('mako')
class WordCloudBlock( # pylint: disable=abstract-method
class _BuiltInWordCloudBlock( # pylint: disable=abstract-method
EmptyDataRawMixin,
XmlMixin,
EditingMixin,
Expand All @@ -53,6 +55,8 @@ class WordCloudBlock( # pylint: disable=abstract-method
Word Cloud XBlock.
"""

is_extracted = False

display_name = String(
display_name=_("Display Name"),
help=_("The display name for this component."),
Expand Down Expand Up @@ -308,3 +312,9 @@ def index_dictionary(self):
xblock_body["content_type"] = "Word Cloud"

return xblock_body


WordCloudBlock = (
_ExtractedWordCloudBlock if USE_EXTRACTED_WORD_CLOUD_BLOCK.is_enabled()
else _BuiltInWordCloudBlock
)

0 comments on commit 6c91c56

Please sign in to comment.