WeBWorK Problems

Error using PGML macro

Error using PGML macro

by Jennifer Thorenson -
Number of replies: 2

We recently completed a new installation of WeBWorK version 2.17 and have discovered that some of the problems in the OPL do not render.  The issue that we have involves the problems that use the PGML macro to display an image within the BEGIN_PGML/END_PGML environment.

For example, the library problem Library/Valdosta/APEX_Calculus/1.4/APEX_1.4_12.pg does not render

Within the PGML environment, the problem has the line of code

>> [![$alttext]!]{$graph1}{400} <<

which produces warning messages when the problem is compiled.  The warning messages are

PG warning messages

---- PGML (eval 1709) 1504 ------
Errors parsing PGML:
Error: extra option '400'
Warning: unknown block type 'image' in PGML::Format::html::format

Warning messages

  • Use of uninitialized value $string in string eq at line 928 of [PG]/macros/PGML.pl
Similar error messages are produced by other OPL problems that use the PGML macro to display images. 

Do you have a recommendation for how to fix this issue?

In reply to Jennifer Thorenson

Re: Error using PGML macro

by Alex Jordan -
The current version of WeBWorK is 2.18, since summer of 2023. (And this coming summer, 2.19 will be released.) The current version of the OPL has problems that use features that were only developed for 2.18 (and beyond, of course). For example the PGML that you cited here was only added in version 2.18.

If you are not able to upgrade WeBWorK to 2.18, you could consider downgrading your OPL. There is a "v2023-04-30" tag that you could check out. Or you you could rewind commits in the OPL back to a bit later, sometime in summer 2023. Then there should be no 2.18 features in the OPL.
In reply to Alex Jordan

Re: Error using PGML macro

by Glenn Rice -

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.