Forum archive 2000-2006

Blake Thornton - Bizarre image generation problem

Blake Thornton - Bizarre image generation problem

by Arnold Pizer -
Number of replies: 0
inactiveTopicBizarre image generation problem topic started 10/15/2004; 1:51:32 PM
last post 10/15/2004; 5:33:02 PM
userBlake Thornton - Bizarre image generation problem  blueArrow
10/15/2004; 1:51:32 PM (reads: 1306, responses: 7)
Perhaps this is a bug that has been fixed that we haven't updated, but here is the problem: it seems that webwork successfully generates the images, but when building the webpage it places the images in the wrong locations on the webpage.

Here is a specific example:

 


DOCUMENT();

loadMacros(PG.pl, PGbasicmacros.pl, PGchoicemacros.pl, PGanswermacros.pl, PGauxiliaryFunctions.pl );

TEXT(beginproblem());

BEGIN_TEXT

Find the amount \( A \) in an account after \( t \) years if

\[ \frac{dA}{dt} = 0.12A \]

where \( A(0) = 5250 \)

$PAR

\( A(t) \) = \{ ans_rule(15) \}

$PAR

END_TEXT

ANS(fun_cmp("5250* exp(0.12*t)", var=>['t']));

ENDDOCUMENT();

 


What is displayed on my screen in image mode (with the tex converted to images):

Find the amount \( A \) in an account after \( t \) years if

\[ A(t) \]

where \( A(0) = 5250 \) $PAR

\( A(t) \) = \{ ans_rule(15) \}

$PAR

END_TEXT

 


Bizarre. Now, the amazing thing is that the following displays correctly:

 

BEGIN_TEXT

Find the amount \( A \) in an account after \( t \) years if

\[ \frac{dA}{dt} = A(0.12) \]

where \( A(0) = 5250 \)

$PAR

\( A(t) \) = \{ ans_rule(15) \}

$PAR

END_TEXT

 


Everything displays correctly in the other display modes, but not in image mode.

Any ideas?

<| Post or View Comments |>


userJohn Jones - Re: Bizarre image generation problem  blueArrow
10/15/2004; 3:27:40 PM (reads: 1495, responses: 0)
Can you view the faulty page, then have your browser give you the page source? Down near the bottom is the html for the problem. Select the full image tags, and post them. That should let us see what the raw latex used for the images, and the image paths. When posting, you can use the html tags
  <pre>
pasted <img> tags
</pre>
so that things should come through without having to add extra backslashes.

John

<| Post or View Comments |>


userMichael Gage - Re: Bizarre image generation problem  blueArrow
10/15/2004; 3:28:07 PM (reads: 1507, responses: 0)
This sounds like a caching problem. A mistake in generating the image at some point is now persisting. The first thing to try is to use shift-refresh on the browser to see if the browser itself is caching the image. (Or quit and relaunch the browser -- or check to see if others see the same problem.)

WeBWorK itself (within ImageGenerator.pm) also tries to cache the images and it's possible that having generated an incorrect image it refuses to create a new one on the grounds that it has already created this image. This fits with all of the information you've given.

Correcting this latter situation cleanly is a bit more delicate, and I can't give a full answer off the top of my head. Search through global.conf for "equation" and look at those locations for images and references to images that have been created and don't need to be created again.

<| Post or View Comments |>


userBlake Thornton - Re: Bizarre image generation problem  blueArrow
10/15/2004; 3:55:44 PM (reads: 1519, responses: 0)
Thanks for the quick responses!

I don't understand webwork's internal caching, but I don't think it is a caching problem. This problem first occured in the editing page (where I was editing the problem-- webwork certainly shouldn't cache those images). In addition, I viewed the actual files on the server and they match up with what I'm seeing (i.e., they are wrong).

I posted the html source of the html file, the pg file and the png files that I downloaded from /opt/webwork2/htdocs/tmp/equations. These can be found here:

http://www.math.wustl.edu/~blake/tmp/

Thanks for any insights!

<| Post or View Comments |>


userJohn Jones - Re: Bizarre image generation problem  blueArrow
10/15/2004; 4:31:31 PM (reads: 1507, responses: 0)
It comes up fine on my system. There is a latex error in the solution part (A = A_0e^{0.12 t) should end in a brace, not a parenthesis), but I don't think that is really the source of your problem.

Maybe you should remove the images and view the problem again and see what happens. To remove old images, as superuser, run the remove_stale_images script to clean them all out:

 remove_stale_images --delete --days=0
Does it then produce exactly the same image files?

John

<| Post or View Comments |>


userBlake Thornton - Re: Bizarre image generation problem  blueArrow
10/15/2004; 4:58:31 PM (reads: 1494, responses: 0)
John,

Thanks for the ideas. I fixed the tex error and it wasn't it. But it worked perfectly after running remove_stale_images!!!

Okay, so any theories on why? Should I plan to run this every once in a while?

Thanks for the help!! Blake

<| Post or View Comments |>


userJohn Jones - Re: Bizarre image generation problem  blueArrow
10/15/2004; 5:09:25 PM (reads: 1507, responses: 0)
My only idea on how it happened is that there was an attempt to generate images which went wrong (some other bad latex being involved) and led to an image being mislabelled. I haven't seen that before - it may take some experimentation with a clean system and problems with faulty latex in them.

On doing a complete flush of images, I wouldn't do it that often. Then again, I haven't seen a mis-labeled image like this one before. I have a server for which 2 weeks means 150,000 images, so I delete ones which haven't been used in more than two weeks (same command, but with days=14). This would not have picked up this problem if the image kept on being accessed though.

John

<| Post or View Comments |>


userBlake Thornton - Re: Bizarre image generation problem  blueArrow
10/15/2004; 5:33:02 PM (reads: 1506, responses: 0)
Well, I'll keep this in mind if it occurs again-- I will certainly put this command in my bag of tricks.

Thanks again!

<| Post or View Comments |>