## WeBWorK Problems

### Webwork Warning when using HINT

by Stefania Tracogna -
Number of replies: 5

We just installed a new version of webwork this summer. Whenever a problem contains a HINT a pink screen appears with the following webwork warning.

### Warning messages

• Use of uninitialized value in numeric le (<=) at /opt/webwork/webwork2/lib/WeBWorK/ContentGenerator/Problem.pm line 637.

The coding for the HINT is the following:

$showHint=1; HINT(EV2(<<EOH)); This is the hint. EOH The problems work fine on another server (with an older version of webwork).The file PGbasicmacros.pl is the same on the two servers. The pink screen disappears after an answer is checked or if the lines with HINT are commented out. Any help would be appreciated. Stefania In reply to Stefania Tracogna ### Re: Webwork Warning when using HINT by Gavin LaRose - Hi Stefania, Is it correct to assume that you're running WeBWorK 2.4-patches as your new version? Looking at the code, it appears that this is probably an error with some problems not having a fully initialized environment. The line in question (637 in Problem.pm) is (if the line numberinf is right) in the if_errors() subroutine,  sub if_errors($$) { my ($self, $arg) = @_; if ($self->{isOpen}) {
return $self->{pg}->{flags}->{error_flag} ?$arg : !$arg; } else { return !$arg;
}
} 

I'm not seeing where the numeric comparison is showing up there, unless the test of $self->{flags}->{error_flag} is implicitly a numeric test. (That line is line 637.) I'm hoping that this will inspire someone else with somewhat better knowledge of the PG flags to add to this thread. :) Gavin In reply to Gavin LaRose ### Re: Webwork Warning when using HINT by Stefania Tracogna - Hi Gaving, actually it seems we are using webwork 2.3.2. This is what line 637 in Problem. pm sasy: line 637 in Problem.pm$can{showHints} &&= $pg->{flags}->{hintExists} &&=$pg->{flags}->{showHintLimit}<=$pg->{state}->{num_of_incorrect_ans};$can{showSolutions} &&= $pg->{flags}->{solutionExists}; I hope this will help figuring out what is wrong. Thanks, Stefania In reply to Stefania Tracogna ### Re: Webwork Warning when using HINT by Davide Cervone - I am not able to reproduce the problem. I tried it on a 2.3.1 installation (I didn't have time to set up 2.3.2 installation), as well as 2.4.5, and don't get the error in either case. Do the problems you are trying out install a grader (using install_problem_grader)? What is$pg{options}{grader} set to in your global.conf?

Could you post a reference to a specific problem so I can try that one out?

Stefania