Skip to content

Commit 2c65ca4

Browse files
committed
fix: feat: remove legacy attrs from extracted annotatable, html & problem block
1 parent e3ab634 commit 2c65ca4

8 files changed

Lines changed: 11 additions & 9 deletions

File tree

openedx/envs/common.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2101,7 +2101,7 @@ def add_optional_apps(optional_apps, installed_apps):
21012101
# .. toggle_warning: Not production-ready until relevant subtask https://github.com/openedx/edx-platform/issues/34827 is done.
21022102
# .. toggle_creation_date: 2024-11-10
21032103
# .. toggle_target_removal_date: 2026-04-10
2104-
USE_EXTRACTED_PROBLEM_BLOCK = False
2104+
USE_EXTRACTED_PROBLEM_BLOCK = True
21052105

21062106
# .. toggle_name: USE_EXTRACTED_VIDEO_BLOCK
21072107
# .. toggle_default: True

requirements/edx/base.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1299,7 +1299,7 @@ xblock-utils==4.0.0
12991299
# via
13001300
# edx-sga
13011301
# xblock-poll
1302-
xblocks-contrib==0.15.2
1302+
git+https://github.com/openedx/xblocks-contrib.git@remove-legacy-attrs-annotatable-html-problem#egg=xblocks-contrib
13031303
# via -r requirements/edx/bundled.in
13041304
xmlsec==1.3.14
13051305
# via

requirements/edx/development.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2326,7 +2326,7 @@ xblock-utils==4.0.0
23262326
# -r requirements/edx/testing.txt
23272327
# edx-sga
23282328
# xblock-poll
2329-
xblocks-contrib==0.15.2
2329+
git+https://github.com/openedx/xblocks-contrib.git@remove-legacy-attrs-annotatable-html-problem#egg=xblocks-contrib
23302330
# via
23312331
# -r requirements/edx/doc.txt
23322332
# -r requirements/edx/testing.txt

requirements/edx/doc.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1637,7 +1637,7 @@ xblock-utils==4.0.0
16371637
# -r requirements/edx/base.txt
16381638
# edx-sga
16391639
# xblock-poll
1640-
xblocks-contrib==0.15.2
1640+
git+https://github.com/openedx/xblocks-contrib.git@remove-legacy-attrs-annotatable-html-problem#egg=xblocks-contrib
16411641
# via -r requirements/edx/base.txt
16421642
xmlsec==1.3.14
16431643
# via

requirements/edx/testing.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1732,7 +1732,7 @@ xblock-utils==4.0.0
17321732
# -r requirements/edx/base.txt
17331733
# edx-sga
17341734
# xblock-poll
1735-
xblocks-contrib==0.15.2
1735+
git+https://github.com/openedx/xblocks-contrib.git@remove-legacy-attrs-annotatable-html-problem#egg=xblocks-contrib
17361736
# via -r requirements/edx/base.txt
17371737
xmlsec==1.3.14
17381738
# via

xmodule/conditional_block.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -222,9 +222,9 @@ def student_view(self, _context):
222222
return fragment
223223

224224
def get_html(self):
225-
required_html_ids = [block.location.html_id() for block in self.get_required_blocks]
225+
required_html_ids = [block.usage_key.html_id() for block in self.get_required_blocks]
226226
return self.runtime.service(self, 'mako').render_lms_template('conditional_ajax.html', {
227-
'element_id': self.location.html_id(),
227+
'element_id': self.usage_key.html_id(),
228228
'ajax_url': self.ajax_url,
229229
'depends': ';'.join(required_html_ids)
230230
})

xmodule/lti_block.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -595,7 +595,7 @@ def get_resource_link_id(self):
595595
i4x-2-3-lti-31de800015cf4afb973356dbe81496df this part of resource_link_id:
596596
makes resource_link_id to be unique among courses inside same system.
597597
"""
598-
return str(parse.quote(f"{settings.LMS_BASE}-{self.location.html_id()}"))
598+
return str(parse.quote(f"{settings.LMS_BASE}-{self.usage_key.html_id()}"))
599599

600600
def get_lis_result_sourcedid(self):
601601
"""

xmodule/tests/test_conditional.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,7 @@ def create(system, source_is_error_block=False, source_visible_to_staff_only=Fal
8484
else:
8585
source_block = Mock(name='source_block')
8686
source_block.location = source_location
87+
source_block.usage_key = source_location
8788

8889
source_block.visible_to_staff_only = source_visible_to_staff_only
8990
source_block.runtime = system
@@ -97,6 +98,7 @@ def create(system, source_is_error_block=False, source_visible_to_staff_only=Fal
9798
child_block.runtime = system
9899
child_block.render = lambda view, context=None: system.render(child_block, view, context)
99100
child_block.location = source_location.replace(category='html', name='child')
101+
child_block.usage_key = child_block.location
100102

101103
def visible_to_nonstaff_users(desc):
102104
"""
@@ -121,7 +123,7 @@ def load_item(usage_id, for_parent=None): # pylint: disable=unused-argument
121123
'conditional_attr': 'attempted',
122124
'conditional_value': 'true',
123125
'xml_attributes': {'attempted': 'true'},
124-
'children': [child_block.location],
126+
'children': [child_block.usage_key],
125127
})
126128

127129
cond_block = ConditionalBlock(

0 commit comments

Comments
 (0)