Forum archive 2000-2006

Barbra Bannon - HELP: Static Graphing Problem

Barbra Bannon - HELP: Static Graphing Problem

by Arnold Pizer -
Number of replies: 0
inactiveTopicHELP: Static Graphing Problem topic started 6/20/2001; 3:08:13 PM
last post 6/21/2001; 4:38:45 PM
userBarbra Bannon - HELP: Static Graphing Problem  blueArrow
6/20/2001; 3:08:13 PM (reads: 1118, responses: 3)
We are trying to create a WeBWorK problem that uses static graphic files. They are stored in the directory /web/webwork/courses/demoCourse/templates/ setBm305test/

Included below is the code and the compiler errors listed.

The question is: "Why is WeBWorK looking for the .gif files in the directory: /web/webwork/system/courses/demoCourse/templates/setBm305test/ ?"

-Barbra Bannon University of New Hampshire

Thank you for your help in advance! ------------------------------------------------------------------------


##DESCRIPTION ## Problem involving graphs created previously as .gif files ##ENDDESCRIPTION

&DOCUMENT; loadMacros( PG.pl, PGbasicmacros.pl, PGchoicemacros.pl, PGanswermacros.pl);

$showPartialCorrectAnswers = 0;

@images = ("familyx_squared1.gif","familyx_squared2.gif", "familyx_squared3.gif","familyx_squared4.gif","familyx_squared5.gif",);

TEXT(&beginproblem);

BEGIN_TEXT This is a graph of the function ( f(x) = x^2 ): $BBOLD Click on image for a larger view $EBOLD $PAR { ℑ($images[0]) } $PAR

END_TEXT

&ENDDOCUMENT

------------------------------------------------------------------------


Page produced by script: /var/www/cgi-bin/webwork/system/cgi-scripts/processProblem8.pl Compiler warnings:

* ERROR in old_safe_ev, PGbasicmacros.pl:

## There is an error occuring inside evaluation brackets { ...code... } ## somewhere in an EV2 or EV3 or BEGIN_TEXT block. ## Code evaluated: ## ℑ($images[0]) ##The macro alias cannot find a GIF file at: |/web/webwork/system/courses/demoCourse/templates/setBm305test/familyx_squared1.gif| at /web/webwork/system/courseScripts/dangerousMacros.pl line 683. ##

parnoindent at (eval 108) line 1012. ##More details: -------- PG_priv::old_safe_ev called at (eval 108) line 1000 ---- PG_priv::safe_ev called at (eval 108) line 985 ---- PG_priv::ev_substring called at (eval 108) line 1084 ---- PG_priv::EV3 called at (eval 50) line 17 ---- PG_priv::__ANON__ called at /usr/local/lib/perl5/5.6.1/i686-linux/Safe.pm line 222 ---- Safe::reval called at /web/webwork/system//PGtranslator.pm line 691 ---- PGtranslator::translate called at /var/www/cgi-bin/webwork/system/cgi-scripts/processProblem8.pl line 420

<| Post or View Comments |>


userMichael Gage - Re: HELP: Static Graphing Problem  blueArrow
6/20/2001; 3:48:18 PM (reads: 1313, responses: 0)
Hi Barbara,

We usually try to group the .gif files together with the problem set which calls them:

So for example: in set0/prob4 (of the demoCourse)

the text of the problem is in set0/prob4/prob4.pg and the .gif files that are referenced are placed in the same directory. In general .gif files that have indirect addresses are looked for first in the same directory as the problem. If they have direct addresses, that address is used. The complete behavior is defined in the subroutine alias() which is defined in the file dangerousMacros.pl.

So you probably want to define a directory setDemo/myproblem/ with the file you defined above as setDemo/myproblem/myproblem.pg and gif files setDemo/myproblem/firstGIF.gif setDemo/myproblem/secondGIF.gif and so forth.

If you want to place the .gif files in a common location (for example, if it is a .gif you want to use in a lot of problem) then you could place it in

demoCourse/html/gif/mygif.gif and reference it as "${htmlDirectory}gif/mygif.gif". (The variable ${htmlDirectory} points to the the html directory in the current course and ends in a /.)

Hope this helps.

-- Mike

<| Post or View Comments |>


userArnold K. Pizer - Re: HELP: Static Graphing Problem  blueArrow
6/20/2001; 8:01:50 PM (reads: 1292, responses: 0)
Hi Barbara,

Let me add one comment to Mike's. Maybe you are confused by the directory you used
/web/webwork/courses/demoCourse/templates/setBm305test/
and the directory in WeBWorK's error message
/web/webwork/system/courses/demoCourse/templates/setBm305test/

These are (or should be) the same. If you look in
/web/webwork/system/courses/
you will see that demoCourse is actually a link pointing to the actual directory
/web/webwork/courses/demoCourse/

I would certainly recommend setting things up as Mike suggests. Also make sure that the webserver has permission to read the .gif files.

Arnie

<| Post or View Comments |>


userBarbra Bannon - Re: HELP: Static Graphing Problem  blueArrow
6/21/2001; 4:38:45 PM (reads: 1271, responses: 0)
Thank you so much for your help! Your comments helped me think out of the box and realize that the problem was actually a typo. I love debugging, don't you?

I am so glad this discussion forum exists! It's a lifesaver!

Thanks a million again, -Barbra Bannon

<| Post or View Comments |>