--- loncom/interface/statistics/lonstudentassessment.pm 2005/03/21 19:47:54 1.120 +++ loncom/interface/statistics/lonstudentassessment.pm 2005/04/08 13:44:43 1.123 @@ -1,6 +1,6 @@ # The LearningOnline Network with CAPA # -# $Id: lonstudentassessment.pm,v 1.120 2005/03/21 19:47:54 matthew Exp $ +# $Id: lonstudentassessment.pm,v 1.123 2005/04/08 13:44:43 albertel Exp $ # # Copyright Michigan State University Board of Trustees # @@ -153,10 +153,10 @@ sub BuildStudentAssessmentPage { &Apache::lonstatistics::PrepareClasslist(); # $single_student_mode = 0; - $single_student_mode = 1 if ($ENV{'form.SelectedStudent'}); + $single_student_mode = 1 if ($env{'form.SelectedStudent'}); &Apache::loncommon::get_unprocessed_cgi($ENV{'QUERY_STRING'}, ['selectstudent']); - if ($ENV{'form.selectstudent'}) { + if ($env{'form.selectstudent'}) { &Apache::lonstatistics::DisplayClasslist($r); return; } @@ -167,10 +167,10 @@ sub BuildStudentAssessmentPage { $r->print(&CreateInterface()); $r->print(''); $r->print(''); + $env{'form.sort'}.'" />'); $r->rflush(); # - if (! exists($ENV{'form.notfirstrun'}) && ! $single_student_mode) { + if (! exists($env{'form.notfirstrun'}) && ! $single_student_mode) { return; } $r->print('

'. @@ -234,7 +234,7 @@ sub BuildStudentAssessmentPage { sub next_and_previous_buttons { my $Str = ''; $Str .= ''; + $env{'form.SelectedStudent'}.'" />'; # # Build the previous student link my $previous = &Apache::lonstatistics::previous_student(); @@ -430,14 +430,9 @@ sub CreateAndParseOutputSelector { [$elementname]); # # Format for output options is 'mode, restrictions'; - my $selected = 'html, without links'; - if (exists($ENV{'form.'.$elementname})) { - if (ref($ENV{'form.'.$elementname} eq 'ARRAY')) { - $selected = $ENV{'form.'.$elementname}->[0]; - } else { - $selected = $ENV{'form.'.$elementname}; - } - } + my $selected = (&Apache::loncommon::get_env_multiple('form.'.$elementname))[0]; + $selected = 'html, without links' if (!$selected); + # # Set package variables describing output mode $show_links = 'no'; @@ -551,14 +546,9 @@ sub CreateAndParseOutputDataSelector { my $Str = ''; my $elementname = 'chartoutputdata'; # - my $selected = 'scores'; - if (exists($ENV{'form.'.$elementname})) { - if (ref($ENV{'form.'.$elementname} eq 'ARRAY')) { - $selected = $ENV{'form.'.$elementname}->[0]; - } else { - $selected = $ENV{'form.'.$elementname}; - } - } + my $selected = (&Apache::loncommon::get_env_multiple('form.'.$elementname))[0]; + $selected = 'scores' if (!$selected); + # $chosen_output = $OutputDataOptions[0]; foreach my $option (@OutputDataOptions) { @@ -652,7 +642,7 @@ sub html_initialize { '

'); } # - $r->print("

".$ENV{'course.'.$ENV{'request.course.id'}.'.description'}. + $r->print("

".$env{'course.'.$env{'request.course.id'}.'.description'}. "  ".localtime(time)."

"); # if ($chosen_output->{'base'} !~ /^final table/) { @@ -720,6 +710,21 @@ sub html_initialize { $Str .= "
";
     $r->print($Str);
     $r->rflush();
+    #
+    # Let the user know what we are doing
+    my $studentcount = scalar(@Apache::lonstatistics::Students); 
+    if ($env{'form.SelectedStudent'}) {
+        $studentcount = '1';
+    }
+    #
+    # Initialize progress window
+    %prog_state=&Apache::lonhtmlcommon::Create_PrgWin
+        ($r,'HTML Chart Status',
+         'HTML Chart Progress', $studentcount,
+         'inline',undef,'Statistics','stats_status');
+    #
+    &Apache::lonhtmlcommon::Update_PrgWin($r,\%prog_state,
+                                          'Processing first student');
     return;
 }
 
@@ -747,7 +752,7 @@ sub html_outputstudent {
     my %StudentsData;
     my @tmp = &Apache::loncoursedata::get_current_state
         ($student->{'username'},$student->{'domain'},undef,
-         $ENV{'request.course.id'});
+         $env{'request.course.id'});
     if ((scalar @tmp > 0) && ($tmp[0] !~ /^error:/)) {
         %StudentsData = @tmp;
     }
@@ -832,6 +837,7 @@ sub html_outputstudent {
     $r->print($Str);
     #
     $r->rflush();
+    &Apache::lonhtmlcommon::Increment_PrgWin($r,\%prog_state,'last student');
     return;
 }    
 
@@ -849,6 +855,7 @@ sub html_finish {
         }
     }
     $r->rflush();
+    &Apache::lonhtmlcommon::Close_PrgWin($r,\%prog_state);
     undef($navmap);
     return;
 }
@@ -1039,13 +1046,13 @@ sub excel_initialize {
     return if (! defined($excel_workbook));
     #
     # Add a worksheet
-    my $sheetname = $ENV{'course.'.$ENV{'request.course.id'}.'.description'};
+    my $sheetname = $env{'course.'.$env{'request.course.id'}.'.description'};
     $sheetname = &Apache::loncommon::clean_excel_name($sheetname);
     $excel_sheet = $excel_workbook->addworksheet($sheetname);
     #
     # Put the course description in the header
     $excel_sheet->write($header_row,$cols_output++,
-                   $ENV{'course.'.$ENV{'request.course.id'}.'.description'},
+                   $env{'course.'.$env{'request.course.id'}.'.description'},
                         $format->{'h1'});
     $cols_output += 3;
     #
@@ -1314,7 +1321,7 @@ sub excel_initialize {
     #
     # Let the user know what we are doing
     my $studentcount = scalar(@Apache::lonstatistics::Students); 
-    if ($ENV{'form.SelectedStudent'}) {
+    if ($env{'form.SelectedStudent'}) {
         $studentcount = '1';
     }
     if ($studentcount > 1) {
@@ -1361,7 +1368,7 @@ sub excel_outputstudent {
     my @tmp = &Apache::loncoursedata::get_current_state($student->{'username'},
                                                         $student->{'domain'},
                                                         undef,
-                                                   $ENV{'request.course.id'});
+                                                   $env{'request.course.id'});
     if ((scalar @tmp > 0) && ($tmp[0] !~ /^error:/)) {
         %StudentsData = @tmp;
     }
@@ -1549,7 +1556,7 @@ END
     if (! defined($outputfile)) { return ''; }
     #
     # Datestamp
-    my $description = $ENV{'course.'.$ENV{'request.course.id'}.'.description'};
+    my $description = $env{'course.'.$env{'request.course.id'}.'.description'};
     print $outputfile '"'.&Apache::loncommon::csv_translate($description).'",'.
         '"'.&Apache::loncommon::csv_translate(scalar(localtime(time))).'"'.
             "\n";
@@ -1639,7 +1646,7 @@ sub csv_outputstudent {
     my @tmp = &Apache::loncoursedata::get_current_state($student->{'username'},
                                                         $student->{'domain'},
                                                         undef,
-                                                   $ENV{'request.course.id'});
+                                                   $env{'request.course.id'});
     if ((scalar @tmp > 0) && ($tmp[0] !~ /^error:/)) {
         %StudentsData = @tmp;
     }