[LON-CAPA-cvs] cvs: loncom /interface lonhtmlcommon.pm lonspreadsheet.pm /interface/statistics lonproblemanalysis.pm

albertel lon-capa-cvs@mail.lon-capa.org
Mon, 03 Mar 2003 22:00:03 -0000


albertel		Mon Mar  3 17:00:03 2003 EDT

  Modified files:              
    /loncom/interface	lonspreadsheet.pm lonhtmlcommon.pm 
    /loncom/interface/statistics	lonproblemanalysis.pm 
  Log:
  - converted lonspreadsheet to use new mechanism
  - removed debugging sleep
  - typo in lonproblemanalysis
  
  
Index: loncom/interface/lonspreadsheet.pm
diff -u loncom/interface/lonspreadsheet.pm:1.172 loncom/interface/lonspreadsheet.pm:1.173
--- loncom/interface/lonspreadsheet.pm:1.172	Mon Feb 17 11:29:51 2003
+++ loncom/interface/lonspreadsheet.pm	Mon Mar  3 17:00:03 2003
@@ -1,5 +1,5 @@
 #
-# $Id: lonspreadsheet.pm,v 1.172 2003/02/17 16:29:51 matthew Exp $
+# $Id: lonspreadsheet.pm,v 1.173 2003/03/03 22:00:03 albertel Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -3198,20 +3198,12 @@
     foreach ($self->rows()) {
         $total++ if ($formulas{'A'.$_} !~ /^[!~-]/);
     }
-    my $now=0;
-    my $since=time;
-    $r->print(<<ENDPOP);
-<script>
-    popwin=open('','popwin','width=400,height=100');
-    popwin.document.writeln('<html><body bgcolor="#FFFFFF">'+
-      '<h3>Spreadsheet Calculation Progress</h3>'+
-      '<form name=popremain>'+
-      '<input type=text size=45 name=remaining value="Processing Course Assessment Data"></form>'+
-      '</body></html>');
-    popwin.document.close();
-</script>
-ENDPOP
-    $r->rflush();
+
+    my %prog_state=&Apache::lonhtmlcommon::Create_PrgWin($r,
+	      'Spreadsheet Status','Spreadsheet Calculation Progress', $total);
+    &Apache::lonhtmlcommon::Update_PrgWin($r,\%prog_state,
+					  'Processing Course Assessment Data');
+
     # It would be nice to load in the classlist and assessment info at this 
     # point, before attacking the student spreadsheets.
     foreach my $row ($self->rows()) {
@@ -3225,13 +3217,8 @@
         my @studentdata=$self->exportsheet($sname,$sdom,'studentcalc',
                                      undef,undef,$r);
         undef %userrdatas;
-        $now++;
-        $r->print('<script>popwin.document.popremain.remaining.value="'.
-                  $now.'/'.$total.': '.int((time-$since)/$now*($total-$now)).
-                  ' secs remaining '.(time-$started).' last student";'.
-                  '</script>');
-        $r->rflush(); 
-        #
+	&Apache::lonhtmlcommon::Increment_PrgWin($r,\%prog_state,
+						 'last student');
         my $index=0;
         foreach ('A','B','C','D','E','F','G','H','I','J','K','L','M',
                  'N','O','P','Q','R','S','T','U','V','W','X','Y','Z') {
@@ -3251,8 +3238,7 @@
     }
     $self->formulas(\%formulas);
     $self->constants(\%constants);
-    $r->print('<script>popwin.close()</script>');
-    $r->rflush(); 
+    &Apache::lonhtmlcommon::Close_PrgWin($r,\%prog_state);
 }
 
 # ------------------------------------------------ Load data for one assessment
Index: loncom/interface/lonhtmlcommon.pm
diff -u loncom/interface/lonhtmlcommon.pm:1.14 loncom/interface/lonhtmlcommon.pm:1.15
--- loncom/interface/lonhtmlcommon.pm:1.14	Mon Mar  3 16:52:24 2003
+++ loncom/interface/lonhtmlcommon.pm	Mon Mar  3 17:00:03 2003
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # a pile of common html routines
 #
-# $Id: lonhtmlcommon.pm,v 1.14 2003/03/03 21:52:24 albertel Exp $
+# $Id: lonhtmlcommon.pm,v 1.15 2003/03/03 22:00:03 albertel Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -682,7 +682,6 @@
 	      ' secs remaining ('.(time-$$prog_state{'started'}).
 	      ' seconds for '.$extraInfo.')";'.'</script>');
     $$prog_state{'started'}=time;
-    sleep 1;
     $r->rflush();
 }
 
Index: loncom/interface/statistics/lonproblemanalysis.pm
diff -u loncom/interface/statistics/lonproblemanalysis.pm:1.20 loncom/interface/statistics/lonproblemanalysis.pm:1.21
--- loncom/interface/statistics/lonproblemanalysis.pm:1.20	Mon Mar  3 16:52:24 2003
+++ loncom/interface/statistics/lonproblemanalysis.pm	Mon Mar  3 17:00:03 2003
@@ -1,6 +1,6 @@
 # The LearningOnline Network with CAPA
 #
-# $Id: lonproblemanalysis.pm,v 1.20 2003/03/03 21:52:24 albertel Exp $
+# $Id: lonproblemanalysis.pm,v 1.21 2003/03/03 22:00:03 albertel Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -175,7 +175,7 @@
 
 
     my %prog_state=&Apache::lonhtmlcommon::Create_PrgWin($r, $title,
-						      $heading,$#students+1);
+						      $heading,$#$students+1);
 
     #Java script Progress window
     for(my $index=0; $index<(scalar @$students); $index++) {