From 5f9f9cd40138f2efde2760dc67bfa71c84a609f8 Mon Sep 17 00:00:00 2001 From: Irtaza Akram Date: Thu, 28 Mar 2024 17:58:24 +0500 Subject: [PATCH] feat: add support for xblock 2.0 --- openassessment/__init__.py | 2 +- openassessment/xblock/openassessmentblock.py | 2 +- openassessment/xblock/test/base.py | 4 +--- openassessment/xblock/test/test_export_import.py | 4 ++-- requirements/base.txt | 4 ++-- requirements/constraints.txt | 3 +-- requirements/quality.txt | 6 +++--- requirements/test-acceptance.txt | 6 +++--- requirements/test.txt | 6 +++--- 9 files changed, 17 insertions(+), 20 deletions(-) diff --git a/openassessment/__init__.py b/openassessment/__init__.py index 8b5b87d35b..4f8c6213a6 100644 --- a/openassessment/__init__.py +++ b/openassessment/__init__.py @@ -2,4 +2,4 @@ Initialization Information for Open Assessment Module """ -__version__ = '6.5.1' +__version__ = '6.5.2' diff --git a/openassessment/xblock/openassessmentblock.py b/openassessment/xblock/openassessmentblock.py index 0d4d33b730..21d31ec1cf 100644 --- a/openassessment/xblock/openassessmentblock.py +++ b/openassessment/xblock/openassessmentblock.py @@ -895,7 +895,7 @@ def workbench_scenarios(): ] @classmethod - def parse_xml(cls, node, runtime, keys, id_generator): + def parse_xml(cls, node, runtime, keys): """Instantiate XBlock object from runtime XML definition. Inherited by XBlock core. diff --git a/openassessment/xblock/test/base.py b/openassessment/xblock/test/base.py index 393bba2281..43a23c325a 100644 --- a/openassessment/xblock/test/base.py +++ b/openassessment/xblock/test/base.py @@ -184,9 +184,7 @@ def load_scenario(self, xml_path): Returns: XBlock """ - block_id = self.runtime.parse_xml_string( - self.load_fixture_str(xml_path), self.runtime.id_generator - ) + block_id = self.runtime.parse_xml_string(self.load_fixture_str(xml_path)) return self.runtime.get_block(block_id) def request( diff --git a/openassessment/xblock/test/test_export_import.py b/openassessment/xblock/test/test_export_import.py index 2202474ae9..cd0df1c1aa 100644 --- a/openassessment/xblock/test/test_export_import.py +++ b/openassessment/xblock/test/test_export_import.py @@ -22,7 +22,7 @@ def test_export_import(self, xblock): self.runtime.export_to_xml(xblock, output_buffer) # Re-import the XBlock - block_id = self.runtime.parse_xml_string(output_buffer.getvalue(), self.runtime.id_generator) + block_id = self.runtime.parse_xml_string(output_buffer.getvalue()) new_block = self.runtime.get_block(block_id) # Check that the values of all fields are the same @@ -39,7 +39,7 @@ def test_teams_export_import(self, xblock): self.runtime.export_to_xml(xblock, output_buffer) # Re-import the XBlock - block_id = self.runtime.parse_xml_string(output_buffer.getvalue(), self.runtime.id_generator) + block_id = self.runtime.parse_xml_string(output_buffer.getvalue()) new_block = self.runtime.get_block(block_id) # Check that we've loaded exported team settings correctly diff --git a/requirements/base.txt b/requirements/base.txt index 6a2cbfeb4c..5841e7e3f6 100644 --- a/requirements/base.txt +++ b/requirements/base.txt @@ -101,7 +101,7 @@ loremipsum==1.0.5 # via # -c requirements/constraints.txt # -r requirements/base.in -lxml==5.1.0 +lxml==4.9.4 # via # -r requirements/base.in # edx-i18n-tools @@ -200,7 +200,7 @@ webencodings==0.5.1 # html5lib webob==1.8.7 # via xblock -xblock==1.10.0 +xblock==2.0.0 # via -r requirements/base.in # The following packages are considered to be unsafe in a requirements file: diff --git a/requirements/constraints.txt b/requirements/constraints.txt index 023cc46862..31196a912a 100644 --- a/requirements/constraints.txt +++ b/requirements/constraints.txt @@ -32,5 +32,4 @@ setuptools<60.0 # incremental upgrade plan. django-simple-history<=3.1.1 -# xblock==1.10.0 upgrade causes test failures which need to be fixed separately -xblock==1.10.0 +lxml<5.0.0 # xblock-sdk diff --git a/requirements/quality.txt b/requirements/quality.txt index 2883df5e9c..fe730a6f51 100644 --- a/requirements/quality.txt +++ b/requirements/quality.txt @@ -333,7 +333,7 @@ loremipsum==1.0.5 # via # -c requirements/constraints.txt # -r requirements/test.txt -lxml==5.1.0 +lxml==4.9.4 # via # -r requirements/test.txt # edx-i18n-tools @@ -705,11 +705,11 @@ wrapt==1.11.2 # -c requirements/constraints.txt # -r requirements/test.txt # aws-xray-sdk -xblock==1.10.0 +xblock==2.0.0 # via # -r requirements/test.txt # xblock-sdk -xblock-sdk==0.7.0 +xblock-sdk==0.9.0 # via -r requirements/test.txt xmltodict==0.13.0 # via diff --git a/requirements/test-acceptance.txt b/requirements/test-acceptance.txt index 38451d7259..894bdf4f76 100644 --- a/requirements/test-acceptance.txt +++ b/requirements/test-acceptance.txt @@ -319,7 +319,7 @@ loremipsum==1.0.5 # via # -c requirements/constraints.txt # -r requirements/test.txt -lxml==5.1.0 +lxml==4.9.4 # via # -r requirements/test.txt # edx-i18n-tools @@ -669,11 +669,11 @@ wrapt==1.11.2 # -c requirements/constraints.txt # -r requirements/test.txt # aws-xray-sdk -xblock==1.10.0 +xblock==2.0.0 # via # -r requirements/test.txt # xblock-sdk -xblock-sdk==0.7.0 +xblock-sdk==0.9.0 # via -r requirements/test.txt xmltodict==0.13.0 # via diff --git a/requirements/test.txt b/requirements/test.txt index 9c36c1877e..e4579086c9 100644 --- a/requirements/test.txt +++ b/requirements/test.txt @@ -249,7 +249,7 @@ loremipsum==1.0.5 # via # -c requirements/constraints.txt # -r requirements/base.txt -lxml==5.1.0 +lxml==4.9.4 # via # -r requirements/base.txt # edx-i18n-tools @@ -541,11 +541,11 @@ wrapt==1.11.2 # via # -c requirements/constraints.txt # aws-xray-sdk -xblock==1.10.0 +xblock==2.0.0 # via # -r requirements/base.txt # xblock-sdk -xblock-sdk==0.7.0 +xblock-sdk==0.9.0 # via -r requirements/test.in xmltodict==0.13.0 # via moto