--- loncom/interface/lonstatistics.pm 2006/05/01 16:11:25 1.131 +++ loncom/interface/lonstatistics.pm 2007/06/06 17:30:40 1.138 @@ -1,6 +1,6 @@ # The LearningOnline Network with CAPA # -# $Id: lonstatistics.pm,v 1.131 2006/05/01 16:11:25 albertel Exp $ +# $Id: lonstatistics.pm,v 1.138 2007/06/06 17:30:40 albertel Exp $ # # Copyright Michigan State University Board of Trustees # @@ -63,6 +63,7 @@ use Apache::loncoursedata; use Apache::lonhtmlcommon; use Apache::lonmysql; use Apache::lonlocal; +use Apache::longroup; use Time::HiRes; # # Statistics Packages @@ -75,6 +76,7 @@ use Apache::lonpercentage; use Apache::lonstudentsubmissions(); use Apache::lonsurveyreports(); use Apache::longradinganalysis(); +use LONCAPA; ####################################################### ####################################################### @@ -230,12 +232,13 @@ sub PrepareClasslist { $enrollment_status = $env{'form.Status'} if (exists($env{'form.Status'})); # # Get groupmembership - my (%curr_groups,$classgroups,$studentgroups); - my $numgroups = &Apache::loncommon::coursegroups(\%curr_groups,$cdom,$cnum); - if ($numgroups) { + my ($classgroups,$studentgroups); + my %curr_groups = &Apache::longroup::coursegroups($cdom,$cnum); + if (%curr_groups) { ($classgroups,$studentgroups) = - &Apache::loncoursedata::get_group_memberships($classlist, - $cdom,$cnum); + &Apache::loncoursedata::get_group_memberships($classlist, + $field_names, + $cdom,$cnum); } my $now = time; @@ -309,7 +312,11 @@ sub PrepareClasslist { if ($env{'request.course.sec'} !~ /^\s*$/) { @Sections = ($env{'request.course.sec'}); } else { - @Sections = sort {$a cmp $b} keys(%Sections); + @Sections = sort { + if ($a == $a && $b == $b ) { return $a <=> $b; } + return $a cmp $b; + } keys(%Sections); + unshift(@Sections,'all'); # Put 'all' at the front of the list } # Sort the groups @@ -428,7 +435,7 @@ sub get_selected_groups { =item §ion_and_enrollment_description Returns a string describing the currently selected section(s), group(s) and -enrollment status. +access status. Inputs: mode = 'plaintext' or 'localized' (defaults to 'localized') 'plaintext' is used for example in Excel spreadsheets. @@ -445,9 +452,9 @@ sub section_and_enrollment_description { my @groups = &Apache::lonstatistics::get_selected_groups(); my $description; if ($mode eq 'localized') { - $description = &mt('Unable to determine section, groups and enrollment'); + $description = &mt('Unable to determine section, groups and access status'); } elsif ($mode eq 'plaintext') { - $description = 'Unable to determine section, groups and enrollment'; + $description = 'Unable to determine section, groups and access status'; } else { $description = 'Bad parameter passed to lonstatistics::section_and_enrollment_description'; &Apache::lonnet::logthis($description); @@ -455,9 +462,9 @@ sub section_and_enrollment_description { $description = §ion_or_group_text($mode,'section',@sections). ' '.§ion_or_group_text($mode,'group',@groups); if ($mode eq 'localized') { - $description .= &mt(' [_1] enrollment status.',$env{'form.Status'}); + $description .= &mt(' [_1] access status.',$env{'form.Status'}); } elsif ($mode eq 'plaintext') { - $description .= ' '.$env{'form.Status'}.' enrollment status.'; + $description .= ' '.$env{'form.Status'}.' access status.'; } return $description; } @@ -922,12 +929,12 @@ sub DisplayClasslist { # # Output some of the standard interface components my $Str; - $Str .= &Apache::lonhtmlcommon::breadcrumbs(undef,'Select One Student'); + $Str .= &Apache::lonhtmlcommon::breadcrumbs('Select One Student'); $Str .= '

'."\n"; $Str .= ''; $Str .= ''; $Str .= ''; - $Str .= ''; + $Str .= ''; $Str .= ''.$/; $Str .= ''; $Str .= '
'.&mt('Sections').''.&mt('Groups').''.&mt('Enrollment Status').''.&mt('Access Status').'
'. @@ -1016,10 +1023,10 @@ sub DisplayClasslist { $Str .= ''; if ($field eq 'fullname' || $field eq 'username') { $Str .= ''; + $Str .= &escape($sname).'">'; $Str .= $student->{$field}.' '; $Str .= ''; } elsif ($field eq 'status') { @@ -1163,8 +1170,7 @@ ENDSTYLE bug=>'Statistics and Charts'}); if (! exists($env{'form.reportSelected'}) || $env{'form.reportSelected'} eq '') { - $r->print(&Apache::lonhtmlcommon::breadcrumbs - (undef,&mt('Statistics Main Page')). + $r->print(&Apache::lonhtmlcommon::breadcrumbs('Statistics Main Page'). &CreateMainMenu()); } else { #