Skip to content

WeBWorK 2.21 Release Candidate#2940

Open
drgrice1 wants to merge 332 commits into
mainfrom
WeBWorK-2.21
Open

WeBWorK 2.21 Release Candidate#2940
drgrice1 wants to merge 332 commits into
mainfrom
WeBWorK-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.

drgrice1 and others added 30 commits September 8, 2025 14:48
This only causes an issue when debug_lti_grade_passback is set, but is
an obvious typo that needs to be fixed.
The `can_use` method of the `NoReducedCred.pm` achiievent item returns 0
unless the condition for which it can be used is true, and then there is
no follow up return value for the case that the condition is true.  As a
result the method always returns a false value.  Thus the achievement
item can never be used.

Since the result of the `can_use` method is used in a purely boolean
fashion it should just return the condition result.
…n tests.

This fixes issue #2808.

See that issue and my comment at #2808 (comment)
for an explanation of this fix.
…erval

Cap the delay on the interval that the server time delta is updated in tests.
Fix an error that makes the `NoReducedCred` achievement item unusable.
Fix checkSet to honour the ignoreMissingSourcedID setting
…eck boxes.

To fix this `returning => 1` needs to be added to the parameters.

This fixes issue #2800.
The following dependencies are updated:

* @fortawesome/fontawesome-free: 6.52 -> 7.0.0
* bootstrap: 5.3.3 -> 5.3.7
* iframe-resizer: 4.3.11 -> 4.4.2
* jquery-ui-dist: 1.13.2 -> 1.13.3
* luxon: 3.4.4 -> 3.7.1
* sortablejs: 1.15.2 -> 1.15.6
* autoprefixer: 10.4.19 -> 10.4.21
* chokidar: 3.6.0 -> 4.0.3
* cssnano: 6.1.2 -> 7.1.0
* postcss: 8.4.38 -> 8.5.6
* prettier: 3.2.5 -> 3.6.2
* rtlcss: 4.1.1 -> 4.3.0
* sass: 1.75.0 -> 1.90.0
* terser: 5.30.4 -> 5.43.1
* yargs: 17.7.2 -> 18.0.0

All libraries except for `iframe-resizer` are at their latest versions.
The `iframe-resizer` library has changed considerably and upgrading to
the latest version requires quite a few changes. Furthermore, they now
have a commercial license version (which requires purchase) and an open
source license version. We can use the open source version, but there
are some annoying things that they do with that (like console logs that
you can't prevent). I have chosen the last version available before
things went haywire and `iframe-resizer` started doing stupid things.

Note that the there are two changes to the the generate-assets.js script
that were needed. There is a change in how yargs is used, and an option
needed to be added to the `sass.compile` call to disable warnings about
deprecated sass usage in Bootstrap's scss.
"byC mment()" -> "byComment()"
…ort-fix-develop

Fix sort by comment descending in Accounts Manager
The buttons go to the next or previous page.  If there is only one
problem per page, then the buttons are "Previous Problem" and "Next
Problem" buttons.  Otherwise they are "Previous Page" and "Next Page"
buttons.  These buttons are shown below the page/problem navigation
links and like those links are shown both at the top and bottom of the
page.  This means that these buttons are above the "Grade Test" button
at the bottom of the page, making it much clearer to students that there
are more problems than those shown on the page.

Note these buttons are not shown if all problems are on one page.

This was requested in issue #2814.

Also fix a couple of HTML validation issues that I observed.

First, the "preview answer" buttons had a `data_page_number` attribute.
The underscores are not the valid format for data attributes.  They
should be hyphens. I.e., kebab case, not snake case.  This was caused by
using the incorrect format for the data attribute argument to the
`link_to` method.  This was my fault and was done when I initially
converted to Mojolicious.

The other issue only occurs when the number of problems in the test is
not evenly divisible by the number of problems per page.  This resulted
in the wrong number of columns in the problem/page navigation links
table for the `colgroup` definition of the last column.
Fix the filter on the student progress page not honoring unchecked check boxes.
Add previous and next buttons to tests.
… page.

This is a quick fix that will make things function for now, and is good
for a hotfix.  This just reverts all of the fields that were switched to
number inputs and that have labels for special negative values back to
text inputs and the functionality prior to WeBWorK 2.20.

The fields that do not have those labels can still be number inputs.
That will work fine for those.

Also set the default for showMeAnother to the "Course Default" instead
of "Never" which is what it should be.

This resolves issue #2820 for the current release.

We can try to do better for the next release, but I don't see any other
easy way to fix this that is appropriate for a hotfix.
…ber-settings

Revert number inputs for fields with labels on the problem set detail page.
Fix many typos in the code.
If `only_full_group_by` is included in the `sql_mode` mysql settings,
then attempting to view problems in the library browser results in an
exception with a message like `DBD::MariaDB::db selectall_arrayref
failed: 'webwork.pgf.morelt_id' isn't in GROUP BY at
/opt/webwork/webwork2/lib/WeBWorK/DB/Database.pm line 137.`

This just adds a `MAX` call to the columns of the `OPL_pgfile` table
that are selected in the `GROUP BY` call, and eliminates the exception.
The resulting data that is returned in the query is the same as before
since these columns will all hold the same data for the grouped
`filepath` results.  This is really just working around poor design in
the OPL table structure.

This has been noted a few times in the forums recently.  See, for
instance, the latest posts in
https://forums.openwebwork.org/mod/forum/discuss.php?d=8757#p22352.

To test this set

```
sql_mode = "ONLY_FULL_GROUP_BY,STRICT_TRANS_TABLES,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION"
```

in the `/etc/mysql/conf.d/mysql.cnf` file and execute `sudo systemctl restart msyql`.
With the shown value for `sql_mode` and the develop or main branches you
will get the exception when you try to view problems in the library
browser, but will not with this pull request.

Note that the value for `sql_mode` above seems to be the default for
MariaDB if `ONLY_FULL_GROUP_BY` is removed. At least that is the case on
my system.  You can execute `select @@sql_mode` in mysql to see what the
settings are for your system.  The default for MySQL does include
`ONLY_FULL_GROUP_BY` (at least if I am reading things right).
I had the math wrong in #2818.  It is correct if the number of problems
does not evenly divide the number of problems per page, but if it does
then the modulus returns 0.  In that case it should also use the number
of problems per page.
Fix the math in the test page navigation.
Fix issues when the sql_mode includes the only_full_group_by setting.
The content generator `hidden_authen_fields` method should be called in
all page forms, but was not added ot the form in the LTI update page.
As a result if you are acting as a student, go to that page, and click
"Update Grades", then the acting ceases. Even worse, if
`session_management_via` is set to "key", and you click "Update Grades",
then you are sent to the login page, and have to login again in order
for the form to submit.  I missed this when this page was created.
@somiaj observed the issue when acting as another user on the page.
First, fix a general issue when a problem fails to render that results
in a message that has no relation to the actual problem. The issue is
that the `create_ans_str_from_responses` method of the
`WeBWorK::Utils::ProblemProcessing` module is called with a `$pg` hash
that doesn't contain the right things, and the method is not safe
guarded against that. This fixes issue #2829.

Second, rework how error handling is done in tests.  Instead of just
rendering the errors for problems that failed to render, still render
all problems on the page.  Show the errors for the problems that failed,
but still render all of the problems that didn't fail.  This means, that
the problem navigation is still shown.   In fact the entire page renders
normally, but the error message is shown for the problems that fail to
render.  So the student can at least continue to work the rest of the
test normally.  The student can even grade the test on a page for which
a problem fails to render.

Note that the "request information" is no longer shown for these
messages when in a test.  A special `briefErrorOutput` stash value can
be set when the `templates/ContentGenerator/Base/error_output.html.ep`
template is rendered to skip that. Although, I really thing that
information should never be shown in the page for any exception that
occurs. I don't think that the time, method, uri, and HTTP headers of
the request, ever help with these exceptions.
Add the hidden authentication fields to the LTI update form.
…lure

Rework error handling when a problem fails to render in a test.
For the most part, there isn't much that is needed.  The javascript
files are no longer in the `es5` subdirectory, and the workaround for
changing the math renderer was removed (as noted in the comment above
it).

The `mathInteraction.pg` problem in the student orientation has been
updated, although further updates may be needed. The screen shots the
problem uses were updated, but someone else might need to create better
screen shots.  Mine seem to have come out quite a bit smaller than the
previous ones.

I removed the rather old examples of the `$pg{specialPGEnvironmentVars}{problemPreamble}`
 and `$pg{specialPGEnvironmentVars}{problemPostamble}` variables in
`defaults.config` and `localOverrides.conf.dist` that include examples
of doing things with MathJax that weren't even valid for MathJax 3. I
also made the deprecation statement for that variables stronger.

There is a minor css tweak in `system.scss` to ensure that the MathJax
expression eplorer help dialog is above the masthead and stick problem
navigation bar.

Further modification to the MathJax configuration (in
`htdocs/js/MathJaxConfig/mathjax-config.js`) may be needed as per the
discussion in issue #2828.  But that can wait until we have more
information.
Update MathJax to version 4.0.
There have been requests to either remove this extension or at least
make it so that those editing problems do not have it loaded, as it
makes it easier to determine what is wrong with TeX in a problem.

This pull request just removes the `noerrors` MathJax extension. So TeX
errors are shown for all users.

I am not sure why this package was added. It seems that I added it when
I upgraded from MathJax version 2 to version 3, but I don't remember
why.  Perhaps it was just in the configuration that @dpvc recommended,
or maybe I added it for some reason.  Perhaps it was just about
maintaining compatibility with version 2 of MathJax.  For version 2 (as
I understand it), the `noerrors` extension was included by default, but
with MathJax version 3 it must be explicitly loaded.

The change from the `webwork_url` to the `webwork_js_config` method in
the `WeBWorK::ContentGenerator` module is not needed for this, but
should be made anyway.  There is also a `webwork_url` method in the
`Mojolicious::WeBWorK` module that is already available for all
controller modules (since it is a Mojolicious helper method), and having
this other one overrides that one and it is confusing to have both that
return almost the same value.  The only difference is that
`WeBWorK::ContentGenerator` method called the `location` helper which
returns the empty string if the root URL is '/', and the `webwork_url`
helper returns '/' in that case. I don't know what I was thinking
creating the `WeBWorK::ContentGenerator` method which was really just an
alies for the `location` helper method anyway.
drgrice1 and others added 30 commits April 21, 2026 15:25
Fix Resurrect Achievement Items
PGProblemEditor: Add option to copy auxiliary files.
…tips

Fix the reference link tooltips on the PG Problem Editor page.
Fix a minor issue with the datepicker.
Properly scope the `.sortable-ghost` style for the problem set detail page.
Completely remove the `courseOptions` option for the `addCourse` method.
This is the same one that the dependabot made a pull request to main
for except goes to the lates version of postcss.
Remove PRINT_FILE_NAMES_FOR and PRINT_FILE_NAMES_PERMISSION_LEVEL
The `addcourse` script does not use a database object to create a user
record.  Instead it directly calls `WeBWorK::DB::Record::User->new(%record)`.
So if the `%record` hash does not have the `accommodation_time_factor`
key set, then the script errors out when it attempts to create a user.
So make sure that is set.
…ime-factor-issue

Fix an issue with the `addcourse` script.
Update the version to 2.21 and the copyright years to include 2026.
…e a password.

It is now the case that a user is not required to have a password record
in the database.  However, the `change_user_id` script was never updated
for that case.  So an exception is thrown if the script is used for a
user that does not have a password record (for example a user created
via LTI authentication).

Note that perltidy has also been run on the file. The script does not
have the `.pl` extension and so the workflow doesn't check this file and
the `run-perltidy.pl` script doesn't attempt to format it.  Hide
whitespace changes to see the important change (there is also some clean
up of the comments at the beginning of the file).

Also fix the check for the type of a database record in the `checkArgs`
method of `lib/WeBWorK/DB.pm`.  Just because a variable is a `ref` does
not mean that it is an object for which the `isa` method can be called.
The proper check is `blessed $obj && $obj->isa('Package')`.  Note the
defined check was unnecessary in any case. This prevented the error in
the script from giving more useful information.  Instead it complained
about the inability to call `isa` when it should have given the intended
error message from this check.
If the total weight of a set is zero, due to either no
problems in a set or weights set to zero, these items
cause a division by zero not allowing a user to see the
associated ProblemSet page.

This returns 0 in the can_use methods before dividing by
zero in this case, fixing the issue.
The `can_recordAnswers` method of the `WeBWorK::ContentGenerator::GatewayQuiz`
package can not call any of the `WeBWorK::ContentGenerator::GatewayQuiz`
methods because it is called directly by the `WeBWorK::ContentGenerator::LoginProctor`
module without a `WeBWorK::ContentGenerator::GatewayQuiz` object.
Attempting to do so will cause an exception.

This is a bit annoying as the conditions of the `can_gradeUnsubmittedTest`
method (including the conditions of the `can_showProblemGrader` method
it calls) must be directly used by the `can_recordAnswers` method. There
is no way around that though.

This definitely should be considered for a hotfix.
…structor.

When an instructor uses the "Grade Test for" button and the test is on
its final submission, currently the grading occurs, but the test is
still set as a proctored test.

To fix this the condition that determines if the assignment type should
be changed needs to check the `$can{recordAnswers}` value in the case
that the `$userID` and `$effectiveUserID` are different.  In that case
`$can{recordAnswers}` is the result of the `can_recordAnswers` method
which will be true if either the user has the
`record_answers_when_acting_as_student` permission or the user can grade
an unsubmitted test.

This fixes issue #2962.

The `GatewayQuiz.pm` module is really so convoluted at this point that
it is really becoming impossible to do anything with, and is in
desperate need of a complete overhaul and rewrite. Any time any new
feature is added to the module or change is made to the module it is
almost impossible to go through all of the possibilities and ensure you
haven't broken something.
This was done for the student nav elsewhere but missed here.
Brackets in a string that are intended to be literal brackets need to be
escaped.

To test this earn the "Mysterious Package (with Ribbons)" achievement
reward, make sure the `templates/achievements/surprise_message.txt` file
does NOT exist, and then open a problem set page.  With the WeBWorK-2.21
release candidate branch an exception is thrown.

This particular bug apparently has been there since 2015.
Fix an invalid localization string in a maketext call.
Fix grading proctored tests that require proctor authorization to do so.
…-test

Make sure that a proctored test becomes unproctored when graded by instructor.
Fix the active colors of the selected test or filter in the test nav.
Fix division by zero in {Full,Half}CreditSet Items.
Fix the `change_user_id` script for the case that a user does not have a password.
The colors for this were inline style.  Colors cannot be inline anymore
since the server cannot detect if the user will have the browser in dark
mode or not.  So this switches to using Bootstrap alerts instead.
Fix colors on the proctor login page for dark mode. (Bootstrap alert aproach)
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.

7 participants