Hi,
In general, webwork tries to use cached copies of on-the-fly graphs to
save time. Lots of students doing a graph-laden assignment can cause a
pretty large load on the server. It happened to us once.
One stage of the caching mechanism is to distinguish graphs by their
names, which contains the student name, problem seed, set name, problem
number, and graph number within a problem. If any of those things
change, then webwork will generate a different graph. It isn't
bulletproof, but collisions here are pretty unlikely. Effectively,
someone would have to make an assignment, and then change the pg file
used for the problem without changing the seed or renumbering the
problems, and both pg files would have to have on-the-fly graphs in
them. Webwork also checks the change times of the pg file and the
graph, so if there is a new copy of the problem file, it regenerates
the graph.
The final check is to see if the problem is being rendered from the
library browser. Those problems have only generic data (problem seed is
usually 0, set name is always the same, etc.). So, while someone is
browsing problems with graphs, it is pretty likely that this data will
result in a name collision. So, the caching mechanism accounts for it.
So, that is why rendering on-the-fly graphs was different in the
library browser.
Manually changing the graph name like you are now doing is probably the
right solution. Any other solution would either mean giving up on
caching or setting a flag for certain images (like yours) to say "don't
cache me", but the latter is as much work for the problem author as
what you have above.
John
<| Post or View Comments |>
|