From: Michael G. <ga...@ma...> - 2005-08-12 23:34:24
|
On Aug 12, 2005, at 6:36 PM, John Jones wrote: > Hi, > > There was a discussion on the discussion board stemming from > Nandor's problems which generate graphs based on student answers. > Part of the resolution was that a problem should always refresh its > on the fly graphics if refreshCachedImages is non-zero. > > I created a problem and set $refreshCachedImages=1 in the problem. > The place to check this is in dangerousMacros.pl. I have tried > $main::refreshCachedImages and $main::PG_FLAGS{refreshCachedImages} > (and a few other variations), and I cannot see the value of this > variable. > > What is the right way to access this value, or is there none? For > example, if the call from the problem to insertGraph is evaluated > before ENDDOCUMENT, then any help from ENDDOCUMENT won't be seen. > Hi John, Try my $refreshedCachedImages = eval ( "$main::refreshCachedImages"); I I think that might work. There are several examples of this kind of problem in PG.pl, PGanswermacros.pl and PGbasicmacros.pl -- all of these are scripts which are precompiled. The problem is that because dangerousMacros.pl is cached "main::" means one thing when the script is compiled (perhaps main:: is SafeRoot1:: ) and another when the problem script is compiled (main:: is SaveRoot 21::) so you need to delay evaluation of the variable name until "run time". See if that works. I haven't tested it, some experimentation might be needed. Take care, Mike > If there is not a reasonable way to access refreshCachedImages, > maybe it should be removed since it doesn't have a use (aside from > debugging). Having an optional flag in the graph object for forced > refreshing is something I suggested on the discussion board. We > could still do that pretty easily I think. The call to insertGraph > does have access to the graph object. > > John > > > > ------------------------------------------------------- > SF.Net email is Sponsored by the Better Software Conference & EXPO > September 19-22, 2005 * San Francisco, CA * Development Lifecycle > Practices > Agile & Plan-Driven Development * Managing Projects & Teams * > Testing & QA > Security * Process Improvement & Measurement * http://www.sqe.com/ > bsce5sf > _______________________________________________ > OpenWeBWorK-Devel mailing list > Ope...@li... > https://lists.sourceforge.net/lists/listinfo/openwebwork-devel > |