Skip to content

WeBWorK 2.21 Release Candidate - #2940

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

WeBWorK 2.21 Release Candidate#2940
drgrice1 wants to merge 542 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.

dlglin and others added 30 commits April 13, 2026 20:49
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.
Also, the `writeCourseConf` method doesn't need any arguments other than
the file handle anymore, so eliminate those.
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.
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.
drgrice1 and others added 30 commits July 16, 2026 09:49
…a555ba

Updates for file lib/WeBWorK/Localize/webwork2.pot in de [Manual Sync]
47% 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
…fe77ba

Updates for file lib/WeBWorK/Localize/webwork2.pot in he_IL [Manual Sync]
- `templates/ContentGenerator/Grades/problem_table.html.ep`: On line 40
  a `th` is closed with a `td`.
- `templates/HelpFiles/InstructorAchievementList.html.ep`: On line 76 a
  `dt` tag is closed with a `td`.
- `templates/ContentGenerator/Options.html.ep`: On line 170 a `legend`
  is closed with a `fieldset`.
- `templates/HelpFiles/InstructorScoring.html.ep`: Starting at line 18
  there is a `dl` nested inside a `p` which is invalid HTML. So end the
  `p` tag before the `dl` is started.
- `templates/ContentGenerator/Instructor/Scoring.html.ep`: The ending
  `dl` tag on line 96 should not be inside the for loop. This results in
   extraneous `dl` closings.
- `templates/ContentGenerator/Base/set_status.html.ep`: A `p` tag is
  incorrectly created using a string instead of a proper tag on line 11.
- `templates/ContentGenerator/ProblemSet.html.ep`: A `p` tag is created
  in a bad way on line 44.
- `templates/ContentGenerator/Instructor/ProblemSetList/set_list_row.html.ep`:
  A `tr` tag is started on line 16 that is never ended.  It should be
  ended at the end of the file.

The last two are not strictly HTML validation issues, and do work, but
they are not done in a good way.
Make the workflow work for Perl scripts without a Perl extension.
Make the color scheme chooser active theme check work.
First, the `lineitems` URL that is sent with any resource link (and even
for a deep linking request, i.e., a content selection request) is stored
in the course settings whenever one of those occur.  This `lineitems`
URL is unique for the external tool, and can be used to fetch a list of
all resource links that use the external tool. Then when any grade pass
back is performed this URL is used to get that list which includes the
`lineitem` URL for each specific resource link. That is the link that is
used for grade pass back for the set.  However, webwork needs to be able
to identify the set it belongs to.  Since it does not come from a
resource link launch the webwork2 set id is not available.  To fix this,
when deep linking is used to create a resource link, webwork now sets
the `resourceId` of the lineitem.  Note that this is a reserved value
for the tool provider, and the LMS (the tool consumer) is not supposed
to ever change it, and must send it when the `lineitems` URL is used.
Thus is deep linking is used to create a resource link to a set, then
grade pass back will be available immediately for that set without a
user ever using the link.

Second, implement LMS roster synchronization.  The requires that the
names and roles service be enabled for the external tool.  The
registration URL now includes the
`https://purl.imsglobal.org/spec/lti-nrps/scope/contextmembership.readonly`
scope which makes this so. Note that tools created manually without the
registration URL, this service can be enabled for the tool.  However, at
least for Canvas, if the tool was created using the registration URL
before this scope was added, the only way to add the scope is to have
the Canvas admin delete the tool and recreate it again using the
registration URL with what is in this pull request. Moodle still allows
editing of the tool created via the registration URL, so this can be
added later. In any case, if the names and roles service is enabled,
than any launch request (again including a deep linking request)
includes the `namesrolesservice` URL. That can be used to request the
list of users in the LMS course.  There is now a new tab that will
appear in the accounts manager if LTI 1.3 is enabled for a course, the
`preferred_source_of_username` is set, and this `namesrolesservice` URL
has been obtained (by some user using content selection or a resource
link).  When this tab is available and its action used, the list of
users in the LMS course will be obtained, and users will be created in
webwork that do not already exist, users will be updated that do exist
(if `LMSManageUserData` is true), and users not in the LMS course will
have their status changed to dropped.  Note that the data sent when
using the `namesrolesservice` URL is not the same as that sent in a
launch request.  So there are some new options that control what is used
for the username and student_id.  See the options and documentation in
`conf/authen_LTI_1_3.conf.dist`. Also note that this will never add,
update, or modify in any way any users that have a role that is above
the `LTIAccountCreationCutoff`.

Note that when users are created or updated via the tab in the accounts
manager and the `namesrolesservice` URL, the LMS `user_id` (or `sub`) is
included in the data received and saved to the `lis_source_did` column
for the user.  So this means that for links created via deep linking
with this pull request and users added or updated in this way, grade
pass back is available immediately, even if the user never logs in to
webwork via the LMS.

Also fix plurality of some texts for some other similar action results
in the accounts manager.

Unfortunately the message on the assignments page stating "You must
access this assignment from the LMS before you can start." is still
shown even if an instructor uses deep linking to create links in the
LMS.  The problem is that although grade passabck will work for those
sets, the lineitem URL is still not saved in the database for all of
those sets.  The lineitem is not obtained until grade pass back occurs
or as before, a user uses the link from the LMS. So those that create
all links via deep linking will most likely want to set
`$LTI{v1p3}{ignoreMissingSourcedID}` so that users are not shown that
message, and can access the sets. As such, I made that option one that
can be made available for instructors to set on the LTI tab in the
course configuration.

Third, implement set date synchronization with the LMS. Set dates can be
synchronized to or from the LMS. There is a new tab for this in the sets
manager that is shown if LTI 1.3 with homework grade pass back is
enabled and the general lineitems URL is available. Also there is a new
LTI 1.3 option `$LTI{v1p3}{autoSyncSetDatesToLMS}`. If this is true,
then anytime that dates are changed on the sets manager or problem set
detail pages, a job to synchronize dates to the LMS will automatically
be queued for the sets with dates changed.

Note that only the open and due (or close) dates have an equivalent in
the LTI specification, namely the start and end dates. So when
synchronizing from an LMS, the reduced scoring date and answer date are
adjusted if needed to make them fit into the dates received from the
LMS. Of course, when sending dates, only the open and due date are sent.

It is also important to note that date synchronization is not supported
by all LMSs.  Canvas does, but Moodle does not.  As usual, I don't know
what D2L or Blackboard support.

One related small change is that set dates are now also set when grade
pass back mode is homework and a link is created to a set via deep
linking.

Another small change to the deep linking response is that
`window => { targetName => '_blank' }` is set. This makes Canvas open
the links in a new window instead of being embedded in the page. This
does not work for Moodle, and as far as I can tell, there is no way to
make this happen from the deep linking response.  Fortunately for Moodle
users, the external tool can be set so that all links created that use
the external tool open in a new window.  Canvas on the other hand does
not have that.  So without this change, Canvas users that create links
have to go edit each link and change it to open in a new window.
…from the LMS optional.

According to the specification it is optional, and apparently D2L does
not send it.  Both Moodle and Canvas do.

Also make sure that the `placements` message parameter is only sent for
Canvas. Although Moodle ignores this parameter, D2L rejects the message
if the parameter is included.

Also add a `description` to the lti tool configuration, and a label to
the deep linking message.
If the new `$LTI{v1p3}{allowCourseSelection}` option is set to 1 and an
instructor attempts to sign in via LTI 1.3 authentication from an LMS
course that is not in the LTI course map for the site, then a list of
webwork courses will be compiled that have matching LTI 1.3 parameters,
that have a user that works for the LMS user with email_address set that
matches the email address sent from the LMS, and such that the user has
the access_instructor_tools and modify_problem_sets permissions. So it
is important that the email_address be set in the webwork courses for
the user. Also note that the LTI user id selection parameters
(`preferred_source_of_username`, `fallback_source_of_username`,
strip_domain_from_email`, and `lowercase_username`) have to be the same
for all matching courses (effectively the settings from the first course
found are used).

Then the user will be presented a list of courses to choose from (or if
only one matching course is found that course will be used). When the
user selects a course (or only on course matches), it will be
automatically added to the LTI course map, and then content selection
will continue as usual with that course.

For this to work, the user is authenticated into the first matching
course. Then if the user chooses a different course, that authentication
is transferred to the selected course. Authentication should work in any
of them since all of the matching courses have the same LTI 1.3
parameters and the user in each course has the same user id, email
address, and permissions.

If no matching courses are found or if the `$LTI{v1p3}{allowCourseSelection}`
option is set to 0, then the context id is shown as before.

Note that the `$LTI{v1p3}{allowCourseSelection}` is necessarily a site
wide option that cannot be configured per course.
This was requested by @dlglin, and restricts authentication into a
webwork course to only users in the LMS course that matches the context
id of the webwork course set in the LTI course map for the site.

If the new `$LTI{v1p3}{restrictAuthenticationByCourseMap}` option is set
to 1, then this restriction is in effect.
…hoice-plus-context-id-restrict

Restrict LTI authentication by LTI course map.
The only dependency that is updated that is not for the
`generate-assets.js` script is `@fortawesome/fontawesome-free` and there
do not seem to be any issues from that.  From their changelog the only
changes are new icons and some improvements to animations.

The `generate-assets.js` script still seems to be working fine, so the
development updates should be fine also.

The security vulnerabilities that just showed up were fixed with the
upgrade.
Co-authored-by: Claude <noreply@anthropic.com>
The label should be for the `otp_code` input, and not be for the
`confirmPassword` input above which already has a label.
Fix a cut and paste error in the reset password template.
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
… buttons in the File Manager

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
move the test navigation table into a nav element
add role="alert" to various alerts
use aria-labels, not alt text, on icons
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Make conditional release in the set details page use a select.
make screen reader announce Format as the group context for the radio…
make escape close navigation on narrow screen
Guidance for an instructor who has not set the LMS context ID
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.

9 participants