Problem with number_list_cmp in v1.9 | topic started 10/8/2004; 5:19:21 PM last post 10/12/2004; 11:21:45 AM |
|
|
|
Arnold K. Pizer - Re: Problem with number_list_cmp in v1.9 10/12/2004; 11:21:45 AM (reads: 1277, responses: 0) |
WeBWork seems to be unable to sort numeric lists for us. It generates the following
error message when asked to do so: * Current time: 10/11/04 at 12:55 PM (reload page to update time) Compiler warnings: * Use of uninitialized value in numeric comparison (<=>) at (eval 133) line 1644. ##More details: -------- main::__ANON__ called at /usr/local/webwork/system/lib//PGtranslator.pm line 1527 ---- PGtranslator::PGsort called at (eval 133) line 1644 ---- main::num_sort called at (eval 53) line 28 ---- main::__ANON__ called at /usr/lib/perl5/5.8.0/i386-linux-thread-multi/Safe.pm line 223 ---- Safe::reval called at /usr/local/webwork/system/lib//PGtranslator.pm line 733 ---- PGtranslator::translate called at /usr/local/webwork/system/cgi/cgi-scripts/processProblem8.pl line 445 * Then, of course, it refuses to accept lists of solutions given, as instructed, in increasing order. [........... skipping problem code .............] As you can see, the error seems to arise from the call to num_sort. This happens consistently in problems that call that macro (from PGbasicmacros.pl). I've looked at this file, but I don't know enough perl to guess what's going on. I can "fix" these problems by replacing this call to num-sort with a quick and dirty sort based on a few if/else constructions--but even for lists of just three numbers, that's a royal pain. --Lou Talman Department of Mathematical & Computer Sciences Metropolitan State College of Denver |