Skip to content

Commit

Permalink
chore: calc version bump (#35590)
Browse files Browse the repository at this point in the history
  • Loading branch information
rayzhou-bit authored Oct 7, 2024
1 parent 3d637eb commit 22b8116
Show file tree
Hide file tree
Showing 8 changed files with 21 additions and 7 deletions.
2 changes: 1 addition & 1 deletion requirements/edx-sandbox/base.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion requirements/edx-sandbox/releases/quince.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion requirements/edx-sandbox/releases/redwood.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion requirements/edx/base.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion requirements/edx/development.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion requirements/edx/doc.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion requirements/edx/testing.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
14 changes: 14 additions & 0 deletions xmodule/capa/tests/test_responsetypes.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 22b8116

Please sign in to comment.