WeBWorK Problems

Use of uninitialized value $credit - sharing an issue I ran into and worked around

Use of uninitialized value $credit - sharing an issue I ran into and worked around

by Nathan Wallach -
Number of replies: 0

I ran into issue where rendering a problem on my production server reported

    Use of uninitialized value $credit{"AnSwEr0001"} in numeric eq (==) at (eval 1454) line 288.

    Use of uninitialized value $credit{"AnSwEr0001"} in multiplication (*) at (eval 1454) line 304.

when the problem was rendered. This is a problem using weightedGrader.pl and parserMultiAnswer.pl.

I had set

    $ans1 = Compute("ln(x)");

    $ans1->{test_at} = [[0,-1],[0,1],[0,3],[0,7]]; 

    $ans1->{checkUndefinedPoints} = 1;

in the problem, and then $ans1 was part of a MultiAnswer

    $multians1 = MultiAnswer($ans1, $ans2)->with(

        ...

which is graded by 

    WEIGHTED_ANS( $multians1->cmp(), 60 );

Commenting out the line 

    $ans1->{checkUndefinedPoints} = 1;

solved the problem.

However, I ran into the issue only on my production server which is running a prerelease version of WW 2.15 but not when the same problem was rendered using a current devel version. I'm really not certain what different between the versions of the code running on the 2 systems made the difference between the issue occurring and not occurring.