--- loncom/interface/lonstatistics.pm 2003/03/25 22:20:25 1.65 +++ loncom/interface/lonstatistics.pm 2003/05/13 14:30:26 1.70 @@ -1,6 +1,6 @@ # The LearningOnline Network with CAPA # -# $Id: lonstatistics.pm,v 1.65 2003/03/25 22:20:25 matthew Exp $ +# $Id: lonstatistics.pm,v 1.70 2003/05/13 14:30:26 matthew Exp $ # # Copyright Michigan State University Board of Trustees # @@ -51,7 +51,7 @@ Main handler for statistics and chart. use Apache::lonproblemstatistics; use Apache::lonstudentassessment; use Apache::lonpercentage; - + use Apache::lonmysql; =over 4 =cut @@ -82,6 +82,7 @@ use Apache::lonproblemanalysis(); use Apache::lonproblemstatistics(); use Apache::lonstudentassessment(); use Apache::lonpercentage; +use Apache::lonmysql; use Time::HiRes; ####################################################### @@ -229,6 +230,11 @@ sub PrepareClasslist { } } # + # Deal with instructors with restricted section access + if ($ENV{'request.course.sec'} !~ /^\s*$/) { + @SelectedSections = ($ENV{'request.course.sec'}); + } + # # Set up %StudentData @StudentDataOrder = qw/fullname username domain id section status/; foreach my $field (@StudentDataOrder) { @@ -237,7 +243,10 @@ sub PrepareClasslist { $StudentData{$field}->{'width'} = $StudentData{$field}->{'base_width'}; } - + # + # get the status requested + my $requested_status = 'Active'; + $requested_status = $ENV{'form.Status'} if (exists($ENV{'form.Status'})); # # Process the classlist while (my ($student,$student_data) = each (%$classlist)) { @@ -265,7 +274,11 @@ sub PrepareClasslist { # # Only put in the list those students we are interested in foreach my $sect (@SelectedSections) { - if (($sect eq 'all') || ($section eq $sect)) { + if ( (($sect eq 'all') || + ($section eq $sect)) && + (($studenthash->{'status'} eq $requested_status) || + ($requested_status eq 'Any')) + ){ push (@Students,$studenthash); last; } @@ -273,8 +286,12 @@ sub PrepareClasslist { } # # Put the consolidated section data in the right place - @Sections = sort {$a cmp $b} keys(%Sections); - unshift(@Sections,'all'); # Put 'all' at the front of the list + if ($ENV{'request.course.sec'} !~ /^\s*$/) { + @Sections = ($ENV{'request.course.sec'}); + } else { + @Sections = sort {$a cmp $b} keys(%Sections); + unshift(@Sections,'all'); # Put 'all' at the front of the list + } # # Sort the Students my $sortby = 'fullname'; @@ -831,12 +848,16 @@ sub CreateMainMenu { # $Str .= '
'."\n"; + $Str .= ' | '."\n"; $Str .= ' | Select a Report | '."\n"; - $Str .= 'Student Status |
'. + " | \n"; + $Str .= ''. + ''. + " | \n"; # $Str .= ''; $Str .= ' | '."\n"; # - $Str .= ''; - $Str .= &Apache::lonhtmlcommon::StatusOptions($status, 'Statistics'); - $Str .= ' | '."\n"; - # $Str .= '
+Please notify the server administrator $serveradmin. +
+Course Statistics and Charts cannot be retrieved until the database is +restarted. Your data is intact but cannot be displayed at this time. +
+