WeBWorK Main Forum

Physics Problem library and Hardcopies

Physics Problem library and Hardcopies

by Justin Heckman -
Number of replies: 9

Hi,

This question was posed 9 months ago but it didn't get an answer.  I am having the same issue so I will pose i again.  When I make homework sets that contain physics problems from the converted CAPA files, if they have images then a hardcopy cannot be generated.  At the high school level where not all my students have internet access at home this is especially problamatic.

It generates 4 errors as followed:

4 errors occured while generating hardcopy, but I think all after teh first are a result of the first.  The errors are as follows:

  • Failed to convert TeX to PDF with command 'cd /opt/webwork/courses/Heckman_AP_Physics_ALHS/html/tmp/hardcopy/work.YLy_wFrK && /usr/bin/pdflatex --shell-escape >pdflatex.stdout 2>pdflatex.stderr hardcopy' (exit=70 signal=0 core=0).
  • No errors encoundered in TeX log.
  • Failed to rename 'hardcopy.pdf' to 'Heckman_AP_Physics_ALHS.jheckman.test4.pdf' in directory '/opt/webwork/courses/Heckman_AP_Physics_ALHS/html/tmp/hardcopy/work.YLy_wFrK':
    /bin/mv: cannot stat `/opt/webwork/courses/Heckman_AP_Physics_ALHS/html/tmp/hardcopy/work.YLy_wFrK/hardcopy.pdf': No such file or directory 
  • Final hardcopy file '/opt/webwork/courses/Heckman_AP_Physics_ALHS/html/tmp/hardcopy/work.YLy_wFrK/hardcopy.pdf' not found after calling 'generate_hardcopy_pdf': No such file or directory

Can this be fixed, and if so how?

In reply to Justin Heckman

Re: Physics Problem library and Hardcopies

by Jason Aubrey -
Hi Justin,

Does this only happen with the CAPA problems? Can you generate hardcopies of non-CAPA problems?

Also, I think these instructions were recently updated:

http://webwork.maa.org/wiki/CAPA_Physics_Problems

You might want to double check configuration against those instructions.

Jason
In reply to Jason Aubrey

Re: Physics Problem library and Hardcopies

by Justin Heckman -
Yes this issue has only manifested with CAPA problems, and only with CAPA problems that contain images. Problems from the national problem library that contain images produce hard copies fine, as do non-image containg homework sets from CAPA.

I believe I have installed the library correctly but it is possible I am mistaken, I will check.
In reply to Jason Aubrey

Re: Physics Problem library and Hardcopies

by Danny Glin -
If you can see the images on screen, but not on hardcopy, then most likely the problem is with the following line in global.conf:
$pg{specialPGEnvironmentVars}{CAPA_GraphicsDirectory} = "$webworkDirs{htdocs}/CAPA_Graphics/",
(this is what you should have changed it to according to the instructions at http://webwork.maa.org/wiki/CAPA_Physics_Problems). The value of this variable should be the location of the CAPA_Graphics directory. If it doesn't work when typed as above, try replacing the section in quotes with the absolute path of the CAPA_Graphics directory (the recommended default in the installation instructions is /opt/webwork/webwork2/htdocs/CAPA_Graphics)

Danny
In reply to Jason Aubrey

Re: Physics Problem library and Hardcopies

by Arnold Pizer -
Thanks everyone. After rewriting the directions for installing the CAPA library, obviously I didn't test things sufficiently. The directions have now been updated. The additional commands that need to be run as root are:

# cd /opt/webwork/webwork2/htdocs/
# chgrp -R wwdata CAPA_Graphics

Arnie
In reply to Justin Heckman

Re: Physics Problem library and Hardcopies

by Boyd Duffee -
The other way to find the source of the error is to run the failed command step by step on the command line. The error reporting is more informative. In a similar situation, I found that the program to produce the hardcopy wasn't installed (or the permissions weren't set correctly) I've also found that I need to make a link to the libraries/rochester_physics_problib/CAPA_Graphics directory from courses/$course/html

Boyd
In reply to Boyd Duffee

Re: Physics Problem library and Hardcopies

by Justin Heckman -

I went through the log and this appears to be the error:

!pdfTeX error: /usr/bin/pdflatex (file /opt/webwork/webwork2/htdocs/CAPA_Graphics/Gtype06/prob09.pdf): cannot find image file

so the pdf file doesn't exist.  Do I need to go through and make PDF versions of every image in all the CAPA libraries?

In reply to Justin Heckman

Re: Physics Problem library and Hardcopies

by Danny Glin -
pdflatex will automatically create the pdf versions of the images when the hardcopy is generated. The only problem is that it tries to create the pdfs in the same directory as the eps files from which they are generated. The solution I found was to give apache write permissions to the CAPA_Graphics directory (and all subdirectories). After I did this, I was able to print hardcopies of CAPA problems with graphics.

Danny
In reply to Danny Glin

Re: Physics Problem library and Hardcopies

by Jason Aubrey -
This was my impression of what the problem might be, but I don't have the CAPA problems installed. So, should the CAPA instructions read:

# mv CAPA_Graphics /opt/webwork/webwork2/htdocs/
# chgrp -R wwdata /opt/webwork/webwork2/htdocs/CAPA_Graphics
# chmod -R g+w /opt/webwork/webwork2/htdocs/CAPA_Graphics # cd .. # mv rochester_physics_problib /opt/webwork/libraries/
Jason

In reply to Jason Aubrey

Re: Physics Problem library and Hardcopies

by Justin Heckman -
OUTSTANDING,

It is functioning, and YES that is what the CAPA instructions should read. Those two commands took care of it. Thank you very much Jason. Having printable copies is a Huge deal at the High School level where not all students have internet at home. Equity becomes a big issue.

So thank you to all of you for helping me through this