Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

improvements to Instructor Tools #2266

Merged
merged 25 commits into from
Dec 4, 2023
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
35cf980
imporvements to Instructor Tools
Alex-Jordan Nov 28, 2023
03dfdeb
Implement suggestions made in my review of openwebwork/webwork2#2266
drgrice1 Nov 29, 2023
011bf55
Merge pull request #20 from drgrice1/instructor-tools-suggestions
Alex-Jordan Nov 29, 2023
3a3f9e8
Add more tools to Instructor Tools
Alex-Jordan Nov 30, 2023
5ce2f55
change 370px to 28em for Instructor Tools column width
Alex-Jordan Nov 30, 2023
f6d70e7
Change Instructor Tool form to pills navigation
Alex-Jordan Nov 30, 2023
b2ff4c2
some cleanup
Alex-Jordan Nov 30, 2023
299dd0b
adjust some wording
Alex-Jordan Dec 1, 2023
96f7d25
Style tweaks for the new tabbed layout of the instructor tools input …
drgrice1 Dec 1, 2023
b9c3656
Merge pull request #21 from drgrice1/instructor-tools-tweaks
Alex-Jordan Dec 1, 2023
48726ac
filter users by permission level or role
Alex-Jordan Dec 1, 2023
3aef0da
Efficiency tweak (a significant improvement for large classes).
drgrice1 Dec 1, 2023
32da067
Merge pull request #22 from drgrice1/instructor-tools-efficiency-tweak
Alex-Jordan Dec 1, 2023
90891a4
feedback from PR#2266
Alex-Jordan Dec 1, 2023
237df81
perltidy
Alex-Jordan Dec 1, 2023
cdcbe3a
ability to intersect or union filters
Alex-Jordan Dec 1, 2023
eb4a690
tweak filter radio buttons
Alex-Jordan Dec 1, 2023
9aabb31
More suggestions.
drgrice1 Dec 1, 2023
1d342f4
Merge pull request #23 from drgrice1/instructor-tools-more-tweaks
Alex-Jordan Dec 1, 2023
550ddd7
Between the `md` and `lg` breakpoint, drop out of the horizontal layout
drgrice1 Dec 1, 2023
6cf9147
Add `font-sm` to the union/intersect checkbox labels.
drgrice1 Dec 1, 2023
b7768a2
Also add a small tweak to make the selects on the Answer Log page closer
drgrice1 Dec 1, 2023
b7b296d
Merge pull request #24 from drgrice1/instructor-tools-perhaps
Alex-Jordan Dec 2, 2023
54e3587
update helpfiles where scrolling record list is used
Alex-Jordan Dec 2, 2023
07b04fd
fix indentation in some template files
Alex-Jordan Dec 2, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
More suggestions.
Switch the new `filterRecords` parameter to a boolean, and adjust the
radio values to make that easier to work with.

Place the radio buttons and labels in a horizontal layout below the
filter select.
  • Loading branch information
drgrice1 committed Dec 1, 2023
commit 9aabb313b1e5b8c77d70059e5542453002dc589f
2 changes: 1 addition & 1 deletion lib/WeBWorK/HTML/ScrollingRecordList.pm
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ sub scrollingRecordList ($options, @records) {
$c->param("$name!format") || $options{default_format},
sortRecords(
$c->param("$name!sort") || $options{default_sort} || (@$sorts ? $sorts->[0][1] : ''),
filterRecords($c, $c->param("$name!filter_combine") // 'intersect', \@selected_filters, @records)
filterRecords($c, $c->param("$name!filter_combine") // 0, \@selected_filters, @records)
)
);
}
Expand Down
10 changes: 5 additions & 5 deletions lib/WeBWorK/Utils/FilterRecords.pm
Original file line number Diff line number Diff line change
Expand Up @@ -148,11 +148,12 @@ sub getFiltersForClass {
return \@filters;
}

=item filterRecords($c, $filter_combine, $filters, @records)
=item filterRecords($c, $intersect, $filters, @records)

Given a list of filters and a list of records, returns a list of the records
after the selected filters are applied. C<$filter_combine> should be 'union'
or 'intersect'.
after the selected filters are applied. If C<$intersect> is true then the
intersection of the records that match the filters is returned. Otherwise the
union of the records that match the filters is returned.

C<$filters> should be a reference to an array of filters or be undefined.

Expand All @@ -161,7 +162,7 @@ C<$filters> should be a reference to an array of filters or be undefined.
=cut

sub filterRecords {
my ($c, $filter_combine, $filters, @records) = @_;
my ($c, $intersect, $filters, @records) = @_;

return unless @records;

Expand All @@ -180,7 +181,6 @@ sub filterRecords {
$c->db->getPermissionLevelsWhere({ user_id => { not_like => 'set_id:%' } }))
: ();

my $intersect = ($filter_combine eq 'intersect');
my @filteredRecords = $intersect ? @records : ();
if ($intersect) {
for my $filter (@filtersToUse) {
Expand Down
28 changes: 16 additions & 12 deletions templates/HTML/ScrollingRecordList/scrollingRecordList.html.ep
Original file line number Diff line number Diff line change
Expand Up @@ -14,23 +14,27 @@
</div>
</div>
<div class="row mb-2">
<div class="col-2">
<%= label_for "$name!filter" => maketext('Filter(s):'),
class => 'col-form-label col-form-label-sm pe-1 text-nowrap' =%>
<div class="form-check p-0">
<%= radio_button "$name!filter_combine" => 'intersect', id => "$name!intersect_check", checked => undef =%>
<%= label_for "$name!intersect_check" => maketext('Intersect'), class => 'col-form-label-sm p-1 pt-0' =%>
</div>
<div class="form-check p-0">
<%= radio_button "$name!filter_combine" => 'union', id => "$name!union_check" =%>
<%= label_for "$name!union_check" => maketext('Union'), class => 'col-form-label-sm p-1 pt-0' =%>
</div>
</div>
<%= label_for "$name!filter" => maketext('Filter(s):'),
class => 'col-form-label col-form-label-sm col-2 pe-1 text-nowrap' =%>
<div class="col-10">
<%= select_field "$name!filter" => $filters, id => "$name!filter", class => 'form-select form-select-sm',
multiple => undef, size => 5 =%>
</div>
</div>
<div class="row mb-2">
<div class="offset-2 col-10">
<div class="form-check form-check-inline">
<%= radio_button "$name!filter_combine" => 1, id => "$name!intersect_check", checked => undef,
class => 'form-check-input' =%>
<%= label_for "$name!intersect_check" => maketext('Intersect'), class => 'form-check-label' =%>
</div>
<div class="form-check form-check-inline">
<%= radio_button "$name!filter_combine" => 0, id => "$name!union_check",
class => 'form-check-input' =%>
<%= label_for "$name!union_check" => maketext('Union'), class => 'form-check-label' =%>
</div>
</div>
</div>
<div>
<%= submit_button $options->{refresh_button_name} // maketext('Refresh List'),
name => "$name!refresh", class => 'btn btn-secondary btn-sm mb-2' =%>
Expand Down