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

Override cmp_postprocess for PolynomialFactors #395

Merged
merged 1 commit into from Feb 24, 2019

Conversation

dpvc
Copy link
Member

@dpvc dpvc commented Feb 9, 2019

Don't do the cmp_postprocess() function for PolynomialFactors, since it tries to reduce the student answer, which can cause unwanted errors when singleFactors is set.

To test, use

loadMacros("contextPolynomialFactors.pl");
Context("PolynomialFactors")->flags->set(singleFactors => 1);
$f = Compute("-(x+1)(x-1)");
TEXT($f->cmp->evaluate("-(x+6)(x+2)")->{ans_message} || 'No Error');

Without the patch, you should get Only one factor or constant can be negated

With the patch, you should get No Error.

This comes originally from this forum post.

…reduce the student answer, which can cause unwanted errors when singleFactors is set).
@mgage mgage self-assigned this Feb 24, 2019
@mgage mgage moved this from In progress to Ready to merge in Bugfixes/new features - for next release Feb 24, 2019
@mgage mgage added the MathObject issue Issue involving MathObects code label Feb 24, 2019
@mgage
Copy link
Sponsor Member

mgage commented Feb 24, 2019

works

@mgage mgage merged commit f2689ac into openwebwork:develop Feb 24, 2019
Bugfixes/new features - for next release automation moved this from Ready to merge to Done Feb 24, 2019
@dpvc dpvc deleted the fix-polynomialfactors branch May 19, 2020 13:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
MathObject issue Issue involving MathObects code
Development

Successfully merging this pull request may close these issues.

None yet

2 participants