';
$Str .= ''.
&Apache::lonstatistics::SectionSelect('Section','multiple',5).
' | ';
+ $Str .= ''.
+ &Apache::lonstatistics::GroupSelect('Group','multiple',5).
+ ' | ';
$Str .= ''.
&Apache::lonhtmlcommon::StatusOptions(undef,undef,5).
' | ';
@@ -964,51 +638,61 @@ sub DisplayClasslist {
$r->print($Str);
$r->rflush();
#
- my @Fields = ('fullname','username','domain','id','section','status');
+ my @Fields = ('fullname','username','domain','id','section','status','groups');
#
$Str = '';
+ my @selected_sections = &get_selected_sections();
if (! @Students) {
- if ($SelectedSections[0] eq 'all') {
- if (lc($ENV{'form.Status'}) eq 'any') {
- $Str .= ''.
- &mt('There are no students in the course.').
- '
';
- } elsif (lc($ENV{'form.Status'}) eq 'active') {
- $Str .= ''.
+ if ($selected_sections[0] eq 'all') {
+ if (lc($env{'form.Status'}) eq 'active') {
+ $Str .= '
'.
&mt('There are no currently enrolled students in the course.').
- '';
- } elsif (lc($ENV{'form.Status'}) eq 'expired') {
- $Str .= '
'.
+ '';
+ } elsif (lc($env{'form.Status'}) eq 'expired') {
+ $Str .= '
'.
&mt('There are no previously enrolled students in the course.').
- '';
+ '
';
+ } elsif (lc($env{'form.Status'}) eq 'future') {
+ $Str .= ''.
+ &mt('There are no students with future access in the course.').
+ '
';
+ } else { # 'any' and any others
+ $Str .= ''.
+ &mt('There are no students in the course.').
+ '
';
}
} else {
- my $sections;
- if (lc($ENV{'form.Status'}) eq 'any') {
- $Str .= ''.
- &mt('There are no students in the selected sections.').
- '
';
- } elsif (lc($ENV{'form.Status'}) eq 'active') {
- $Str .= ''.
+ if (lc($env{'form.Status'}) eq 'active') {
+ $Str .= '
'.
&mt('There are no currently enrolled students in the selected sections.').
- '';
- } elsif (lc($ENV{'form.Status'}) eq 'expired') {
- $Str .= '
'.
+ '';
+ } elsif (lc($env{'form.Status'}) eq 'expired') {
+ $Str .= '
'.
&mt('There are no previously enrolled students in the selected sections.').
- '';
+ '
';
+ } elsif (lc($env{'form.Status'}) eq 'future') {
+ $Str .= ''.
+ &mt('There are no students with future access in the selected sections.').
+ '
';
+ } else { # 'any' and any others
+ $Str .= ''.
+ &mt('There are no students in the selected sections.').
+ '
';
}
}
- $Str.= ''.
- &mt('Click here to return to the chart').'';
+ $Str.= ''
+ .''
+ .&mt('Return to the chart').''
+ .'
';
$r->print($Str);
$r->rflush();
return;
}
- # "Click" is asinine but it is probably not my place to change the world.
- $Str .= 'Click on a students name or username to view their chart
';
- $Str .= ''."\n";
- $Str .= ''."\n";
+ $Str .= ''.&mt('Select One Student').''
+ .''.&mt("Click on a student's name or username to view their chart").' '
+ .&Apache::loncommon::start_data_table()
+ .&Apache::loncommon::start_data_table_header_row();
foreach my $field (@Fields) {
$Str .= ''.&mt($field).
' | ';
}
- $Str .= ' '."\n";
+ $Str .= &Apache::loncommon::end_data_table_header_row();
#
- my $alternate = 0;
foreach my $student (@Students) { # @Students is a package variable
my $sname = $student->{'username'}.':'.$student->{'domain'};
- if($alternate) {
- $Str .= '';
- } else {
- $Str .= ' ';
- }
- $alternate = ($alternate + 1) % 2;
+ $Str .= &Apache::loncommon::start_data_table_row();
#
foreach my $field (@Fields) {
$Str .= '';
if ($field eq 'fullname' || $field eq 'username') {
$Str .= '';
+ $Str .= &escape($sname).'">';
$Str .= $student->{$field}.' ';
$Str .= '';
} elsif ($field eq 'status') {
@@ -1045,9 +723,9 @@ sub DisplayClasslist {
}
$Str .= ' | ';
}
- $Str .= " \n";
+ $Str .= &Apache::loncommon::end_data_table_row();
}
- $Str .= '
|
'."\n";
+ $Str .= &Apache::loncommon::end_data_table();
#
$r->print($Str);
$r->rflush();
@@ -1055,67 +733,61 @@ sub DisplayClasslist {
return;
}
-##############################################
-##############################################
+
+
sub CreateMainMenu {
#
# Define menu data
- my @reports = ({ internal_name => 'problem_statistics',
- name => &mt('Overall Problem Statistics'),
- short_description =>
- &mt('Student performance statistics on all problems.'),
- },
- { internal_name => 'problem_analysis',
- name => &mt('Detailed Problem Analysis'),
- short_description =>
- &mt('Detailed statistics and graphs of student performance on problems.'),
- },
- { internal_name => 'submissiontime_analysis',
- name => &mt('Submission Time Plots'),
- short_description =>
- &mt('Display and analysis of submission times on assessments.'),
- },
- { internal_name => 'student_submission_reports',
- name => &mt('Student Submission Reports'),
- short_description =>
- &mt('Prepare Excel spreadsheets of student submissions.'),
- },
- { internal_name => 'survey_reports',
- name => &mt('Survey Reports'),
- short_description =>
- &mt('Prepare reports on survey results.'),
- },
- { internal_name => 'correct_problems_plot',
- name => &mt('Correct Problems Plot'),
- short_description =>
- &mt('Display a histogram of student performance in the course.'),
- },
-# { internal_name => 'student_assessment',
-# name => &mt('Problem Status Chart'),
-# short_description =>
-# &mt('Brief view of each students performance in course.'),
-# },
- # 'percentage' => 'Correct-problems Plot',
- # 'activitylog' => 'Activity Log',
- );
- #
- # Create the menu
- my $Str;
- $Str .= ''.&mt('Please select a report to generate').'
';
- foreach my $reportdata (@reports) {
- $Str .=' \n";
- $Str .= ' '.(' 'x8).$reportdata->{'short_description'}.
- "\n";
- }
- $Str .="\n";
- #
- return $Str;
+ my @reports = (
+ {categorytitle => 'Statistics and Analyses',
+ items => [
+ {url => '/adm/statistics?reportSelected=problem_statistics',
+ permission => 'F',
+ icon => 'document-open.png',
+ linktext => ('Overall Problem Statistics'),
+ linktitle => ('Student performance statistics on all problems.')},
+
+ {url => '/adm/statistics?reportSelected=problem_analysis',
+ permission => 'F',
+ icon => 'edit-find.png',
+ linktext => ('Detailed Problem Analysis'),
+ linktitle => ('Detailed statistics and graphs of student performance on problems.')},
+ ]},
+ {categorytitle => 'Plots',
+ items => [
+ {url => '/adm/statistics?reportSelected=submissiontime_analysis',
+ permission => 'F',
+ icon => 'subtimpl.png',
+ linktext => ('Submission Time Plots'),
+ linktitle => ('Display and analysis of submission times on assessments.')},
+
+ {url => '/adm/statistics?reportSelected=correct_problems_plot',
+ permission => 'F',
+ icon => 'coprplot.png',
+ linktext => ('Correct Problems Plot'),
+ linktitle => ('Display a histogram of student performance in the course.')},
+ ]},
+ {categorytitle => 'Reports',
+ items => [
+ {url => '/adm/statistics?reportSelected=student_submission_reports',
+ permission => 'F',
+ icon => 'edit-copy.png',
+ linktext => ('Student Submission Reports'),
+ linktitle => ('Prepare reports of student submissions.')},
+
+ {url => '/adm/statistics?reportSelected=survey_reports',
+ permission => 'F',
+ icon => 'docs.png',
+ linktext => ('Survey Reports'),
+ linktitle => ('Prepare reports on survey results.')},
+ ]});
+
+return &Apache::lonhtmlcommon::generate_menu(@reports);
+
}
-##############################################
-##############################################
+
+
sub handler {
my $r=shift;
my $c = $r->connection();
@@ -1125,16 +797,16 @@ sub handler {
if ($loaderror) { return $loaderror; }
$loaderror=
&Apache::lonnet::overloaderror($r,
- $ENV{'course.'.$ENV{'request.course.id'}.'.home'});
+ $env{'course.'.$env{'request.course.id'}.'.home'});
if ($loaderror) { return $loaderror; }
#
# Check for access
- if (! &Apache::lonnet::allowed('vgr',$ENV{'request.course.id'})) {
- $ENV{'user.error.msg'}=
+ if (! &Apache::lonnet::allowed('vgr',$env{'request.course.id'})) {
+ $env{'user.error.msg'}=
$r->uri.":vgr:0:0:Cannot view grades for complete course";
if (! &Apache::lonnet::allowed('vgr',
- $ENV{'request.course.id'}.'/'.$ENV{'request.course.sec'})) {
- $ENV{'user.error.msg'}=
+ $env{'request.course.id'}.'/'.$env{'request.course.sec'})) {
+ $env{'user.error.msg'}=
$r->uri.":vgr:0:0:Cannot view grades with given role";
return HTTP_NOT_ACCEPTABLE;
}
@@ -1152,10 +824,17 @@ sub handler {
'SelectedStudent']);
#
# Give the LON-CAPA page header
- $r->print(''.
- &mt('Course Statistics and Charts').
- "\n".
- &Apache::loncommon::bodytag('Course Statistics and Charts'));
+ my $style = <
+ ul.sub_studentans { list-style-type: none }
+ ul.sub_correctans { list-style-type: none }
+ tr.even { background-color: \#CCCCCC }
+ td.essay { border: 1px solid gray; }
+
+ENDSTYLE
+
+ $r->print(&Apache::loncommon::start_page('Course Statistics and Charts',
+ $style));
$r->rflush();
#
# Either print out a menu for them or send them to a report
@@ -1165,33 +844,33 @@ sub handler {
text =>'Statistics',
faq=>139,
bug=>'Statistics and Charts'});
- if (! exists($ENV{'form.reportSelected'}) ||
- $ENV{'form.reportSelected'} eq '') {
- $r->print(&Apache::lonhtmlcommon::breadcrumbs
- (undef,&mt('Statistics Main Page')).
+ if (! exists($env{'form.reportSelected'}) ||
+ $env{'form.reportSelected'} eq '') {
+ $r->print(&Apache::lonhtmlcommon::breadcrumbs('Statistics Main Page').
&CreateMainMenu());
} else {
#
if (! &Apache::lonmysql::verify_sql_connection()) {
my $serveradmin = $r->dir_config('lonAdmEMail');
- $r->print(''.
+ $r->print(''.
&mt('Unable to connect to database!').
- '
');
- $r->print(''.
- &mt('Please notify the server administrator ').
- ''.$serveradmin.'
');
+ '');
+ $r->print(''
+ .&mt('Please notify the server administrator [_1]',
+ ,''.$serveradmin.'')
+ .'
');
$r->print(''.
&mt('Course Statistics and Charts cannot be '.
'retrieved until the database is restarted. '.
'Your data is intact but cannot be displayed '.
'at this time.').'
');
- $r->print('