WeBWorK Main Forum

After updating pg, problems have warning messages

After updating pg, problems have warning messages

by Robin Cruz -
Number of replies: 6

I updated our pg folder this week and now some of the files we have been using for a while have pink screens. The warning messages vary a bit.  I'm sending along two warning messages from different problems and I've attached the code for the template of the problem that generated the first message:

1)--------------------------------------------------------------------

Warning messages

  • Use of uninitialized value in string eq at line 557 of (eval 371)
  • Use of uninitialized value in string eq at line 557 of (eval 371)
  • Use of uninitialized value in string eq at line 557 of (eval 371)
  • Use of uninitialized value in string eq at line 557 of (eval 371)

2)---------------------------------------------------------------------

Warning messages

  • Use of uninitialized value in multiplication (*) at line 651 of (eval 266)
  • Use of uninitialized value in multiplication (*) at line 651 of (eval 266)

------------------------------------------------------------------------

--rac

In reply to Robin Cruz

Re: After updating pg, problems have warning messages

by Michael Gage -
Sam recently broke PGanswermacros.pl up into smaller pieces and this is probably causing the errors. The connections between the various files might have slight gaps that is causing the uninitialized error messages.

You can back out of the entire PGanswermacros.pl update by the following:

In pg/macros

cvs status PGanswermacros.pl
---- if the working revision is 1.64 -- then you have the new split up version

cvs update -r 1.63 PGanswermacros.pl


will move you back to the version before the split.


If you have any clue as to which kind of answer evaluator is being used when the error message is produced let us know so we can find typo. My guess is that the first error is in line 557 of PGnumericevaluators.pl in the std_num_cmp_list macros ? is that possible?

-- Mike



In reply to Michael Gage

Re: After updating pg, problems have warning messages

by Robin Cruz -

I checked a few more of the "pinked" problems and there seems to be an issue with the PGanswersmacros.   Problems with str_cmp and fun_cmp are pinked.  In fact, fun_cmp was not working--It graded "correct" for wrong answers. 

I had the newer version of PGanswersmacros and backed out as you suggested and the templates seem to be working now.

-rac 

In reply to Robin Cruz

Re: After updating pg, problems have warning messages

by Michael Gage -
Update:

I believe that version 1.65 of PGanswermacros.pl will work for you now.
I fixed the specific errors you've found plus a few more and have had the
files running on hosted2 for a few hours without errors.

For those updating: the new PGanswermacros.pl splits the evaluators
into several files: PGstringevaluators.pl, PGnumericevaluators.pl, PGfunctionevaluators.pls, PGmiscevaluators.pl and the documentation has been significantly updated.

Be sure to update these files as well.

You can see the new documentation at

http://devel.webwork.rochester.edu/doc/cvs/pg_HEAD/

--Mike

In reply to Michael Gage

Re: After updating pg, problems have warning messages

by Robin Cruz -

I switched to 1.65 on Monday and initially things looked OK, but I found that if an answer is checked or submitted several times the problem gets "pinked" and I get the same warning message as before (although I'm not sure if the number listed for the location of the error is the same.)  I changed back to 1.63 on Wednesday and at first the "pinking" continued.  This morning everything seems to be working OK again with 1.63 -- sort of weird.

Another weird thing:  In a macro I'm writing to check factors, I'm using fun_cmp($ans) where, for example, $ans="x^2+1". i.e. it correctly compares the student's answer to $ans.  It is not working if $ans="x**2+1".  When I have the $ans printed out for error checking, "x**2+1" is showing up as "x2+1".

--rac

In reply to Robin Cruz

Re: After updating pg, problems have warning messages

by Davide Cervone -
About the pink screens: did you remember to restart the Apache server? If not, then some of the server child processes might still be using the previous copy, and newly started processes would use the current one. That would explain the behavior you see.

As for the exponentiation, can you send a more complete code sample?

Davide
In reply to Davide Cervone

Re: After updating pg, problems have warning messages

by Robin Cruz -

OK, that explains the weirdness about the pink screens. 

I checked over my code before I sent it out for you to look at and discovered that I had made the answer into a Formula after all. (sigh) So, I withdraw my question about the exponentiation.

Still, I didn't know that fun_cmp would work with MathObjects.  I remember trying to use PG answer evaluators with a MathObject a month or so ago and got errors.  I'm attaching the code anyway.  It's not a big deal, but since I am using MathObjects, I think it would work nicer with a List instead of the array I'm using--any advice?

Thanks--rac