Diff for /loncom/interface/statistics/lonstudentassessment.pm between versions 1.120 and 1.121

version 1.120, 2005/03/21 19:47:54 version 1.121, 2005/04/07 06:56:24
Line 153  sub BuildStudentAssessmentPage { Line 153  sub BuildStudentAssessmentPage {
     &Apache::lonstatistics::PrepareClasslist();      &Apache::lonstatistics::PrepareClasslist();
     #      #
     $single_student_mode = 0;      $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'},      &Apache::loncommon::get_unprocessed_cgi($ENV{'QUERY_STRING'},
                                             ['selectstudent']);                                              ['selectstudent']);
     if ($ENV{'form.selectstudent'}) {      if ($env{'form.selectstudent'}) {
         &Apache::lonstatistics::DisplayClasslist($r);          &Apache::lonstatistics::DisplayClasslist($r);
         return;          return;
     }      }
Line 167  sub BuildStudentAssessmentPage { Line 167  sub BuildStudentAssessmentPage {
     $r->print(&CreateInterface());      $r->print(&CreateInterface());
     $r->print('<input type="hidden" name="notfirstrun" value="true" />');      $r->print('<input type="hidden" name="notfirstrun" value="true" />');
     $r->print('<input type="hidden" name="sort" value="'.      $r->print('<input type="hidden" name="sort" value="'.
               $ENV{'form.sort'}.'" />');                $env{'form.sort'}.'" />');
     $r->rflush();      $r->rflush();
     #      #
     if (! exists($ENV{'form.notfirstrun'}) && ! $single_student_mode) {      if (! exists($env{'form.notfirstrun'}) && ! $single_student_mode) {
         return;          return;
     }      }
     $r->print('<h4>'.      $r->print('<h4>'.
Line 234  sub BuildStudentAssessmentPage { Line 234  sub BuildStudentAssessmentPage {
 sub next_and_previous_buttons {  sub next_and_previous_buttons {
     my $Str = '';      my $Str = '';
     $Str .= '<input type="hidden" name="SelectedStudent" value="'.      $Str .= '<input type="hidden" name="SelectedStudent" value="'.
         $ENV{'form.SelectedStudent'}.'" />';          $env{'form.SelectedStudent'}.'" />';
     #      #
     # Build the previous student link      # Build the previous student link
     my $previous = &Apache::lonstatistics::previous_student();      my $previous = &Apache::lonstatistics::previous_student();
Line 431  sub CreateAndParseOutputSelector { Line 431  sub CreateAndParseOutputSelector {
     #      #
     # Format for output options is 'mode, restrictions';      # Format for output options is 'mode, restrictions';
     my $selected = 'html, without links';      my $selected = 'html, without links';
     if (exists($ENV{'form.'.$elementname})) {      if (exists($env{'form.'.$elementname})) {
         if (ref($ENV{'form.'.$elementname} eq 'ARRAY')) {          if (ref($env{'form.'.$elementname} eq 'ARRAY')) {
             $selected = $ENV{'form.'.$elementname}->[0];              $selected = $env{'form.'.$elementname}->[0];
         } else {          } else {
             $selected = $ENV{'form.'.$elementname};              $selected = $env{'form.'.$elementname};
         }          }
     }      }
     #      #
Line 552  sub CreateAndParseOutputDataSelector { Line 552  sub CreateAndParseOutputDataSelector {
     my $elementname = 'chartoutputdata';      my $elementname = 'chartoutputdata';
     #      #
     my $selected = 'scores';      my $selected = 'scores';
     if (exists($ENV{'form.'.$elementname})) {      if (exists($env{'form.'.$elementname})) {
         if (ref($ENV{'form.'.$elementname} eq 'ARRAY')) {          if (ref($env{'form.'.$elementname} eq 'ARRAY')) {
             $selected = $ENV{'form.'.$elementname}->[0];              $selected = $env{'form.'.$elementname}->[0];
         } else {          } else {
             $selected = $ENV{'form.'.$elementname};              $selected = $env{'form.'.$elementname};
         }          }
     }      }
     #      #
Line 652  sub html_initialize { Line 652  sub html_initialize {
                   '</h3>');                    '</h3>');
     }      }
     #      #
     $r->print("<h3>".$ENV{'course.'.$ENV{'request.course.id'}.'.description'}.      $r->print("<h3>".$env{'course.'.$env{'request.course.id'}.'.description'}.
               "&nbsp;&nbsp;".localtime(time)."</h3>");                "&nbsp;&nbsp;".localtime(time)."</h3>");
     #      #
     if ($chosen_output->{'base'} !~ /^final table/) {      if ($chosen_output->{'base'} !~ /^final table/) {
Line 747  sub html_outputstudent { Line 747  sub html_outputstudent {
     my %StudentsData;      my %StudentsData;
     my @tmp = &Apache::loncoursedata::get_current_state      my @tmp = &Apache::loncoursedata::get_current_state
         ($student->{'username'},$student->{'domain'},undef,          ($student->{'username'},$student->{'domain'},undef,
          $ENV{'request.course.id'});           $env{'request.course.id'});
     if ((scalar @tmp > 0) && ($tmp[0] !~ /^error:/)) {      if ((scalar @tmp > 0) && ($tmp[0] !~ /^error:/)) {
         %StudentsData = @tmp;          %StudentsData = @tmp;
     }      }
Line 1039  sub excel_initialize { Line 1039  sub excel_initialize {
     return if (! defined($excel_workbook));      return if (! defined($excel_workbook));
     #      #
     # Add a worksheet      # 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);      $sheetname = &Apache::loncommon::clean_excel_name($sheetname);
     $excel_sheet = $excel_workbook->addworksheet($sheetname);      $excel_sheet = $excel_workbook->addworksheet($sheetname);
     #      #
     # Put the course description in the header      # Put the course description in the header
     $excel_sheet->write($header_row,$cols_output++,      $excel_sheet->write($header_row,$cols_output++,
                    $ENV{'course.'.$ENV{'request.course.id'}.'.description'},                     $env{'course.'.$env{'request.course.id'}.'.description'},
                         $format->{'h1'});                          $format->{'h1'});
     $cols_output += 3;      $cols_output += 3;
     #      #
Line 1314  sub excel_initialize { Line 1314  sub excel_initialize {
     #      #
     # Let the user know what we are doing      # Let the user know what we are doing
     my $studentcount = scalar(@Apache::lonstatistics::Students);       my $studentcount = scalar(@Apache::lonstatistics::Students); 
     if ($ENV{'form.SelectedStudent'}) {      if ($env{'form.SelectedStudent'}) {
         $studentcount = '1';          $studentcount = '1';
     }      }
     if ($studentcount > 1) {      if ($studentcount > 1) {
Line 1361  sub excel_outputstudent { Line 1361  sub excel_outputstudent {
     my @tmp = &Apache::loncoursedata::get_current_state($student->{'username'},      my @tmp = &Apache::loncoursedata::get_current_state($student->{'username'},
                                                         $student->{'domain'},                                                          $student->{'domain'},
                                                         undef,                                                          undef,
                                                    $ENV{'request.course.id'});                                                     $env{'request.course.id'});
     if ((scalar @tmp > 0) && ($tmp[0] !~ /^error:/)) {      if ((scalar @tmp > 0) && ($tmp[0] !~ /^error:/)) {
         %StudentsData = @tmp;          %StudentsData = @tmp;
     }      }
Line 1549  END Line 1549  END
     if (! defined($outputfile)) { return ''; }      if (! defined($outputfile)) { return ''; }
     #      #
     # Datestamp      # 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).'",'.      print $outputfile '"'.&Apache::loncommon::csv_translate($description).'",'.
         '"'.&Apache::loncommon::csv_translate(scalar(localtime(time))).'"'.          '"'.&Apache::loncommon::csv_translate(scalar(localtime(time))).'"'.
             "\n";              "\n";
Line 1639  sub csv_outputstudent { Line 1639  sub csv_outputstudent {
     my @tmp = &Apache::loncoursedata::get_current_state($student->{'username'},      my @tmp = &Apache::loncoursedata::get_current_state($student->{'username'},
                                                         $student->{'domain'},                                                          $student->{'domain'},
                                                         undef,                                                          undef,
                                                    $ENV{'request.course.id'});                                                     $env{'request.course.id'});
     if ((scalar @tmp > 0) && ($tmp[0] !~ /^error:/)) {      if ((scalar @tmp > 0) && ($tmp[0] !~ /^error:/)) {
         %StudentsData = @tmp;          %StudentsData = @tmp;
     }      }

Removed from v.1.120  
changed lines
  Added in v.1.121


FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>