Skip to content

Commit 539a714

Browse files
committed
Remove student statistics.
The student statistics and student progress page are identical. Remove the student statistics version of the page, since the page doesn't provide any summary of the data, and only shows a student's number of attempts and grade.
1 parent 82fdf2d commit 539a714

File tree

9 files changed

+27
-83
lines changed

9 files changed

+27
-83
lines changed

lib/WeBWorK/ContentGenerator/Instructor/Index.pm

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -80,13 +80,6 @@ sub pre_header_initialize ($c) {
8080
} else {
8181
push @error, E_ONE_SET;
8282
}
83-
} elsif (defined $c->param('user_stats')) {
84-
if ($nusers == 1) {
85-
$route = 'instructor_user_statistics';
86-
$args{userID} = $firstUserID;
87-
} else {
88-
push @error, E_ONE_USER;
89-
}
9083
} elsif (defined $c->param('set_stats')) {
9184
if ($nsets == 1) {
9285
$route = 'instructor_set_statistics';

lib/WeBWorK/ContentGenerator/Instructor/Stats.pm

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -43,9 +43,7 @@ sub initialize ($c) {
4343
)
4444
];
4545

46-
if ($c->current_route eq 'instructor_user_statistics') {
47-
$c->{studentID} = $c->stash('userID');
48-
} elsif ($c->current_route =~ /^instructor_(set|problem)_statistics$/) {
46+
if ($c->current_route =~ /^instructor_(set|problem)_statistics$/) {
4947
my $setRecord = $db->getGlobalSet($c->stash('setID'));
5048
return unless $setRecord;
5149
$c->{setRecord} = $setRecord;
@@ -67,9 +65,7 @@ sub page_title ($c) {
6765

6866
my $setID = $c->stash('setID') || '';
6967

70-
if ($c->current_route eq 'instructor_user_statistics') {
71-
return $c->maketext('Statistics for student [_1]', $c->{studentID});
72-
} elsif ($c->current_route eq 'instructor_set_statistics') {
68+
if ($c->current_route eq 'instructor_set_statistics') {
7369
return $c->maketext('Statistics for [_1]', $c->tag('span', dir => 'ltr', format_set_name_display($setID)));
7470
} elsif ($c->current_route eq 'instructor_problem_statistics') {
7571
return $c->maketext(
@@ -79,7 +75,7 @@ sub page_title ($c) {
7975
);
8076
}
8177

82-
return $c->maketext('Statistics');
78+
return $c->maketext('Set Statistics');
8379
}
8480

8581
sub siblings ($c) {

lib/WeBWorK/Utils/Routes.pm

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,6 @@ PLEASE FOR THE LOVE OF GOD UPDATE THIS IF YOU CHANGE THE ROUTES BELOW!!!
8686
instructor_statistics /$courseID/instructor/stats
8787
instructor_set_statistics /$courseID/instructor/stats/set/$setID
8888
instructor_problem_statistics /$courseID/instructor/stats/set/$setID/$problemID
89-
instructor_user_statistics /$courseID/instructor/stats/student/$userID
9089
9190
instructor_progress /$courseID/instructor/progress
9291
instructor_set_progress /$courseID/instructor/progress/set/$setID
@@ -483,7 +482,7 @@ my %routeParameters = (
483482
},
484483
instructor_statistics => {
485484
title => x('Statistics'),
486-
children => [qw(instructor_set_statistics instructor_user_statistics)],
485+
children => [qw(instructor_set_statistics)],
487486
module => 'Instructor::Stats',
488487
path => '/stats'
489488
},
@@ -498,11 +497,6 @@ my %routeParameters = (
498497
module => 'Instructor::Stats',
499498
path => '/<problemID:num>'
500499
},
501-
instructor_user_statistics => {
502-
title => '[_1]',
503-
module => 'Instructor::Stats',
504-
path => '/student/#userID'
505-
},
506500
instructor_progress => {
507501
title => x('Student Progress'),
508502
children => [qw(instructor_set_progress instructor_user_progress)],

templates/ContentGenerator/Base/links.html.ep

Lines changed: 3 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -221,31 +221,8 @@
221221
% # Statistics
222222
<li class="list-group-item nav-item">
223223
<%= $makelink->('instructor_statistics') %>
224-
% if ($userID ne $eUserID || defined $setID || defined $urlUserID) {
225-
<ul class="nav flex-column">
226-
% if (defined $urlUserID) {
227-
<li class="nav-item">
228-
<%= $makelink->(
229-
'instructor_user_statistics',
230-
text => $urlUserID,
231-
captures => { userID => $urlUserID },
232-
link_attrs => { dir => 'ltr' }
233-
) %>
234-
</li>
235-
% }
236-
% if ($userID ne $eUserID && (!defined $urlUserID || $urlUserID ne $eUserID)) {
237-
<li class="nav-item">
238-
<%= $makelink->(
239-
'instructor_user_statistics',
240-
text => $eUserID,
241-
captures => { userID => $eUserID },
242-
active => current_route eq 'instructor_user_statistics'
243-
&& !defined $urlUserID,
244-
link_attrs => { dir => 'ltr' }
245-
) %>
246-
</li>
247-
% }
248-
% if (defined $setID) {
224+
% if (defined $setID) {
225+
<ul class="nav flex-column">
249226
<li class="nav-item" dir="ltr">
250227
<%= $makelink->(
251228
'instructor_set_statistics',
@@ -270,8 +247,7 @@
270247
</ul>
271248
</li>
272249
% }
273-
% }
274-
</ul>
250+
</ul>
275251
% }
276252
</li>
277253
% # Student Progress
Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,22 @@
11
% use WeBWorK::Utils qw(getAssetURL);
2+
% use WeBWorK::Utils::Sets qw(format_set_name_display);
23
%
34
% unless ($authz->hasPermissions(param('user'), 'access_instructor_tools')) {
45
<div class="alert alert-danger p-1"><%= maketext('You are not authorized to access instructor tools') %></div>
56
% last;
67
% }
78
%
8-
% if (current_route eq 'instructor_user_statistics') {
9-
% # Stats and StudentProgress share this template.
10-
<%= include 'ContentGenerator/Instructor/Stats/student_stats' =%>
11-
% } elsif (current_route eq 'instructor_set_statistics') {
9+
% if (current_route eq 'instructor_set_statistics') {
1210
<%= $c->set_stats =%>
1311
% } elsif (current_route eq 'instructor_problem_statistics') {
1412
<%= $c->problem_stats =%>
1513
% } else {
16-
% # Stats and StudentProgress share this template also.
17-
<%= include 'ContentGenerator/Instructor/Stats/index',
18-
set_header => maketext('View statistics by set'),
19-
student_header => maketext('View statistics by student') =%>
14+
<ul dir="ltr">
15+
% for ($db->listGlobalSetsWhere({}, 'set_id')) {
16+
<li>
17+
<%= link_to format_set_name_display($_->[0]) =>
18+
$c->systemLink(url_for("instructor_set_statistics", setID => $_->[0])) =%>
19+
</li>
20+
% }
21+
</ul>
2022
% }

templates/ContentGenerator/Instructor/StudentProgress.html.ep

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,9 @@
44
% }
55
%
66
% if (current_route eq 'instructor_user_progress') {
7-
% # Stats and StudentProgress share this template.
8-
<%= include 'ContentGenerator/Instructor/Stats/student_stats' =%>
7+
<%= include 'ContentGenerator/Instructor/StudentProgress/student_progress' =%>
98
% } elsif (current_route eq 'instructor_set_progress') {
109
<%= $c->displaySets =%>
1110
% } else {
12-
% # Stats and StudentProgress share this template also.
13-
<%= include 'ContentGenerator/Instructor/Stats/index',
14-
set_header => maketext('View student progress by set'),
15-
student_header => maketext('View student progress by student') =%>
11+
<%= include 'ContentGenerator/Instructor/StudentProgress/index' =%>
1612
% }

templates/ContentGenerator/Instructor/Stats/index.html.ep renamed to templates/ContentGenerator/Instructor/StudentProgress/index.html.ep

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,17 @@
1-
% # Note that this template is used by both WeBWorK::ContentGenerator::Instructor::Stats and
2-
% # WeBWorK::ContentGenerator::Instructor::StudentProgress.
3-
%
41
% use WeBWorK::Utils::Sets qw(format_set_name_display);
52
%
6-
% my $type = current_route =~ s/instructor_//r;
7-
%
83
% stash->{footerWidthClass} = 'col-lg-10 col-sm-12';
94
%
105
<div class="row">
116
<div class="col-lg-5 col-sm-6 mb-2">
127
<div class="card h-100">
138
<div class="card-body p-2">
14-
<h2 class="card-title text-center fs-3"><%= $set_header %></h2>
9+
<h2 class="card-title text-center fs-3"><%= maketext('View student progress by set') %></h2>
1510
<ul dir="ltr">
1611
% for ($db->listGlobalSetsWhere({}, 'set_id')) {
1712
<li>
1813
<%= link_to format_set_name_display($_->[0]) =>
19-
$c->systemLink(url_for("instructor_set_$type", setID => $_->[0])) =%>
14+
$c->systemLink(url_for("instructor_set_progress", setID => $_->[0])) =%>
2015
</li>
2116
% }
2217
</ul>
@@ -26,12 +21,12 @@
2621
<div class="col-lg-5 col-sm-6 mb-2">
2722
<div class="card h-100">
2823
<div class="card-body p-2">
29-
<h2 class="card-title text-center fs-3"><%= $student_header %></h2>
24+
<h2 class="card-title text-center fs-3"><%= maketext('View student progress by student') %></h2>
3025
<ul>
3126
% for (@{ $c->{student_records} }) {
3227
<li>
3328
<%= link_to $_->last_name . ', ' . $_->first_name . ' (' . $_->user_id . ')' =>
34-
$c->systemLink(url_for("instructor_user_$type", userID => $_->user_id)) =%>
29+
$c->systemLink(url_for("instructor_user_progress", userID => $_->user_id)) =%>
3530
</li>
3631
% }
3732
</ul>

templates/ContentGenerator/Instructor/Stats/student_stats.html.ep renamed to templates/ContentGenerator/Instructor/StudentProgress/student_progress.html.ep

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,3 @@
1-
% # Note that this template is used by both WeBWorK::ContentGenerator::Instructor::Stats and
2-
% # WeBWorK::ContentGenerator::Instructor::StudentProgress.
3-
%
41
% use WeBWorK::ContentGenerator::Grades;
52
%
63
% my $studentRecord = $db->getUser($c->{studentID});
Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,9 @@
11
% layout 'help_macro';
22
% title maketext('Statistics Help');
33
%
4-
<p>
5-
<%= maketext('The main page allows access to set and student statistics. When selecting a student, their grades '
6-
. 'page is shown, which lists set totals and per problem grades for each set assigned to the student. When '
7-
. 'selecting a set, various statistics and histograms are shown for the overall grades of students who are '
8-
. 'currently enrolled or auditing the course.') =%>
9-
</p>
104
<p class="mb-0">
11-
<%= maketext('When viewing set statistics, the drop down menus can be used to show stats for individual sections, '
12-
. 'recitations, or problems. The overall results include all students who are assigned to the set, while the '
13-
. 'individual problem results only include active (have attempted the problem) students.') =%>
5+
<%= maketext('Display full set or problem statistics. The main page lists all sets to view. When viewing '
6+
. 'set statistics, the drop down menus can be used to show stats for individual sections, recitations, or '
7+
. 'problems. The overall results include all students who are assigned to the set, while the individual '
8+
. 'problem results only include active (have attempted the problem) students.') =%>
149
</p>

0 commit comments

Comments
 (0)