Skip to content

Commit 24cb3cf

Browse files
ttqureshifarhan
andauthored
refactor: enable the Extracted Annotatable, Poll XBlocks
Enabled the Extracted Annotatable, Poll XBlocks --------- Co-authored-by: farhan <farhan.khan@arbisoft.com>
1 parent 610e2ab commit 24cb3cf

7 files changed

Lines changed: 12 additions & 44 deletions

File tree

‎openedx/envs/common.py‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1676,7 +1676,7 @@ def _make_locale_paths(settings):
16761676
# .. toggle_warning: Not production-ready until https://github.com/openedx/edx-platform/issues/34841 is done.
16771677
# .. toggle_creation_date: 2024-11-10
16781678
# .. toggle_target_removal_date: 2025-06-01
1679-
USE_EXTRACTED_ANNOTATABLE_BLOCK = False
1679+
USE_EXTRACTED_ANNOTATABLE_BLOCK = True
16801680

16811681
# .. toggle_name: USE_EXTRACTED_POLL_QUESTION_BLOCK
16821682
# .. toggle_default: False
@@ -1686,7 +1686,7 @@ def _make_locale_paths(settings):
16861686
# .. toggle_warning: Not production-ready until https://github.com/openedx/edx-platform/issues/34839 is done.
16871687
# .. toggle_creation_date: 2024-11-10
16881688
# .. toggle_target_removal_date: 2025-06-01
1689-
USE_EXTRACTED_POLL_QUESTION_BLOCK = False
1689+
USE_EXTRACTED_POLL_QUESTION_BLOCK = True
16901690

16911691
# .. toggle_name: USE_EXTRACTED_LTI_BLOCK
16921692
# .. toggle_default: False

‎requirements/constraints.txt‎

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,3 @@ django-debug-toolbar<6.0.0
136136
# Issue: https://github.com/openedx/edx-platform/issues/37435
137137
cryptography<46.0.0
138138
pact-python<3.0.0
139-
140-
# This pin will be removed once the following PR is merged
141-
# https://github.com/openedx/xblocks-contrib/pull/120
142-
xblocks-contrib<0.9.0

‎requirements/edx/base.txt‎

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1277,10 +1277,8 @@ xblock-utils==4.0.0
12771277
# via
12781278
# edx-sga
12791279
# xblock-poll
1280-
xblocks-contrib==0.8.1
1281-
# via
1282-
# -c requirements/constraints.txt
1283-
# -r requirements/edx/bundled.in
1280+
xblocks-contrib==0.9.0
1281+
# via -r requirements/edx/bundled.in
12841282
xmlsec==1.3.14
12851283
# via
12861284
# -c requirements/constraints.txt

‎requirements/edx/development.txt‎

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2308,9 +2308,8 @@ xblock-utils==4.0.0
23082308
# -r requirements/edx/testing.txt
23092309
# edx-sga
23102310
# xblock-poll
2311-
xblocks-contrib==0.8.1
2311+
xblocks-contrib==0.9.0
23122312
# via
2313-
# -c requirements/constraints.txt
23142313
# -r requirements/edx/doc.txt
23152314
# -r requirements/edx/testing.txt
23162315
xmlsec==1.3.14

‎requirements/edx/doc.txt‎

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1615,10 +1615,8 @@ xblock-utils==4.0.0
16151615
# -r requirements/edx/base.txt
16161616
# edx-sga
16171617
# xblock-poll
1618-
xblocks-contrib==0.8.1
1619-
# via
1620-
# -c requirements/constraints.txt
1621-
# -r requirements/edx/base.txt
1618+
xblocks-contrib==0.9.0
1619+
# via -r requirements/edx/base.txt
16221620
xmlsec==1.3.14
16231621
# via
16241622
# -c requirements/constraints.txt

‎requirements/edx/testing.txt‎

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1708,10 +1708,8 @@ xblock-utils==4.0.0
17081708
# -r requirements/edx/base.txt
17091709
# edx-sga
17101710
# xblock-poll
1711-
xblocks-contrib==0.8.1
1712-
# via
1713-
# -c requirements/constraints.txt
1714-
# -r requirements/edx/base.txt
1711+
xblocks-contrib==0.9.0
1712+
# via -r requirements/edx/base.txt
17151713
xmlsec==1.3.14
17161714
# via
17171715
# -c requirements/constraints.txt

‎xmodule/tests/test_word_cloud.py‎

Lines changed: 3 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
"""Test for Word Cloud Block functional logic."""
22
import json
3-
import os
43
from unittest.mock import Mock
54

65
from django.conf import settings
@@ -68,33 +67,13 @@ def test_xml_import_export_cycle(self):
6867
assert block.num_inputs == 3
6968
assert block.num_top_words == 100
7069

71-
if settings.USE_EXTRACTED_WORD_CLOUD_BLOCK:
72-
# For extracted XBlocks, we need to manually export the XML definition to a file to properly test the
73-
# import/export cycle. This is because extracted XBlocks use XBlock core's `add_xml_to_node` method,
74-
# which does not export the XML to a file like `XmlMixin.add_xml_to_node` does.
75-
filepath = 'word_cloud/block_id.xml'
76-
runtime.export_fs.makedirs(os.path.dirname(filepath), recreate=True)
77-
with runtime.export_fs.open(filepath, 'wb') as fileObj:
78-
runtime.export_to_xml(block, fileObj)
79-
else:
80-
node = etree.Element("unknown_root")
81-
# This will export the olx to a separate file.
82-
block.add_xml_to_node(node)
70+
node = etree.Element("unknown_root")
71+
# This will export the olx to a separate file.
72+
block.add_xml_to_node(node)
8373

8474
with runtime.export_fs.open('word_cloud/block_id.xml') as f:
8575
exported_xml = f.read()
8676

87-
if settings.USE_EXTRACTED_WORD_CLOUD_BLOCK:
88-
# For extracted XBlocks, we need to remove the `xblock-family` attribute from the exported XML to ensure
89-
# consistency with the original XML.
90-
# This is because extracted XBlocks use the core XBlock's `add_xml_to_node` method, which includes this
91-
# attribute, whereas `XmlMixin.add_xml_to_node` does not.
92-
exported_xml_tree = etree.fromstring(exported_xml.encode('utf-8'))
93-
etree.cleanup_namespaces(exported_xml_tree)
94-
if 'xblock-family' in exported_xml_tree.attrib:
95-
del exported_xml_tree.attrib['xblock-family']
96-
exported_xml = etree.tostring(exported_xml_tree, encoding='unicode', pretty_print=True)
97-
9877
assert exported_xml == original_xml
9978

10079
def test_bad_ajax_request(self):

0 commit comments

Comments
 (0)