Skip to content

PG 2.21 Release Candidate#1393

Open
drgrice1 wants to merge 299 commits into
mainfrom
PG-2.21
Open

PG 2.21 Release Candidate#1393
drgrice1 wants to merge 299 commits into
mainfrom
PG-2.21

Conversation

@drgrice1

Copy link
Copy Markdown
Member

This is the release candidate for WeBWorK 2.21. Please re-target any pull requests that you want to get into the release for this branch.

jeis4wpi and others added 30 commits September 17, 2025 16:12
…sion to molecular form, and allow comparisons based on molecular forms, better handling of charges
Fix typo in POD generation of parserCheckboxList.pl
See issue #1301 for details of the changes and examples to test with.
Fix issues with the legacy NumberWithUnits.
The `format_matrix_HTML` method uses `span` tags to format the html
output for matrices. This is a problem when that is used to format the
output for an `ans_array` answer because the answer inputs inside now
are wrapped in `div` tags (so that the feedback button works in a valid
html way).  So this just switches to using `div`s instead.  This doesn't
change the result at all since the containg array layout div already has
`display:inline-block` set.

There is one minor tweak to the style.  I added `text-align:center;` to
the cells.  This just looks better in about all of the cases that I have
observed. Note that this is also consistent with when these objects are
displayed in math mode via MathJax or as an image with the image display
mode.

Note that method is used ans_array matrix, vector, and point answer
rules, as well as the "Entered" feedback preview of the student answer
for those answers. It also affects the "textual" correct answer, but
that actually isn't used for anything anymore.
openwebwork/mathquill#39 and
openwebwork/mathquill#40 have been merged and a
new version of @openwebwork/mathquill have been merged.  This updates to
the newly published version that includes those fixes.
Update the MathQuill version to pull in some fixes.
Fix invalid html for ans_array answers.
This fixes issue #1325.  The change is just what @dpvc suggested.  There
is a MWE posted in the issue.
Fix contextFraction.pl with reduceConstants disabled.
Remove badges that are basically broken.
Change all webwork.maa.org links to openwebwork.org
Currently if the display mode is "images", then the student and correct
answer previews don't work.  The images are never actually rendered,
thus the image files are never created, and so the `alt` value is shown
which is the original TeX for the answer.  The reason for this is that
the image generator runs before the post content processor runs.  So
equation images in the problem are rendered, but not those in the
feedback.  That was done because of the hack of inserting the string
`MaRkEr` followed by the image number hash when the image is initially
inserted into the problem text, and then later replacing that with the
alignment styel when the image is rendered. That results in invalid HTML
which `Mojo::DOM` doesn't like.

To fix the issue the `MaRkEr` hack is reworked.  Instead of that string,
a `data-imagegen-alignment-marker` attribute is used whose value is the
image number hash.  Since that is valid HTML, `Mojo::DOM` is fine with
it and leaves it as it is.  So the image generator can now be run after
the post content processor runs, and that renders the images in feedback
as well.

Care is needed for the images in feedback when the
`data-imagegen-alignment-marker` is replaced.  Since the rendered `img`
tag is inside the `data-bs-content` attribute of the feedback button, it
is HTML encoded.  So instead of double quotes, the HTML double quote
escape character (") is used.
The "type" attribute is also replaced for `ol` tags so that this can be
done in a nice way for all of the list types.  Note that although the
"type" attribute is not deprecated for `ol` tags, it is recommended to
use css instead in any case.
…aymode

Fix feedback previews when the display mode is "images".
Replace invalid "type" attribute on `ul` tag in PGML.
pstaabp and others added 30 commits June 9, 2026 09:56
Add horizontal overflow to `.problem-content` divs and solution and hint bodies.
Rework the `MathJax.typesetPromise` usage.
subMatrix method for Matrix Math Objects
A side effect of #1397 is that output (stdout and stderr) from system
calls is no longer suppressed. This was previously accomplished by
piping the output to `/dev/null`.  However, since those system commands
are no longer executed in a spawned shell, that cannot be done.

This suppresses the output generated by the execution of `dvisvgm` in
`LaTeXImage.pm` by adding the flat `--verbosity=0`.  This is specific to
this call, and errors or output from other system calls will still come
through, but this one is particularly annoying since it occurs when the
unit tests are run, and messes up the results output for the unit tests.
In the `removeRow` and `removeColumn` methods of `lib/Value/Matrix.pm`
check that the index is numeric before using it in a numeric comparison.

This causes warnings when the unit tests are run because the string
comparison is done last, and so the numeric comparisons are performed
with the string input.
Suppress output from `dvisvgm` in `LaTeXImage.pm`.
Check for a numeric value before using numerically.
Developers will need to install and use this version to match the
workflow.

Also update Github workflows to use node 24, and the actions in the
workflows to their newest versions. For now these are still running on
Ubuntu 24.04, since an official runner image for Ubuntu 26.04 has not
been released yet.  Also because there is a runner image, but some of
the rserve unit tests are failing with it.  Note that the rserve tests
are passing on my locak machine running Ubuntu 26.

The docker test build is updated to use Ubuntu 26.04.  The rserve tests
also are passing with this build.
allow empty containers in PGML
fully close most HTML tags in niceTables
don't try to remove a Matrix's only row (or only column)
This changes the feedback buttons in two ways.

1) Use copies of the bootstrap classes to color buttons. This way the
   feedback colors don't get changed by theming on the client side.
   The themes can still modify the actual classes used to change
   the buttons if desired, but the feedback buttons themselves can be
   themed independently of other bootstrap buttons.

2) Create a new feedback class "unknown" to use when showing the
   results of a problem with `$showPartialCorrectAnswers=0`. Currently
   on problems with limited feedback, it can be unclear to the student
   that they actually submitted the answer vs previewed the answer.
   This is accomplished by marking the buttons as incorrect if
   no answer is correct (0% on the problem), and marking them
   as "unknown" which shows a yellow button with a question mark
   in a circle if the problem is partially correct.
`$self` should be `$ans`.  It seems that I changed the third parameter
of the checker from `$self` to the more customary `$ans`, but forgot to
change the usage in the method. Since that is used to skip the adaptive
parameter check when the equivalence message post filter is called, if
you submit an answer that is incorrect, but differs by a constant, and
then submit the correct answer you get the message that "your answer is
equivalent to the previous answer" even though the previous answer was
incorrect, but the current answer is correct.
A missing space in the JSXGraph.pm package causes the `div` for the
JSXGraph image to have invalid attributes. It turns out this is fixed by
the `Mojo::DOM` xml parsing that occurs in the `post_process_content`
phase of the translator, and even if that doesn't fix it most browsers
handle this okay, but HTML validation doesn't like it.  In any case, it
should be fixed.
It should be correct == student.
These are both problems from https://wiki.openwebwork.org/wiki/Problem_Techniques
that demonstrate valid and current techniques in problems that were not
added before for some reason.

Add a `NamedAnswerRules.pg` problem that demonstrates how to use named
answer rules to add buttons to the MathQuill toolbar for the named rule.
This is an updated version of https://wiki.openwebwork.org/wiki/NamedAnswerRules.
With PG 2.21 the way to do so is changing.  So this is needed to
demonstrate the new way to do it.

Add an `AskSage.pl` problem that demonstrates how to use the `AskSage`
method to send a request to a Sage cell server. This is an updated
version of https://wiki.openwebwork.org/wiki/AskSage. Note that this
version of the problem depends on the changes in #1399. Also note that
without #1399 there is no hope for the `AskSage` method in general (so
lets get that merged).
Fix a minor html validity issue with the plots.pl macro.
Fix a typo in the AdaptiveParameters sample problem.
This add the fill_colors option to the add_barplot method.
Add two more problem technique sample problems.
This was added in #1432, but is causing problems.  If an answer rule is
contained in a `position: relative` parent, then the MathQuill toolbar
ends up being positioned correctly, but is contained inside the
`.problem-content` div, and so you need to scroll to the right to see
it. Note that the `.ww-feedback-container` is `position: relative`.  So
any answer inside a div with that class will have this issue.

An example problem for which the problem occurs is:

```
DOCUMENT();

loadMacros('PGstandard.pl', 'PGML.pl', 'parserMultiAnswer.pl', 'PGcourse.pl');

$ma = MultiAnswer(1, 2)->with(singleResult => 1);

BEGIN_PGML
[<
    Enter 1: [_]{$ma}{5}

    Enter 2: [_]{$ma}{5}
>]{ [ class => 'ww-feedback-container ww-fb-align-middle' ] }
END_PGML

ENDDOCUMENT();
```

Note that this is not a problem when using the problem editor, since the
width of the `.problem-content` div is the same as its parent.  So this
will need to be tested in an actual set.

For now the overflow is left for solutions and hints.  Those won't have
answer rules, and thus will also not have the MathQuill toolbar issue.

So a different way to fix the issue with dark text overflowing into the
dark region outside of the problem will need to be found.  Any ideas?
…overflow

Revert `overflow-x: auto` on `.problem-content` divs.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

8 participants