Forum archive 2000-2006

Thomas R. Shemanske - num_cmp pink screen

Thomas R. Shemanske - num_cmp pink screen

by Arnold Pizer -
Number of replies: 0
inactiveTopicnum_cmp pink screen topic started 2/22/2006; 3:53:17 PM
last post 2/23/2006; 8:49:17 AM
userThomas R. Shemanske - num_cmp pink screen  blueArrow
2/22/2006; 3:53:17 PM (reads: 572, responses: 5)
I am using WW2.1 and have an answer macro of the form:

ANS(num_cmp("DNE", strings=>["DNE"]));

and get a pink screen and the warnings below when the string DNE is entered. No answer is registered as being entered in the box which previews answers and indicates correctness.

If a numeric response is given, it is accepted, marked wrong, but without a pink screen.

This format is the one listed in PGAnswermacros.pl.

Is there some other change of which I am not aware?

Thanks

Tom

 

Warning messages

* Error in Translator.pm::process_answers: Answer AnSwEr9: |DNE| * Not a CODE reference at line 4330 of (eval 139) Died within main::check_strings called at line 545 of [PG]/lib/AnswerHash.pm from within AnswerEvaluator::evaluate called at line 1 of (eval 636) * Error in Translator.pm::process_answers: Answer AnSwEr9: * Answer evaluators must return a hash or an AnswerHash type, not type || at /var/pg/lib/WeBWorK/PG/Translator.pm line 1158 * Use of uninitialized value in numeric ge (>=) at /var/webwork2/lib/WeBWorK/ContentGenerator/Problem.pm line 929. * Use of uninitialized value in numeric ge (>=) at /var/webwork2/lib/WeBWorK/ContentGenerator/Problem.pm line 252. * Use of uninitialized value in pattern match (m//) at /var/webwork2/lib/WeBWorK/ContentGenerator/Problem.pm line 253. * Use of uninitialized value in numeric ge (>=) at /var/webwork2/lib/WeBWorK/ContentGenerator/Problem.pm line 254. * Use of uninitialized value in numeric gt (>) at /var/webwork2/lib/WeBWorK/ContentGenerator/Problem.pm line 254. * Use of uninitialized value in numeric gt (>) at /var/webwork2/lib/WeBWorK/ContentGenerator/Problem.pm line 257.

<| Post or View Comments |>


userThomas R. Shemanske - Re: num_cmp pink screen  blueArrow
2/22/2006; 4:13:54 PM (reads: 679, responses: 0)
Addendum:

Apache error logs state:

Wed Feb 22 15:52:52 2006] [warn] [client 129.170.147.62] [/webwork2/opencalc/OC02-02-Limits-Graphical/1/] Use of uninitialized value in numeric gt (>) at /var/webwork2/lib/WeBWorK/ContentGenerator/Problem.pm line 257.

Clearly the strings => ["DNE"] is getting corrupted

T

<| Post or View Comments |>


userDavide P. Cervone - Re: num_cmp pink screen  blueArrow
2/22/2006; 9:39:15 PM (reads: 694, responses: 0)
This is a problem that was fixed in version 1.36 of pg/macros/PGanswermacros.pl last september. If you aren't able to update your version of WeBWorK, you can fix this by replacing
   my $temp_ans_hash = &$ans_eval($ans);
by
   my $temp_ans_hash = $ans_eval->evaluate($ans);
in the routine check_strings around line 4327. A lot has happened in this file since September, so I'm not sure I'd recommend updating just this file without updating everything.

Hope that helps.

Davide

<| Post or View Comments |>


userThomas R. Shemanske - Re: num_cmp pink screen  blueArrow
2/23/2006; 8:25:04 AM (reads: 662, responses: 0)
We had version 1.35 installed and I verified the only change to 1.36 was the one you indicated. I d/l from CVS 1.36 and installed, but the problem persists.

Apache errors are:

[Thu Feb 23 08:24:59 2006] [warn] [client 129.170.147.62] [/webwork2/opencalc/OC02-02-Limits-Graphical/1/] Error in Translator.pm::process_answers: Answer AnSwEr9: |DNE|n Not a CODE reference at line 4330 of (eval 193)
Died within main::check_strings called at line 545 of [PG]/lib/AnswerHash.pm
from within AnswerEvaluator::evaluate called at line 1 of (eval 3030)
n [Thu Feb 23 08:24:59 2006] [warn] [client 129.170.147.62] [/webwork2/opencalc/OC02-02-Limits-Graphical/1/] Error in Translator.pm::process_answers: Answer AnSwEr9:
n\nt\tt\tAnswer evaluators must return a hash or an AnswerHash type, not type || at /var/pg/lib/WeBWorK/PG/Translator.pm line 1158n [Thu Feb 23 08:24:59 2006] [warn] [client 129.170.147.62] [/webwork2/opencalc/OC02-02-Limits-Graphical/1/] Use of uninitialized value in numeric ge (>=) at /var/webwork2/lib/WeBWorK/ContentGenerator/Problem.pm line 929. [Thu Feb 23 08:24:59 2006] [warn] [client 129.170.147.62] [/webwork2/opencalc/OC02-02-Limits-Graphical/1/] Use of uninitialized value in numeric ge (>=) at /var/webwork2/lib/WeBWorK/ContentGenerator/Problem.pm line 252. [Thu Feb 23 08:24:59 2006] [warn] [client 129.170.147.62] [/webwork2/opencalc/OC02-02-Limits-Graphical/1/] Use of uninitialized value in pattern match (m//) at /var/webwork2/lib/WeBWorK/ContentGenerator/Problem.pm line 253. [Thu Feb 23 08:24:59 2006] [warn] [client 129.170.147.62] [/webwork2/opencalc/OC02-02-Limits-Graphical/1/] Use of uninitialized value in numeric ge (>=) at /var/webwork2/lib/WeBWorK/ContentGenerator/Problem.pm line 254. [Thu Feb 23 08:24:59 2006] [warn] [client 129.170.147.62] [/webwork2/opencalc/OC02-02-Limits-Graphical/1/] Use of uninitialized value in numeric gt (>) at /var/webwork2/lib/WeBWorK/ContentGenerator/Problem.pm line 254. [Thu Feb 23 08:24:59 2006] [warn] [client 129.170.147.62] [/webwork2/opencalc/OC02-02-Limits-Graphical/1/] Use of uninitialized value in numeric gt (>) at /var/webwork2/lib/WeBWorK/ContentGenerator/Problem.pm line 257.

Thanks for any other ideas (aside from upgrading to 2.2 in the middle of a term ;-) )

Tom

<| Post or View Comments |>


userThomas R. Shemanske - Re: num_cmp pink screen  blueArrow
2/23/2006; 8:33:16 AM (reads: 662, responses: 0)
Got it!

Reloaded apache. Not sure why that .pl file is cached, but restarting apache resolved the issue

Thanks

T

<| Post or View Comments |>


userMichael Gage - Re: num_cmp pink screen  blueArrow
2/23/2006; 8:49:17 AM (reads: 646, responses: 0)
The large .pl files: PGanswermacros.pl, PGbasicmacros.pl and a few more, are cached. It makes a very noticable difference in speed.

One long term project is to make the caching mechanism more straightforward so that it can be used on other files. Some delicate handcoding was needed to allow PGanswermacros.pl and PGbasicmacros.pl to be cached.

-- Mike

<| Post or View Comments |>