## WeBWorK Main Forum

by Lars Jensen -
Number of replies: 5

Hi Everyone,

When printing a set I sometimes get an error:

1 error occured while generating hardcopy:

 Errors encountered while processing snippet 'defaultHeader' for set 'set03' and user 'jensen'. This snippet has been omitted from the hardcopy. Error text:
Failed to read the problem source file.

Other sets that are set up with exactly the same defaultHeader doesn't produce this error. (What is defaultHeader, by the way - I don't see the file anywhere)

When I open these sets in the Hmwk Sets Editor and display the headers, I see the errors below, whether the error above occurs up or not.

Any ideas what is going on, and how to get rid of the errors?

Thanks,
Lars.

by Michael Gage -
the defaultHeader usually points to the setHeader.pg file in the webwork2/conf/snippets directory. (I believe you can set this in global.conf.)

This problem is a minor bug in initialization -- here's a work around -- in the homework set you set defaultHeader to some other header, save it, then reset to defaultHeader and save again the path to the defaultHeader file should be properly initialized. (It has worked for me at least.) I think maybe just saving the homework setup from the hmwk editor might be enough to correct the path.

My suspicion is that the path to the defaultHeader is not being properly initialized when one of the methods for creating a new homework set is used -- I'm not sure which one yet.

If you set the header to be some local setHeader file of your own then you certainly won't have any problems. You can make a local version of the file in snippets.

by Lars Jensen -
Hi Mike,

Your first suggestion didn't work for me.

Is there an appropriate setHeader file for a hardcopy that ships with the webwork distribution?

The setHeader.pg file in conf/snippets is not really appropriate for a hardcopy. I understand that I can edit the file, which I'll do. But it would be nice if webwork had a default screenHeader and a hardcopy header file included with the distribution that don't require any editing. Basically all the hardcopy header needs is the due date, set number, and perhaps the course name. The setHeader.pg file has a link to the course webpage (which may not exist) plus info like: "This file is /conf/snippets/setHeader.pg you can use it as a model for creating files which introduce each problem set."

Thanks again,
Lars.

by Dick Lane -
I have been experimenting with revisions to setHeader.pg in modelCourse which is propagated to all of its children. My current version (attached) displays a single line in printable (PDF) output but a more extensive DueDate + info + homily + Link for a screen display.

Although I usually create a header document for each of my assignments, there are occasions when I would be satisfied to "punt" with a boilerplate statement. Furthermore, I do not always have major differences between prose for a printable version versus an online version. Nonetheless, I see some advantages to have a "snippets" document with remarks addressed to an instructor during a setup process.

In any event, I do not think a simple use of the Library Browser to create an assignment should result in errors because of an non-existent default header.

I suggest
1) an option in CourseConfiguration to specify a (polymorphic) file to be used as header for both print and screen
2) creation of a single corresponding descriptor for a DEF file (as opposed to having duplicate entries for paperHeader & screenHeader).

by Dick Lane -
My previous attachment has a TeX section with (5 lines):
$studentName \hfill WeBWorK assignment$setNumber is due $formattedDueDate. \hfill \{protect_underbar($courseName)\} $sectionNumber} Since it is valid to have an assignment whose name (the text seen by students) includes an underscore character, I think it will be much safer if such boilerplate resembles (6 lines) \{protect_underbar($studentName)\}
\hfill
WeBWorK assignment \{protect_underbar($setNumber)\} is due$formattedDueDate
\hfill
\{protect_underbar($courseName)\}$sectionNumber}

partial clarification (I hope ;-): although the system variable is named "$setNumber", its value is the string used for the assignment's name (and "$setName" might be a better name).

by Arnold Pizer -
Hi Lars et all,

I think all the bugs associated with the new defaultHeader set up have now been squashed.  An svn update is required.