[LON-CAPA-cvs] cvs: loncom /interface lonstatistics.pm /interface/statistics lonstathelpers.pm

matthew lon-capa-cvs@mail.lon-capa.org
Tue, 01 Feb 2005 15:15:28 -0000


matthew		Tue Feb  1 10:15:28 2005 EDT

  Modified files:              
    /loncom/interface	lonstatistics.pm 
    /loncom/interface/statistics	lonstathelpers.pm 
  Log:
  Move general student data gathering routines from lonstatistics to
  lonstathelpers.
  
  
Index: loncom/interface/lonstatistics.pm
diff -u loncom/interface/lonstatistics.pm:1.112 loncom/interface/lonstatistics.pm:1.113
--- loncom/interface/lonstatistics.pm:1.112	Wed Jan  5 15:34:20 2005
+++ loncom/interface/lonstatistics.pm	Tue Feb  1 10:15:28 2005
@@ -1,6 +1,6 @@
 # The LearningOnline Network with CAPA
 #
-# $Id: lonstatistics.pm,v 1.112 2005/01/05 20:34:20 matthew Exp $
+# $Id: lonstatistics.pm,v 1.113 2005/02/01 15:15:28 matthew Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -786,91 +786,6 @@
     return $Str;
 }
 
-###############################################
-###############################################
-
-=pod 
-
-=item &Gather_Student_Data()
-
-Ensures all student data is up to date.
-
-=cut
-
-###############################################
-###############################################
-sub Gather_Student_Data {
-    my ($r) = @_;
-    my $c = $r->connection();
-    #
-    &Apache::loncoursedata::clear_internal_caches();
-    #
-    my @Sequences = &Apache::lonstatistics::Sequences_with_Assess();
-    #
-    my @Students = @Apache::lonstatistics::Students;
-    #
-    # Open the progress window
-    my %prog_state=&Apache::lonhtmlcommon::Create_PrgWin
-        ($r,'Statistics Compilation Status',
-         'Statistics Compilation Progress', scalar(@Students));
-    #
-    while (my $student = shift @Students) {
-        return if ($c->aborted());
-        my ($status,undef) = &Apache::loncoursedata::ensure_current_data
-            ($student->{'username'},$student->{'domain'},
-             $ENV{'request.course.id'});
-        &Apache::lonhtmlcommon::Increment_PrgWin($r,\%prog_state,
-                                                 &mt('last student'));
-    }
-    &Apache::lonhtmlcommon::Close_PrgWin($r,\%prog_state);
-    $r->rflush();
-}
-
-###############################################
-###############################################
-
-=pod 
-
-=item &Gather_Full_Student_Data()
-
-Ensures all student data is up to date.
-
-=cut
-
-###############################################
-###############################################
-sub Gather_Full_Student_Data {
-    my ($r,$formname,$inputname) = @_;
-    my $status_type;
-    if (defined($formname)) {
-        $status_type = 'inline';
-    } else {
-        $status_type = 'popup';
-    }
-    my $c = $r->connection();
-    #
-    &Apache::loncoursedata::clear_internal_caches();
-    #
-    my @Students = @Apache::lonstatistics::Students;
-    #
-    # Open the progress window
-    my %prog_state=&Apache::lonhtmlcommon::Create_PrgWin
-        ($r,&mt('Student Data Compilation Status'),
-         &mt('Student Data Compilation Progress'), scalar(@Students),
-         $status_type,undef,$formname,$inputname);
-    #
-    while (my $student = shift @Students) {
-        return if ($c->aborted());
-        my ($status,undef) = &Apache::loncoursedata::ensure_current_full_data
-            ($student->{'username'},$student->{'domain'},
-             $ENV{'request.course.id'});
-        &Apache::lonhtmlcommon::Increment_PrgWin($r,\%prog_state,
-                                                 &mt('last student'));
-    }
-    &Apache::lonhtmlcommon::Close_PrgWin($r,\%prog_state);
-    $r->rflush();
-}
-
 ##################################################
 ##################################################
 sub DisplayClasslist {
Index: loncom/interface/statistics/lonstathelpers.pm
diff -u loncom/interface/statistics/lonstathelpers.pm:1.35 loncom/interface/statistics/lonstathelpers.pm:1.36
--- loncom/interface/statistics/lonstathelpers.pm:1.35	Tue Dec 28 15:28:47 2004
+++ loncom/interface/statistics/lonstathelpers.pm	Tue Feb  1 10:15:28 2005
@@ -1,6 +1,6 @@
 # The LearningOnline Network with CAPA
 #
-# $Id: lonstathelpers.pm,v 1.35 2004/12/28 20:28:47 matthew Exp $
+# $Id: lonstathelpers.pm,v 1.36 2005/02/01 15:15:28 matthew Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -1331,9 +1331,7 @@
         if (defined($update_message)) {
             $r->print($update_message);
         }
-        &Apache::lonstatistics::Gather_Full_Student_Data($r,$formname,
-                                                         $inputname);
-            
+        &gather_full_student_data($r,$formname,$inputname);
     }
     #
     my @Buttons = 
@@ -1355,7 +1353,39 @@
     return @Buttons;
 }
 
-
+sub gather_full_student_data {
+    &Apache::lonnet::logthis('called gather_full_student_data');
+    my ($r,$formname,$inputname) = @_;
+    my $status_type;
+    if (defined($formname)) {
+        $status_type = 'inline';
+    } else {
+        $status_type = 'popup';
+    }
+    my $c = $r->connection();
+    #
+    &Apache::loncoursedata::clear_internal_caches();
+    #
+    my @Students = @Apache::lonstatistics::Students;
+    #
+    # Open the progress window
+    my %prog_state=&Apache::lonhtmlcommon::Create_PrgWin
+        ($r,&mt('Student Data Compilation Status'),
+         &mt('Student Data Compilation Progress'), scalar(@Students),
+         $status_type,undef,$formname,$inputname);
+    #
+    while (my $student = shift @Students) {
+        return if ($c->aborted());
+        my $status = &Apache::loncoursedata::ensure_current_full_data
+            ($student->{'username'},$student->{'domain'},
+             $ENV{'request.course.id'});
+        &Apache::lonhtmlcommon::Increment_PrgWin($r,\%prog_state,
+                                                 &mt('last student'));
+    }
+    &Apache::lonhtmlcommon::Close_PrgWin($r,\%prog_state);
+    $r->rflush();
+    return;
+}
 
 
 ####################################################