Danny, here is the code to one of the problems that gives the warning. All of the rest are pretty similar.
###########################
# Initialization
DOCUMENT();
loadMacros(
"PGstandard.pl",
"MathObjects.pl",
"PGunion.pl",
"parserMultiAnswer.pl",
"PGcourse.pl",
"AnswerFormatHelp.pl"
);
TEXT(beginproblem());
##########################
# Setup
Context("Numeric");
Context()->variables->are(x=>"Real");
Context()->{error}{msg}{"Operands of '*' can't be words"} = " ";
$a = random(1,6,1);
$b = random(1,5,1);
$bb = $b*$b;
$apb = $a + $b;
$fraction = "\frac{-$a}{x^2-$bb} + \frac{1}{x+$b} ";
$num = Formula("x-$apb");
$den = Formula("x^2-$bb");
$multians = MultiAnswer($num, $den)->with(
singleResult => 1,
allowBlankAnswers => 1,
format => "(%s)/(%s)",
tex_format => "\frac{%s}{%s}",
checker => sub {
my ( $correct, $student, $self, $ansHash ) = @_;
my ( $f1stu, $f2stu ) = @{$student};
my ( $f1, $f2 ) = @{$correct};
Context("Numeric");
$correct = Compute("$f1/$f2");
$ansHash->{correct_ans} = $correct->string;
$ansHash->{correct_ans_latex_string} = $correct->TeX;
return [0,0] if $f1stu eq "" || $f2stu eq "";
$self->{format} = Compute("$f1stu/$f2stu")->string;
if ( ( $f1==$f1stu && $f2==$f2stu) ||
(-$f1==$f1stu && -$f2==$f2stu) ) {
return [1,1];
} elsif ( $f1==$f1stu || -$f1==$f1stu) {
return [0,0];
} elsif ( $f2==$f2stu || -$f2==$f2stu ) {
return [0,0];
} elsif ((Compute("$f1*$f2stu") == Compute("$f1stu*$f2")) ) {
$self->context->setError("Your answer should be further simplified");
return; # don't return values here (so message will show)
} else {
return [0,0];
}
}
);
#
# Display the fraction and answer blanks nicely
#
Context()->texStrings;
if ($displayMode eq 'TeX') {
$showfraction =
"\[ $fraction = ".$multians->ans_rule(10).$multians->ans_rule(10)." \]";
} else {
$showfraction =
ColumnTable(
"\( \displaystyle $fraction = \)",
$multians->ans_rule(20).$BR.$HR.$multians->ans_rule(20),
indent => 0, separation => 10, valign => "MIDDLE"
);
}
Context()->normalStrings;
#################################
# Main text
Context()->texStrings;
BEGIN_TEXT
Perform the indicated operations.
Express your answer as a fraction.
$BR
$BR
$BCENTER
$showfraction
$ECENTER
$BR
$BR
$BITALIC
Note: Your answer must be written as a reduced fraction. Enter the numerator in the top answer blank, and the denominator in the bottom answer blank, using '1' for the denominator if appropriate.
\{AnswerFormatHelp("formulas","Help Entering Formulas")\}
$EITALIC
END_TEXT
$showHint = 3;
Context()->texStrings;
BEGIN_HINT
If you need help adding or subtracting rational expressions, $BR
1) Ask your instructor or staff in the Math Study Center for help! $BR
2) Visit this webpage: \{ htmlLink( "http://www.purplemath.com/modules/rtnladd2.htm", "Adding or Subtracting Rational Expressions","TARGET='_blank'" ) \} $BR
END_HINT
Context()->normalStrings;
#################################
# Answer evaluation
$showPartialCorrectAnswers = 1;
install_problem_grader(~~&std_problem_grader);
ANS( $multians->cmp() );
ENDDOCUMENT();