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

Equality comparisons and conversion factors suddenly grading wrong values as correct #8

Closed
limefrogyank opened this issue Oct 9, 2024 · 1 comment

Comments

@limefrogyank
Copy link
Collaborator

It was reported that an equality problem where the student was asked to write the equality for mg to g was not operating correctly.

If you put (below), it would grade it as correct.
1mg = 0.0001g

If you put (below), it would grade as incorrect
1g = 10000mg

I finally traced it to a new PG file (DigitsTolType.pg) that set the default 'tolType' to a new type called 'digital' and the actual 'tolerance' flag was set to '0.001'.

This means the InexactValue macro was assuming 'absolute' tolType (logic says not 'relative', so much be 'absolute'). Equalities are graded by dividing the two numbers and comparing to the correct ratio.

0.0001/1 = 0.0001 is within the tolerance of the correct answer: 0.001 +- 0.001

This new PG file is not to blame though. It just made my bug apparent. InexactValue has default tolerance = 0 and tolType set as relative. InexactValueWithUnits does not. I forgot it doesn't actually use InexactValue as a base class. I had to add the tolType and tolerance defaults to InexactValueWithUnits so this does not happen again.

@limefrogyank
Copy link
Collaborator Author

Fixed with e9adef8

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

1 participant