I've recently upgraded our system to the 2.5 *dev version. I've set up our system to save image files to /var/www/wwtmp. I am trying to modify a problem that uses a dynamic graph and am having a difficulty I did not have before the upgrade. I am trying to edit a problem that uses a dynamic graph. When the problem is accessed, it creates the image file of the dynamic graph in the folder as expected. When the problem is edited and saved, the graph should change when the problem is reloaded but it does not. A new image file is not created over the original one--I can see that from the time stamp on the image file. I have tried Ctrl-R, Ctrl-Shift-R, Ctrl-F5 and many permutations of trying to force a reload. Before the upgrade, I only had to hit the reload button on the browser a few times to get the new graph to show.
Thanks - rac
$refreshCachedImages = 1;
is used in the problem's code?
I added the refresh cache line you mentioned to the problem's code and now it is refreshing the image. It's odd that I didn't need to do this before??
--rac
Arnie,
Yes, it does. Here is the code I'm using:
$graph = init_graph_no_labels($xmin,$ymin,$xmax,$ymax);
add_functions( $graph,"$f for x in $interval[$n] using color:$rc and weight:3" );
$graph->lb(new Label($xmin+2,$ymax-.5, "y = h(x)",'black','center'));
And then in-between BEGIN_TEXT and END_TEXT:
\{ image(insertGraph($graph),width=>400, height=>400, tex_size=>600) \}
Here are the macros loaded by the problem:
loadMacros(
"PGstandard.pl",
"PGchoicemacros.pl",
"MathObjects.pl",
"contextInequalitiesAllowStrings.pl",
"answerHints.pl",
"PGgraphmacros.pl"
);
Thanks --rac
Arnie and Jason,
When I take out the refresh cache line in the problem's code and change the graph, it will not update the image--the file for the graph in the var/www/wwtmp/gif folder is not updated. I tried it in IE and Chrome. I edited the file from IE and looked at the problem in Chrome--it was the first time I'd logged into the course using Chrome.
--rac
Perhaps it matters if you are editing via an assigned homework problem as opposed to editing via the library browser.
Cached images for assigned problems may need to be "flushed".
hp
Ooops! perhaps I spoke too soon.
I am also finding a "stubborness" there (in refreshing the graphic) that I cannot explain.
I am working with the file I recently referred to in the "problems" forum.
The $refreshCachedImages = 1; does help a lot.
hp