As Alex stated, the "v2023-04-30" tag will work. Note that if you run the webwork2 "OPL-update" script, that will take care of checking out that branch and setting up the database.
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.
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.
This file loads fine for me in 2.19 (I don't have a 2.18 install to test against).
Did you update PG to 2.18 when you updated WeBWorK?
Did you update PG to 2.18 when you updated WeBWorK?
Are you also on PG 2.18 (or 2.19)? The warning that you are getting suggests that you might not have updated /opt/webwork/pg.
Yes.
This won't be any help to Larry, but I checked this problem from Valdosta on a WeBWorK 2.18 server, and it works for me. So I am not sure what is different for Larry.
If it is of any help, if I remove the line
>> [![$altText]!]{$graph}{300} <<
then no error warnings are given (and, of course, no graph is displayed).
Does this happen in all courses? What I am wondering is if you have a course with some local copy of an old PGML.pl file in its macros folder.
Bingo!! Yes, the course in which the error was occurring had a copy of PGML.pl in its macros folder. I renamed it to PGML.pl.old and the pg file then ran successfully with no warnings. There was one other course I checked in which the error occurred, and that course also had a PGML.pl file in its macros folder. I have no recollection of why these two courses had this local copy, but at least none of our other courses had one. So thanks, Alex, for providing the solution. Much appreciated. And thank you Danny, Glen, and Sean for also taking a look at this for me. This forum has come to my rescue many times.