WeBWorK Main Forum

Errors generating hardcopy

Errors generating hardcopy

by Frank Beatrous -
Number of replies: 12
Here is the problem.

A student selects a homework set from the "Homework Sets" page and clicks "Download PDF or TeX Hardcopy for Selected Sets."

He is taken to another page, where he clicks "Generate hardcopy."

This brings up a page containing

Error messages

Can't call method "hide_work" on an undefined value at /opt/webwork/webwork2/lib/WeBWorK/ContentGenerator/Hardcopy.pm line 216.

Call stack

The information below can help locate the source of the problem.

  • in WeBWorK::ContentGenerator::Hardcopy::pre_header_initialize called at line 179 of /opt/webwork/webwork2/lib/WeBWorK/ContentGenerator.pm
  • in WeBWorK::ContentGenerator::go called at line 371 of /opt/webwork/webwork2/lib/WeBWorK.pm


This only seems to happen for student users. When I login as professor, I can produce hardcopy with no errors indicated.

Any thoughts on what might be the cause?

Frank
In reply to Frank Beatrous

Re: Errors generating hardcopy

by Andras Balogh -
Just this minute I am receiving the exact same complaints from students.

Additional information:
It is not from all students either, so it might not be permission issue.


Andras

In reply to Andras Balogh

Re: Errors generating hardcopy

by Michael Gage -
what version of the software are you using? (there might be a number at the bottom of the page -- if not it is before 2.5.0).

Also go to the admin "course" for webwork and check to see if the courses have been upgraded?  


In reply to Michael Gage

Re: Errors generating hardcopy

by Frank Beatrous -
According to /opt/webwork/webwork2/README, we are using version 2.5.0.

When I click the "Upgrade Courses" link (logged in to admin course), I get a list of courses, with each course name followed by "sql_single Database tables ok".

I created a student login for myself, and I do get the error with that login. However, if I click the link to the problem set and then click the link "Download PDF or TeX Hardcopy for Current Set", the pdf is produced with no errors.

Frank

In reply to Frank Beatrous

Re: Errors generating hardcopy

by Andras Balogh -
Yes, Exactly. 
It depends on which way students want to get the PDF file.

Andras
In reply to Andras Balogh

Re: Errors generating hardcopy

by Michael Gage -
Thanks for that info.  It's a bug and it's still in the newest versions of WW as well.  I'll get on it.  For now you may just want to work around it by telling students what works rather than upgrade your site.

Thanks.

Take care,

Mike

In reply to Andras Balogh

Re: Errors generating hardcopy

by Michael Gage -
For me the problem only occurs with set names that had underbars (spaces) in them.  Is that what you are seeing?

I think I found the bug.

-- Mike

In reply to Michael Gage

Re: Errors generating hardcopy

by Adam Weyhaupt -
Yes.  If I take a set whose only difference is an underscore in the set name, the underscored set generates the error and the other does not.
In reply to Michael Gage

Re: Errors generating hardcopy

by Frank Beatrous -
Haven't had a chance to try in on a set with no underscores in the name, but yes, the sets that produced the errors do have underscores in their names.

Frank
In reply to Frank Beatrous

Re: Errors generating hardcopy

by Adam Weyhaupt -
I have exactly the same behavior described (and the same workaround suggested in the replies).  For me, this doesn't seem to happen with all problem sets.  One way to generate this error on my end is to create a problem set by importing this file:

dueDate           = 01/17/2013 at 11:59pm CST
answerDate        = 01/18/2013 at 12:00am CST
openDate          = 01/10/2012 at 12:00am CST
paperHeaderFile   = defaultHeader
screenHeaderFile  = defaultHeader
problemList       = 
Library/UVA-Stew5e/setUVA-Stew5e-C02S03-CalcLimits/2-3-01b.pg, 1, -1 

The following problem set does not generate the error.

openDate          = 08/20/2012 at 08:00am CDT
dueDate           = 08/29/2012 at 11:59pm CDT
answerDate        = 08/29/2012 at 11:59pm CDT
paperHeaderFile   = defaultHeader
screenHeaderFile  = defaultHeader
problemList       =
Library/Rochester/setTrig01Angles/ur_tr_1_1a.pg, 1, -1 
In reply to Adam Weyhaupt

Re: Errors generating hardcopy

by Michael Gage -
Modifications to ProblemSets.pm which fix this problem have been added to 
branches  ww2.5.1.1 and ww2.5.2  at 
github.com/mgage/webwork2-dev.

After further testing I'll have the changes moved to  github/openwebwork/webwork2-dev   probably by this weekend.

-- Mike

In reply to Michael Gage

Re: Errors generating hardcopy

by Frank Beatrous -
Just installed the modified ProblemSets.pm, and it fixed the hardcopy errors.

Thanks, Mike!

Frank