Skip to content

WeBWorK 2.21 Release Candidate#2940

Open
drgrice1 wants to merge 306 commits intomainfrom
WeBWorK-2.21
Open

WeBWorK 2.21 Release Candidate#2940
drgrice1 wants to merge 306 commits intomainfrom
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 July 15, 2025 13:31
There are some new strings that have not been added to the pot file.
Currently the session parameters are set at the beginning of each
request.  However, if another request occurs for the same process before
the first request completes, then the session for the first request gets
saved with the parameters of the second request.  This is because there
is only one Mojoicious session setup for the entire app and the session
parameters are global for the process.

To fix this the session parameters need to be set again at the end of
the request just before the session is saved.

This is only an issue if there are multiple clients per worker process.
Of course that is not the case at this point, but hopefully will be some
day.
6% of minimum 1% translated source file: 'webwork2.pot'
on 'ru_RU'.

Sync of partially translated files: 
untranslated content is included with an empty translation 
or source language content depending on file format
23% of minimum 1% translated source file: 'webwork2.pot'
on 'de'.

Sync of partially translated files: 
untranslated content is included with an empty translation 
or source language content depending on file format
5% of minimum 1% translated source file: 'webwork2.pot'
on 'cs_CZ'.

Sync of partially translated files: 
untranslated content is included with an empty translation 
or source language content depending on file format
6% of minimum 1% translated source file: 'webwork2.pot'
on 'zh_HK'.

Sync of partially translated files: 
untranslated content is included with an empty translation 
or source language content depending on file format
7% of minimum 1% translated source file: 'webwork2.pot'
on 'zh_CN'.

Sync of partially translated files: 
untranslated content is included with an empty translation 
or source language content depending on file format
52% of minimum 1% translated source file: 'webwork2.pot'
on 'he_IL'.

Sync of partially translated files: 
untranslated content is included with an empty translation 
or source language content depending on file format
10% of minimum 1% translated source file: 'webwork2.pot'
on 'es'.

Sync of partially translated files: 
untranslated content is included with an empty translation 
or source language content depending on file format
12% of minimum 1% translated source file: 'webwork2.pot'
on 'hu'.

Sync of partially translated files: 
untranslated content is included with an empty translation 
or source language content depending on file format
34% of minimum 1% translated source file: 'webwork2.pot'
on 'fr_CA'.

Sync of partially translated files: 
untranslated content is included with an empty translation 
or source language content depending on file format
42% of minimum 1% translated source file: 'webwork2.pot'
on 'el'.

Sync of partially translated files: 
untranslated content is included with an empty translation 
or source language content depending on file format
11% of minimum 1% translated source file: 'webwork2.pot'
on 'ko'.

Sync of partially translated files: 
untranslated content is included with an empty translation 
or source language content depending on file format
12% of minimum 1% translated source file: 'webwork2.pot'
on 'fr'.

Sync of partially translated files: 
untranslated content is included with an empty translation 
or source language content depending on file format
Currently if the session has expired and one of the options in the
"Format Code" tabe is used in the PG problem editor, then the message
reads `Error: can't access property "status", t.result_data is
undefined` which is not very informative. This makes it so that the
error message in the response which is `Error: Authentication failed.
Log in again to continue.`

An easy way to test this is to open a problem in the problem editor,
delete the cookie for the session in the developer tools, and then
switch to the "Format Code" tabe and click the "Format Code" button.
If one of the course links that are now maintained by webwork points to
a location inside a non existent directory, then the `realpath` calls in
`lib/WeBWorK/Utils/CourseDirectoryIntegrityCheck.pm` throw exceptions.
This occurs both when checking for course upgrades and when upgrading
courses.  So those calls are wrapped in evals to prevent the exceptions.

I have identified this as the cause of the issue discussed in
https://forums.openwebwork.org/mod/forum/discuss.php?d=8757#p22321.

To test this delete the Contrib link in a course's templates directory,
and create a bad link with something like

```bash
sudo ln -s /bad/location /opt/webwork/courses/courseId/templates/Contrib
```

Then go to the "Upgrade Courses" page in the admin course.  It will give
an error with the current develop or main branches.  With this pull
request it will show that the link structure of the course needs repair.
Furthermore, repairing the link will work.
Allow @ in user id when adding new course.
Fix a `realpath` failure when resolving course symlinks.
…a launch request.

In this case the LTIAuthenError stash value is set, but that error is
never shown anywhere because the course ID was not determined and the
authen verify method is never called.  So this information goes to the
abyss and the debug log abrubtly terminates (see
https://forums.openwebwork.org/mod/forum/discuss.php?d=8749 for what
this debug log looks like).  So this pull request always debug logs it
in this case.  There is not enough information to even determine if LTI
debugging is enabled for the course (which the request failed to
determine), so it has to be the more general debug logging facility.
This may help in resolving the issues that are occuring with the cases
such as those in the above mentioned forum post and
https://forums.openwebwork.org/mod/forum/discuss.php?d=8738#p22228.
This is the maximum number of seconds that exp and iat values in the JWT
sent with a launch request are allowed to be in the future relative to
the current time on the webwork2 server.  The Crypt::JWT module by
default uses a value of 0 for this, meaning that the iat and exp values
in the token must be before the current time on the webwork2 server.

This may be why many are experiencing issues with JWT tokens failing to
validate, and is due to the clock on the LMS server being ahead of the
clock on the webwork2 server. Generally such issues can be resolved by
synchronizing clocks, but in some cases a small leeway may be needed.
Add an LTI 1.3 debug log in the case that the JWT fails to decode on a launch request.
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.
drgrice1 and others added 30 commits March 29, 2026 10:36
The `switchToBSStyle` method should be called on the `commonStyles` key
of the `CHTML` object rather than the object itself (which is actually a
function).
Fix an issue with MathJax CHTML mode.
Rework PG error/warning/debug message handling.
Add a point input field to set the problem score in the ProblemGrader.
This is the same as what is being used in the SingleProblemGrader,
and honors the same setting to show it or not. The input uses
JavaScript to update the actual score which is what is submitted
when the grader is saved. If the percent score is not shown, a hidden
field is used instead.

This also adds a step of 1 to the percent score and validation on
both the percent score and point score values.
Add point input to ProblemGrader.
First, remove the `div` with the `mb-3` class that I added to the `Email
Instructor` button in #2935.  I added it so that warnings or debug
messages are appropriately spaced after the button on the problem page.
However, the `feedback_macro_email.html.ep` template is used in other
places for which that margin causes issues (for example on the problem
set page).  Instead the `div` is added on the problem page, if the
button is to be shown.

Note that `problemFooter` div has been removed, since that isn't even
doing anything.

Also, the database access in the `output_past_answer_button` is skipped
if the button is not to be shown. I just saw this while working on the
area and realized that is bad.

Finally, the `h4` for the header of the achievement rewards dialog is
changed to an `h1`.  The css `h4` class is used to give the header the
same size and style.  Note that structurally a "modal dialog represents
its own separate document/context, so the .modal-title should ideally be
an `<h1>`." That is quoted from bootstraps [modal dialog
documentation](https://getbootstrap.com/docs/5.3/components/modal/).
show desired course ID in messages for when course does not exist
Fix some layout and validation issues.
With the current code if you are in a month that does not have a day
(such as April that does not have the 31st), one of those days is
selected in another month that does have that day, and you click the
"Today" button, then it doesn't go to today.  Instead it goes to the
date of today in the next month.  This is because the code sets the
year, month, and day for today on the selected date object and in that
order, and uses the modified selected date to set the flatpickr date.
So for example, if today is April 7, 2026, and the selected date is July
31, 2026, then the selected date's year is set to 2026, then the month
set to April.  So at that point the selected date is April 31, 2026,
which really becomes May 1, 2026.  Then the day is set, and so you get
May 7, 2026.

This fixes the issue by starting with todays date at 12:00 am, and then
setting the time of todays date to the time of the selected date, and
then using that to set the flatpickr date.
… page.

Currently that style is defined in the `system.scss` and is not scoped.
As a result it applies to most content generator pages of webwork2.  In
particular it applies to problem pages, and thus it affects draggable
proof problems which use the same sortablejs library with that same css
class.

Note that a related pull request to PG will change the styles for drag
and drop problems and this conflicts with that.  This is probably
already a problem because the opacity of 0.5 does make the drag and drop
elements in problems lack sufficient contrast. Although it only occurs
during a mouse drag and in that situation perhaps that contrast is not
necessary. Still I think there is a better way to do this for problems.

On a related note to the PG pull request, perhaps at some point keyboard
support should be added for reorganizing problems on the problem set
detail page.
When saving a problem in a new location in the PGProblemEditor,
add an option to copy auxiliary files or not. Since it is not
possible to determine what files are needed, all auxiliary files
were copied in all cases. This allows the user to uncheck the
"Copy auxiliary files" option to not copy any auxiliary files.

The default option is to copy auxiliary files which has not
changed. This only allows the user to disable that if they are
sure no auxiliary files are needed.

This also adds a check so the message about auxiliary files
being copied only shows if at least one file was copied.
Updated packages have been published, and this just updates the
package.json file to point to the latest version.

The dependencies of the `pg-codemirror-editor` and `codemirror-lang-pg`
packages were updated (largely to deal with security vulnerabilities in
the dependencies).

There is also a bug fixed with builtin operator names occuring as the
key of a hash. For example, the keys of the following hash are builtin
operators, but should not be interpreted as such in this context.

```perl
%hash = (
    step    => 1,
    defined => 1,
    split   => 1
);
```

Since they were the hask key value pair was not parsing, and so all
syntax highlighting after it is messed up.

The first key `step` is a PG operator, the second `defined` is a Perl
named unary operator, the third `split` is a Perl list operator.  Of
course any of the other PG operators, Perl named unary operators, or
Perl list operators had the same problem since they are all handled in
the code by the same external tokenizer.
This adds some spacing between the set link and the info icon to
make it accessible on small touch screens to give enough space to
touch the icon without hitting the link instead.
There is no longer a `pgwarning` key set on the controller object for
the `lib/WeBWorK/ContentGenerator/Problem.pm` module and never was a
`pgwarning` key for the returned pg object in the
`lib/ContentGenerator/GatewayQuiz.pm` module.  So use the correct key on
the returned pg object in both cases.  That is the `warning_messages`
key.

The warning messages were still being shown at the bottom, but not the
message at the top of the page notifying of the existence of those
warnings.  Since the warnings at the bottom might not be visible, the
warnings may be missed.
Co-authored-by: Glenn Rice <47527406+drgrice1@users.noreply.github.com>
Co-authored-by: Glenn Rice <47527406+drgrice1@users.noreply.github.com>
Co-authored-by: Glenn Rice <47527406+drgrice1@users.noreply.github.com>
I removed the `reference-link` class from these links in #2896.  That
was a mistake.  That class does do something.  It is what the javascript
uses to determine which links need the tooltips. So add those back.
Add horizontal padding to set info icon.
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.
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