## WeBWorK Problems

### error with LimitedPolynomial?

by Richard Lynch -
Number of replies: 1
Hi Everyone. When we updated our system to the  new version of Webwork, a bunch of problems using the limited polynomial context started to produce errors. In particular, it gave the error "Can't locate object method 'weaken' via package 'LimitedPolynomial::UOP::minus'..." The code that uses the context is below. It is giving an error at the line in which Formula is called. Again, these all worked fine before, and the code doesn't appear to be incorrect, which is why I think it may be an issue with the context itself. Any ideas? Thank you!

###########################################################################
# setup contexts and variables
###########################################################################
Context("LimitedPolynomial-Strict");
$var = list_random('x','y','z','t','p','q','u','v'); Context()->variables->are(lc($var)=>"Real", uc($var)=>"Real"); do {($a2,$a1,$a0) = (non_zero_random(-7,7), non_zero_random(-7,7), non_zero_random(-7,7))} until (abs($a1) != abs($a2));
do {($b2,$b1,$b0) = (non_zero_random(-7,7), non_zero_random(-7,7), non_zero_random(-7,7))} until (abs($b2) != abs($a2) || abs($b1) != abs($a1));$poly1 = nicestring([$a2,$a1,$a0], ["$var^2","$var",""]);$poly2 = nicestring([$b2,$b1,$b0], ["$var^2","$var",""]);$expn = "($poly1) + ($poly2)";

$poly = nicestring([$a2+$b2,$a1+$b1,$a0+$b0], ["$var^2","$var",""]);$answer = Formula($poly)->reduce; ########################################################################### # state the problem ########################################################################### Context()->texStrings; BEGIN_TEXT Perform the operation$PAR$expn$ $PAR and combine line terms. Simplify your answer as much as possible.$PAR