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

Issue with mathematical expression questions #1012

Closed
ugonj opened this issue May 23, 2023 · 1 comment
Closed

Issue with mathematical expression questions #1012

ugonj opened this issue May 23, 2023 · 1 comment

Comments

@ugonj
Copy link

ugonj commented May 23, 2023

Certain mathematical expression questions fail correct answers. For example, a simple question asking for $(-6)^n$ fails that answer. See here.

To reproduce:

  1. create a new question, with a new part, "Mathematical Expression".
  2. In correct answer, enter "(-6)^n".
  3. Run the question and enter (-6)^n in the box then submit.

Note that the "Testing" tab gives a few failures in the marking algorithm that might give a hint: either the algorithm is looking for a rhs component that doesn't exist, or for a ruleTree function/component that doesn't exist.

@christianp christianp transferred this issue from numbas/editor May 24, 2023
@christianp
Copy link
Member

Thanks for reporting this. It turned out there was a bug in the logic for exponentiating a decimal value, which is used when you take an integer to a non-integer power.

christianp added a commit that referenced this issue Jun 8, 2023
The exponentiation operation for ComplexDecimals was incorrect for
integer powers - I'd only checked it for the square root.

This commit adds a range of unit tests checking that `decimal` and
`number` versions of the same exponentiation return the same result.

see #1012
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

No branches or pull requests

2 participants