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 just matches against the
translated names.

This fixes issue #1093.
  • Loading branch information
drgrice1 committed Nov 30, 2023
1 parent 1c7df28 commit 92528cc
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions lib/WeBWorK/ContentGenerator/Instructor/UserList.pm
Original file line number Diff line number Diff line change
Expand Up @@ -287,10 +287,10 @@ sub filter_handler ($c) {
for my $userID (@{ $c->{allUserIDs} }) {
if ($field eq 'permission') {
push @matchingUserIDs, $userID
if ($permissionLabels{ $allUsers{$userID}{permission} } =~ /^$regex/i);
if $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 $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 92528cc

Please sign in to comment.