We are having the same issue as described above with the PGML.pl macro and PGML code like [![$alttext]!]{$graph1}{400} that is found in the Valdosta APEX_Calculus files in the OPL. But we ARE on version 2.18 of WebWork. I just tried running OPL-update and it shows
Downloading the latest OPL release.
Found OPL METADATA release v2024-08-14.
Downloaded release archive, now extracting.
Restoring OPL tables from release database dump.
OPL path seems to be /opt/webwork/libraries/webwork-open-problem-library/
Removing temporary files.
Done!
Using WeBWorK root: /opt/webwork/webwork2
Using library root: /opt/webwork/libraries/webwork-open-problem-library/OpenProblemLibrary
Using contrib root: /opt/webwork/libraries/webwork-open-problem-library/Contrib
Saved OPL set definition list to /opt/webwork/webwork2/htdocs/DATA/library-set-defs.json.
Saved Contrib set definition list to /opt/webwork/webwork2/htdocs/DATA/contrib-set-defs.json.
I have checked that the content of the local OPL pg files having issues is the same as that for the github version of the OPL. They are using PGtikz.pl to draw the graphs, but we still getting the same warning messages as shown in the original message.
Here is one example of a problem that is failing.
OpenProblemLibrary/Valdosta/APEX_Calculus/2.2/APEX_2.2_18.pg
DOCUMENT();
# Load whatever macros you need for the problem
loadMacros(
'PGstandard.pl', 'PGML.pl', 'PGtikz.pl', 'parserPopUp.pl',
'PGcourse.pl'
);
$a = random(1, 4, 0.2) * random(-1, 1, 2);
$graph = createTikZImage();
$graph->tikzLibraries('arrows.meta');
$graph->BEGIN_TIKZ
\tikzset{>={Stealth[scale=1.5]}}
\filldraw[
draw=LightBlue,
fill=white,
rounded corners=10pt,
thick,use as bounding box
] (-7,-7) rectangle (7,7);
\draw[->,thick] (-6.5,0) -- (6.5,0) node[above left,outer sep=3pt] {\(x\)};
\foreach \x in {-6,...,-1,1,2,...,6}
\draw(\x,5pt) -- (\x,-5pt) node [below] {\(\x\)};
\draw[->,thick] (0,-6.5) -- (0,6.5) node[below right,outer sep=3pt] {\(y\)};
\foreach \y in {-6,...,-1,1,2,...,6}
\draw (5pt,\y) -- (-5pt,\y) node[left] {\(\y\)};
\draw[blue,ultra thick, dashed] plot[domain=-6:6,samples=100, smooth]
(\x,{$a*cos(pi*\x/2 r)});
\draw[ForestGreen,ultra thick] plot[domain=-6:6,samples=100, smooth]
(\x,{$a*sin(pi*\x/2 r)});
END_TIKZ
$negA = -$a;
$altText =
$a > 0
? "A graph with two plots. The green one is oscillates starting at "
. "(-6,0) falls to (-5, $negA), rises through (-4,0) to a maximum at (-3, $a) "
. "to (-2,0). This repeats through the rest of the plot. The blue one (dashed) "
. "starts at (-6,$negA), rises through (-5,0) to a maximum at (-4, $a) "
. "falls through (-3,0) to a minimum at (-2, $negA). This repeats through the "
. "rest of the plot."
: "A graph with two plots. The green one is oscillates starting at "
. "(-6,0) rises to (-5, $negA), falls through (-4,0) to a minium at (-3, $a) "
. "to (-2,0). This repeats through the rest of the plot. The blue one (dashed) "
. "starts at (-6,$negA), falls through (-5,0) to a minimum at (-4, $a) "
. "rises through (-3,0) to a maximum at (-2, $negA). This repeats through the "
. "rest of the plot.";
$ans_a = "f is green and its derivative is dashed blue";
$ans_b = "f is dashed blue and its derivative is green";
$ans = DropDown([ [ $ans_a, $ans_b ] ], $ans_a);
BEGIN_PGML
The graphs of two functions are shown below. One is the graph
of [`f(x)`] and the other is the graph of its derivative,
[`f'(x)`]. Identify which graph is which.
>> [![$altText]!]{$graph}{300} <<
[_]{$ans}
END_PGML
ENDDOCUMENT();
which produces the messages
PG warning messages
------
---- PGML (eval 3876) 1503 ------
==================
Errors parsing PGML:
Error: extra option '300'
Warning: unknown block type 'image' in PGML::Format::html::format
==================
__________________________
WeBWorK Warnings
WeBWorK has encountered warnings while processing your request. If this occured when viewing a problem, it was likely caused by an error or ambiguity in that problem. Otherwise, it may indicate a problem with the WeBWorK system itself. If you are a student, report these warnings to your professor to have them corrected. If you are a professor, please consult the warning output below for more information.
Warning messages
Use of uninitialized value $string in string eq at line 927 of [TMPL]/macros/PGML.pl.