WeBWorK Main Forum

WeBWork Warnings, uninitialized value

WeBWork Warnings, uninitialized value

by James Morski -
Number of replies: 5
A student reported this error while working through homework. I have not been able to recreate this error. Additionally, we have four other instances of this course but this has not be duplicated. Any ideas what should be looked at? We are using version 2.12.

The image is a bit blurry, but the warning messages say:

Use of uninitialized value $text in string ne at /opt/webwork/webwork2-ccd/lib/WeBWork/ContentGenerator/ProblemSets.pm line 62

Thanks!


In reply to James Morski

Re: WeBWork Warnings, uninitialized value

by Nandor Sieben -
What is the pg problem file that causes this warning?
In reply to Nandor Sieben

Re: WeBWork Warnings, uninitialized value

by James Morski -
This error shows on the main landing page for the course that lists the Homework Sets, so it doesn't appear to be associated with a specific problem.
In reply to James Morski

Re: WeBWork Warnings, uninitialized value

by Alex Jordan -
Here is that file on the current release of WeBWorK:
https://github.com/openwebwork/webwork2/blob/master/lib/WeBWorK/ContentGenerator/ProblemSets.pm
(If your version of WW is earlier, things may be different).

Note how around line 57 initializes $text. Then it might be set to something else at line 60. At line 63, it is used in a comparison. The error sounds like it is coming from that comparison.

You may have to examine your copy of this file. Is $text successfully defined at line 57? Line 37 defines a constant that is used at line 57.

Or is the issue at line 60? Maybe this fails to execute:

$text = eval { readFile($course_info_path) };

That might be failing if $course_info_path isn't being defined a few lines earlier.

A lot depends on what your version of this file looks like around line 62. Are you able to look at it directly?
In reply to Alex Jordan

Re: WeBWork Warnings, uninitialized value

by James Morski -
Thanks Alex. I don't have access to the file but I will pass it along and report back.
In reply to Alex Jordan

Re: WeBWork Warnings, uninitialized value

by Danny Glin -
Based on Alex's post it could be that the course info file is missing for this course. The default name for the file would be course_info.txt, so you can check in the file manager if that file exists.

An alternative would be to log in as instructor and click the "Edit" button next to Course Info on the right. If you get an empty editor window, try entering some text and saving the file to see if this solves the problem.