From a9773e334539074ef587a0ab0bc5e03bb9340f47 Mon Sep 17 00:00:00 2001 From: rayzhou-bit Date: Thu, 3 Oct 2024 14:07:20 -0400 Subject: [PATCH] chore: calc version bump --- requirements/edx-sandbox/base.txt | 2 +- requirements/edx-sandbox/releases/quince.txt | 2 +- requirements/edx-sandbox/releases/redwood.txt | 2 +- requirements/edx/base.txt | 2 +- requirements/edx/development.txt | 2 +- requirements/edx/doc.txt | 2 +- requirements/edx/testing.txt | 2 +- xmodule/capa/tests/test_responsetypes.py | 14 ++++++++++++++ 8 files changed, 21 insertions(+), 7 deletions(-) diff --git a/requirements/edx-sandbox/base.txt b/requirements/edx-sandbox/base.txt index 1d94a4649a5f..bf0a4376da70 100644 --- a/requirements/edx-sandbox/base.txt +++ b/requirements/edx-sandbox/base.txt @@ -53,7 +53,7 @@ numpy==1.26.4 # matplotlib # openedx-calc # scipy -openedx-calc==3.1.0 +openedx-calc==3.1.2 # via -r requirements/edx-sandbox/base.in packaging==24.1 # via matplotlib diff --git a/requirements/edx-sandbox/releases/quince.txt b/requirements/edx-sandbox/releases/quince.txt index c8b5cff8816e..270a6b4f0a90 100644 --- a/requirements/edx-sandbox/releases/quince.txt +++ b/requirements/edx-sandbox/releases/quince.txt @@ -56,7 +56,7 @@ numpy==1.22.4 # matplotlib # openedx-calc # scipy -openedx-calc==3.1.0 +openedx-calc==3.1.2 # via -r requirements/edx-sandbox/base.in packaging==23.2 # via matplotlib diff --git a/requirements/edx-sandbox/releases/redwood.txt b/requirements/edx-sandbox/releases/redwood.txt index d12c994fd206..432985e40905 100644 --- a/requirements/edx-sandbox/releases/redwood.txt +++ b/requirements/edx-sandbox/releases/redwood.txt @@ -54,7 +54,7 @@ numpy==1.24.4 # matplotlib # openedx-calc # scipy -openedx-calc==3.1.0 +openedx-calc==3.1.2 # via -r requirements/edx-sandbox/base.in packaging==24.0 # via matplotlib diff --git a/requirements/edx/base.txt b/requirements/edx/base.txt index ad07106dda39..d9c1ca30e5c4 100644 --- a/requirements/edx/base.txt +++ b/requirements/edx/base.txt @@ -801,7 +801,7 @@ openai==0.28.1 # edx-enterprise openedx-atlas==0.6.2 # via -r requirements/edx/kernel.in -openedx-calc==3.1.0 +openedx-calc==3.1.2 # via -r requirements/edx/kernel.in openedx-django-pyfs==3.7.0 # via diff --git a/requirements/edx/development.txt b/requirements/edx/development.txt index 647bc64c466d..c12c616a9a5b 100644 --- a/requirements/edx/development.txt +++ b/requirements/edx/development.txt @@ -1340,7 +1340,7 @@ openedx-atlas==0.6.2 # via # -r requirements/edx/doc.txt # -r requirements/edx/testing.txt -openedx-calc==3.1.0 +openedx-calc==3.1.2 # via # -r requirements/edx/doc.txt # -r requirements/edx/testing.txt diff --git a/requirements/edx/doc.txt b/requirements/edx/doc.txt index bb761307f461..0fae967780b6 100644 --- a/requirements/edx/doc.txt +++ b/requirements/edx/doc.txt @@ -959,7 +959,7 @@ openai==0.28.1 # edx-enterprise openedx-atlas==0.6.2 # via -r requirements/edx/base.txt -openedx-calc==3.1.0 +openedx-calc==3.1.2 # via -r requirements/edx/base.txt openedx-django-pyfs==3.7.0 # via diff --git a/requirements/edx/testing.txt b/requirements/edx/testing.txt index ce4850b78292..bc080634e04d 100644 --- a/requirements/edx/testing.txt +++ b/requirements/edx/testing.txt @@ -1010,7 +1010,7 @@ openai==0.28.1 # edx-enterprise openedx-atlas==0.6.2 # via -r requirements/edx/base.txt -openedx-calc==3.1.0 +openedx-calc==3.1.2 # via -r requirements/edx/base.txt openedx-django-pyfs==3.7.0 # via diff --git a/xmodule/capa/tests/test_responsetypes.py b/xmodule/capa/tests/test_responsetypes.py index 37a6647ce7d0..e8df8894c78f 100644 --- a/xmodule/capa/tests/test_responsetypes.py +++ b/xmodule/capa/tests/test_responsetypes.py @@ -1538,6 +1538,20 @@ def test_floats(self): problem = self.build_problem(answer=given_answer) self.assert_multiple_grade(problem, correct_responses, incorrect_responses) + def test_percentage(self): + """ + Test percentage + """ + problem_setup = [ + # [given_answer, [list of correct responses], [list of incorrect responses]] + ["1%", ["1%", "1.0%", "1.00%", "0.01"], [""]], + ["2.0%", ["2%", "2.0%", "2.00%", "0.02"], [""]], + ["4.00%", ["4%", "4.0%", "4.00%", "0.04"], [""]], + ] + for given_answer, correct_responses, incorrect_responses in problem_setup: + problem = self.build_problem(answer=given_answer) + self.assert_multiple_grade(problem, correct_responses, incorrect_responses) + def test_grade_with_script(self): script_text = "computed_response = math.sqrt(4)" problem = self.build_problem(answer="$computed_response", script=script_text)