Consider the problem below.
With test_points in effect (i.e, that line uncommented, and the
line specifying limits commented) if a student enters a list of
expressions they get the response shown below the problem,
which suggests to them that there is an error in the system or
in the problem. (An answer that consists of a single expression
is graded as I would expect - correct if the expression is correct
and incorrect otherwise.) Also, the answer table is blank, apart
from the Result box (incorrect).
With limits in effect (i.e., that line uncommented, and the line
specifying test_points commented) answers that are single
expressions or lists of expressions are graded as I would expect
(correct if the answer is a single expression that is correct and
incorrect otherwise).
We are running PG 2.4.7 with some patches (which exactly
I don't know; I do know that AnswerChecker.pm is in sync
with -HEAD, because I wondered about that and asked the
sysadmin to update it).
I have done this with and without square brackets around the entries
of test_points (initially with, in accord with UsingMathObjects.pod).
The error message is the same in each case.
Thanks in advance for any information about this
behaviour.
-wb
Follows the problem.
DOCUMENT();
loadMacros(
'PGstandard.pl',
'MathObjects.pl'
);
$a = random(2,9);
$aa = $a**2;
$f = Formula("cos(arcsin($a/x))");
Context()->functions->disable('Trig');
$fsimp = Formula("sqrt(x^2 - $aa)/abs(x)");
$fsimp->{test_points} = [[-$a-2], [-$a-1], [-$a], [$a], [$a+1], [$a+2]];
#$fsimp->{limits} = [-2*$a, -$a];
TEXT(beginproblem());
Context()->texStrings;
BEGIN_TEXT
Simplify the following expression:
\( $f = \) \{ ans_rule(25) \}
END_TEXT
Context()->normalStrings;
ANS($fsimp->cmp);
ENDDOCUMENT();
Follows the output if, e.g., a student enters
sqrt(x^2-$aa)/x, -sqrt(x^2-$aa)/x
(with the generated value of $aa) as an answer
when test_points is specified.
Error in Translator.pm::process_answers: Answer AnSwEr1: |sqrt(x^2-49)/x, -sqrt(x^2-49)/x|
Can't generate enough valid points for comparison at line 562 of [PG]/lib/AnswerHash.pm
Died within AnswerEvaluator::evaluate called at line 1 of (eval 1844)Error in Translator.pm::process_answers: Answer AnSwEr1:
Answer evaluators must return a hash or an AnswerHash type, not type || at /dat/webwork/pg/lib/WeBWorK/PG/Translator.pm line 1174
Use of uninitialized value $answerScore in numeric ge (>=) at /dat/webwork/webwork2/lib/WeBWorK/ContentGenerator/Problem.pm line 249.
Use of uninitialized value $studentAnswer in pattern match (m//) at /dat/webwork/webwork2/lib/WeBWorK/ContentGenerator/Problem.pm line 250.
Use of uninitialized value $answerScore in numeric ge (>=) at /dat/webwork/webwork2/lib/WeBWorK/ContentGenerator/Problem.pm line 250.
Use of uninitialized value $answerScore in numeric ge (>=) at /dat/webwork/webwork2/lib/WeBWorK/ContentGenerator/Problem.pm line 251.
Use of uninitialized value $answerScore in numeric gt (>) at /dat/webwork/webwork2/lib/WeBWorK/ContentGenerator/Problem.pm line 251.
Use of uninitialized value $answerScore in numeric gt (>) at /dat/webwork/webwork2/lib/WeBWorK/ContentGenerator/Problem.pm line 254.