Skip to content

Fix another regression caused by #609.#645

Merged
pstaabp merged 1 commit into
openwebwork:mainfrom
drgrice1:bug/another-609-regression
Feb 6, 2022
Merged

Fix another regression caused by #609.#645
pstaabp merged 1 commit into
openwebwork:mainfrom
drgrice1:bug/another-609-regression

Conversation

@drgrice1

Copy link
Copy Markdown
Member

If a problem sets the answer to be a formula with an assigment, (something like Formula("x = 5") then all answers are counted
incorrect and a warning is displayed that the evaluated answer is not an answer hash. This worked prior to #609. The cause of this was the removal of a line that should not have been removed that converts the other answer being compared to to a Formula if it is not already.

Note that the original issue that was attempted to be fixed by #609 still is fixed with this change.

This fixes issue #644 that I just submitted about this.

Attached are minimal working examples for the original issue as well as for this one.
FormulaAssignment.pg.txt
ParserAssignmentMWE.pg.txt
See issue #607 for details on how to test ParserAssignmentMWE.pg, and issue #644 for details on testing FormulaAssignment.pg.

Note that this is definitely a hotfix. This certainly brings in to question that #609 should have been a hotfix, considering that this is something that has been this way since 2008.

If a problem sets the answer to be a formula with an assigment,
(something like `Formula("x = 5")` then all answers are counted
incorrect and a warning is displayed that the evaluated answer is not an
answer hash.  This worked prior to openwebwork#609.  The cause of this was the
removal of a line that should not have been removed that converts the
other answer being compared to to a Formula if it is not already.

Note that the original issue that was attempted to be fixed by openwebwork#609
still is fixed with this change.

This fixes issue openwebwork#644 that I just submitted about this.
@somiaj

somiaj commented Feb 1, 2022

Copy link
Copy Markdown
Contributor

I can confirm this fix works. I just ran across a very similar issue where if the answer was Compute("y=5+2x") and the student entered in just y=5 as their answer it produced the error described in #644. The grader would would still accept the correct answer (and also not error out if any variable was used, like y=3t, but be marked incorrect).

@drgrice1

drgrice1 commented Feb 1, 2022

Copy link
Copy Markdown
Member Author

@somiaj: I can confirm the behavior you describe with the ParserAssignmentMWE.pg problem that I attached above. If you enter y=5 it gives the evaluated answer is not an answer hash. This pull request fixes that also.

@pstaabp pstaabp left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Having trouble getting my main branch running well, but the develop branch looks good and noticed that this does restore the line that was deleted.

@pstaabp pstaabp merged commit 1b0b5ec into openwebwork:main Feb 6, 2022
@drgrice1 drgrice1 deleted the bug/another-609-regression branch February 7, 2022 04:11
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.

4 participants