--- loncom/interface/lonstatistics.pm	2006/05/01 05:39:44	1.130
+++ loncom/interface/lonstatistics.pm	2006/05/30 12:46:09	1.136
@@ -1,6 +1,6 @@
 # The LearningOnline Network with CAPA
 #
-# $Id: lonstatistics.pm,v 1.130 2006/05/01 05:39:44 raeburn Exp $
+# $Id: lonstatistics.pm,v 1.136 2006/05/30 12:46:09 www 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,8 @@ use Apache::lonpercentage;
 use Apache::lonstudentsubmissions();
 use Apache::lonsurveyreports();
 use Apache::longradinganalysis();
+use lib '/home/httpd/lib/perl/';
+use LONCAPA;
 
 #######################################################
 #######################################################
@@ -230,12 +233,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;
 
@@ -281,18 +285,18 @@ sub PrepareClasslist {
                   ($enrollment_status eq 'Any')) 
                  ){
                 my $groupcheck = 0;
-                if (grep/^all$/,@selected_groups) {
-                    push (@Students,$studenthash);
+                if (grep(/^all$/,@selected_groups)) {
+                    push(@Students,$studenthash);
                     last;
-                } elsif (grep/^none$/,@selected_groups) {
+                } elsif (grep(/^none$/,@selected_groups)) {
                     if ($studenthash->{'groups'} eq 'none') {
-                        push (@Students,$studenthash);
+                        push(@Students,$studenthash);
                         last;
                     }     
                 } else {
                     foreach my $group (@selected_groups) {
-                        if (grep/^$group$/,@studentsgroups) {
-                            push (@Students,$studenthash);
+                        if (grep(/^$group$/,@studentsgroups)) {
+                            push(@Students,$studenthash);
                             $groupcheck = 1;
                             last;
                         }
@@ -453,7 +457,7 @@ sub section_and_enrollment_description {
         &Apache::lonnet::logthis($description);
     }
     $description = &section_or_group_text($mode,'section',@sections).
-                   ' '.&section_or_group_text($mode,'group',@groups);
+	' '.&section_or_group_text($mode,'group',@groups);
     if ($mode eq 'localized') {
         $description .= &mt(' [_1] enrollment status.',$env{'form.Status'});
     } elsif ($mode eq 'plaintext') {
@@ -922,7 +926,7 @@ 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 .= '<p><table cellspacing="5">'."\n";
     $Str .= '<tr>';
     $Str .= '<th align="center"><b>'.&mt('Sections').'</b></th>';
@@ -1016,10 +1020,10 @@ sub DisplayClasslist {
             $Str .= '<td>';
             if ($field eq 'fullname' || $field eq 'username') {
                 $Str .= '<a href="/adm/statistics?reportSelected=';
-                $Str .= &Apache::lonnet::escape('student_assessment');
-                $Str .= '&sort='.&Apache::lonnet::escape($env{'form.sort'});
+                $Str .= &escape('student_assessment');
+                $Str .= '&sort='.&escape($env{'form.sort'});
                 $Str .= '&SelectedStudent=';
-                $Str .= &Apache::lonnet::escape($sname).'">';
+                $Str .= &escape($sname).'">';
                 $Str .= $student->{$field}.'&nbsp';
                 $Str .= '</a>';
             } elsif ($field eq 'status') {
@@ -1163,8 +1167,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 {
     #