We are using an old problem from the problem library. It is
Rochester/setLimitsRates2Limits/ur_lr_2_11.pg
When students submitted their answers, they'll encounter a warning sign. With further investigation, I found that the second part of the answer (a string) won't show if I preview my answer even though the problem still accepts it. How can I fixed it?
Thanks,
Dave
--------------------------------------------------------------------------------------------------
Here is the warning sign:
The evaluated answer is not an answer hash HASH(0xbe8b7698): |HASH|.
WeBWorK Warnings
WeBWorK has encountered warnings while processing your request. If this occured when viewing a problem, it was likely caused by an error or ambiguity in that problem. Otherwise, it may indicate a problem with the WeBWorK system itself. If you are a student, report these warnings to your professor to have them corrected. If you are a professor, please consult the warning output below for more information.
Warning messages
HASH(0xbe8b7698) is not an answerHash in queue evaluator
HASH(0xbe8b7698) is not an answerHash in queue post_filter
I am also posting the code here in case anyone can not find the problem.
-----------------------------------------------------------------------------------------------
#DESCRIPTION
#KEYWORDS('limits', 'sequences', 'squeeze theorem')
# Find limits using the squeeze theorem
#ENDDESCRIPTION
##KEYWORDS('Calculus')
##Tagged by ynw2d
##DBsubject('Calculus')
##DBchapter('Limits and Derivatives')
##DBsection('Calculating Limits Using the Limit Laws')
DOCUMENT(); # This should be the first executable line in the problem.
loadMacros("PG.pl",
"PGbasicmacros.pl",
"PGchoicemacros.pl",
"PGanswermacros.pl",
"PGauxiliaryFunctions.pl");
$a = random(2,4,1);
$b = random(6,8,1);
$c = random(-6,-2,1);
# coefficients of quadratic x^2 + a1x + a2 passing through c at a
$a1 = $b-$a;
$a2 = -$a*$b+$c;
# coefficients of line b1x +b2 passing through c at a and tangent to quadratic above.
$b1 = $a + $b;
$b2 = -$a*($a +$b) + $c;
TEXT(beginproblem());
$showPartialCorrectAnswers=1;
BEGIN_TEXT
If \[ ${b1}x +$b2 \le f(x) \le x^2 + ${a1}x + $a2 \] determine
\(\displaystyle \lim_{x\to $a} f(x) \) = \{ans_rule(20) \}
$PAR
What theorem did you use to arrive at your answer? $BR
\{ ans_rule(50) \}
END_TEXT
$ans_eval = sub { my $in = shift;
$in = lc($in);
my $score;
if ( $in =~ /squeeze/ or $in =~ /pinch/ or $in =~/sandwich/) {
$score = 1;
} else {
$score = 0;
}
my $ans_hash = { score => $score,
correct_ans => "The Squeeze theorem",
student_ans => $in,
ans_message => ($score) ? '' : "Hint: Look thorugh the end of section 2.3",
};
$ans_hash;
};
ANS(num_cmp($c), $ans_eval);
ENDDOCUMENT(); # This should be the last executable line in the problem.
-----------------------------------------------------------------------------------------------------------------