Skip to content

Commit

Permalink
Fix filtering the user list by permission level or status for other l…
Browse files Browse the repository at this point in the history
…anguages.

Currently when filtering by permission level or status the text entered
in the "Filter by what text?" field is matched against the untranslated
permission level name or status name.  As a result other languages must
enter the English names for these to match what is displayed translated
which is probably very confusing.  This now matches against the
translated names as well as the untranslated names.

This fixes issue #1093.
  • Loading branch information
drgrice1 committed Dec 5, 2023
1 parent 7d0f568 commit 82f1840
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
6 changes: 4 additions & 2 deletions lib/WeBWorK/ContentGenerator/Instructor/UserList.pm
Original file line number Diff line number Diff line change
Expand Up @@ -287,10 +287,12 @@ sub filter_handler ($c) {
for my $userID (@{ $c->{allUserIDs} }) {
if ($field eq 'permission') {
push @matchingUserIDs, $userID
if ($permissionLabels{ $allUsers{$userID}{permission} } =~ /^$regex/i);
if $permissionLabels{ $allUsers{$userID}{permission} } =~ /^$regex/i
|| $c->maketext($permissionLabels{ $allUsers{$userID}{permission} }) =~ /^$regex/i;
} elsif ($field eq 'status') {
push @matchingUserIDs, $userID
if ($ce->status_abbrev_to_name($allUsers{$userID}{status}) =~ /^$regex/i);
if $ce->status_abbrev_to_name($allUsers{$userID}{status}) =~ /^$regex/i
|| $c->maketext($ce->status_abbrev_to_name($allUsers{$userID}{status})) =~ /^$regex/i;
} else {
push @matchingUserIDs, $userID if $allUsers{$userID}{$field} =~ /^$regex/i;
}
Expand Down
2 changes: 1 addition & 1 deletion lib/WeBWorK/Localize.pm
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ our %Lexicon = (
x('ta'), x('professor'), x('admin'), x('nobody')
],

'_STATUS' => [ x('Enrolled'), x('Audit'), x('Drop'), x('Proctor') ],
'_STATUS' => [ x('Enrolled'), x('Audit'), x('Drop'), x('Proctor'), x('Observer') ],
);

1;

0 comments on commit 82f1840

Please sign in to comment.