Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: calc version bump #35590

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Conversation

rayzhou-bit
Copy link
Contributor

Description

Numerical input problem blocks were not able to process integer percentage numbers correctly which impacted learners and authors.
For example, "1.0%" worked as an answer while "1%" did not.
This was due to an issue in openedx-calc that has been fixed. This PR bumps the versioning for openedx-calc as well as adds unit testing for percentage answers.

Supporting information

openedx-calc code change:
openedx/openedx-calc@ea0602f

Testing instructions

Without this PR:

  1. Create a problem block for numerical input.
  2. Set the answer to 1%.
  3. On the unit page, try answering the problem with an incorrect answer. You will see the error There was a problem with the staff answer to this problem.
  4. On the unit page, try answering with '1%'. You will see the error Could not interpret '1%' as a number.

Repeat these steps with the PR. You should not see either of the 2 errors above.

Deadline

None

Other information

https://2u-internal.atlassian.net/browse/TNL-11586

Copy link
Member

@jesperhodge jesperhodge left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I found a problem with tolerance when using percentage.

Expected behavior:

  • set correct answer to "8"
  • if you set tolerance to 0, "7" should be wrong
  • "8%" should be wrong
  • if you set tolerance to 5, "7" should be correct, "8%" and "7%" should be wrong
  • vice versa: set correct answer to a percentage, test with supplying actual number, tolerance should be calculated correctly
    Actual behavior:
  • set correct answer to "8"
  • answer with "5%"
  • the answer is considered correct but should actually be incorrect

Please make sure to test these things and other edge cases, for example setting a number to decimals.
I tested the same thing with 8 and tolerance 5 and putting in a "6.0%" answer on master, that correctly evaluates to an incorrect answer. So the problem should be somehow related to your change.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants