--- loncom/interface/lonstatistics.pm 2002/08/30 15:35:08 1.49 +++ loncom/interface/lonstatistics.pm 2002/11/18 20:39:46 1.54 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # (Publication Handler # -# $Id: lonstatistics.pm,v 1.49 2002/08/30 15:35:08 stredwic Exp $ +# $Id: lonstatistics.pm,v 1.54 2002/11/18 20:39:46 matthew Exp $ # # Copyright Michigan State University Board of Trustees # @@ -245,9 +245,11 @@ sub SortStudents { my $sortBy = ''; if(defined($cache->{'sort'})) { $sortBy = ':'.$cache->{'sort'}; + } else { + $sortBy = ':fullname'; } - my @order = sort { $cache->{$a.$sortBy} cmp $cache->{$b.$sortBy} || - $cache->{$a.':fullname'} cmp $cache->{$b.':fullname'} } + my @order = sort { lc($cache->{$a.$sortBy}) cmp lc($cache->{$b.$sortBy}) || + lc($cache->{$a.':fullname'}) cmp lc($cache->{$b.':fullname'}) } @sorted1Students; return \@order; @@ -324,14 +326,14 @@ sub PrepareData { return "Unable to tie hash to db file."; } - if(!$isCached) { +# if(!$isCached) { my $processTopResourceMapReturn= - &Apache::loncoursedata::ProcessTopResourceMap(\%cache, $c, $r); + &Apache::loncoursedata::ProcessTopResourceMap(\%cache, $c); if($processTopResourceMapReturn ne 'OK') { untie(%cache); return $processTopResourceMapReturn; } - } + # } if($c->aborted()) { untie(%cache); @@ -509,7 +511,8 @@ sub BuildStatistics { 'updateTime'); my @headings=('Full Name', 'Section', 'PID', 'Domain', 'User Name', 'Last Updated'); - my $spacing = ' '; + my $spacing = ' '; + my %reports = ('classlist' => 'Class list', 'problem_statistics' => 'Problem Statistics', 'student_assessment' => 'Student Assessment', @@ -612,6 +615,13 @@ sub handler { # $jr = $r; + my $loaderror=&Apache::lonnet::overloaderror($r); + if ($loaderror) { return $loaderror; } + $loaderror= + &Apache::lonnet::overloaderror($r, + $ENV{'course.'.$ENV{'request.course.id'}.'.home'}); + if ($loaderror) { return $loaderror; } + unless(&Apache::lonnet::allowed('vgr',$ENV{'request.course.id'})) { $ENV{'user.error.msg'}= $r->uri.":vgr:0:0:Cannot view grades for complete course";