Diff for /loncom/interface/statistics/lonstudentassessment.pm between versions 1.155 and 1.162.2.1

version 1.155, 2009/05/17 23:13:49 version 1.162.2.1, 2012/02/17 21:49:58
Line 327  sub CreateInterface { Line 327  sub CreateInterface {
  '</td>';   '</td>';
     $Str .= '<td align="center"><b>'.&mt('Groups').'</b>'.      $Str .= '<td align="center"><b>'.&mt('Groups').'</b>'.
  '</td>';   '</td>';
     $Str .= '<td align="center"><b>'.&mt('Student Data</b>').      $Str .= '<td align="center"><b>'.&mt('Student Data').'</b>'.
  &Apache::loncommon::help_open_topic("Chart_Student_Data").   &Apache::loncommon::help_open_topic("Chart_Student_Data").
  '</td>';   '</td>';
     $Str .= '<td align="center"><b>'.&mt('Access Status').'</b>'.      $Str .= '<td align="center"><b>'.&mt('Access Status').'</b>'.
Line 361  sub CreateInterface { Line 361  sub CreateInterface {
     $Str .= &CreateAndParseOutputDataSelector();      $Str .= &CreateAndParseOutputDataSelector();
     $Str .= '</td></tr>'."\n";      $Str .= '</td></tr>'."\n";
     $Str .= '</table>'."\n";      $Str .= '</table>'."\n";
     $Str .= '<input type="submit" name="Generate Chart" value="'.      $Str .= '<p>'
         &mt('Generate Chart').'" />';             .&mt('Status:').' '
     $Str .= '&nbsp;'x5;             .'<input type="text" name="stats_status" size="60" value="" readonly="readonly" />'
              .'</p>';
     $Str .= '<input type="submit" name="selectstudent" value="'.      $Str .= '<input type="submit" name="selectstudent" value="'.
         &mt('Select One Student').'" />';          &mt('Select One Student').'" />';
     $Str .= '&nbsp;'x5;      $Str .= '&nbsp;'x5;
     $Str .= '<input type="submit" name="ClearCache" value="'.      $Str .= '<input type="submit" name="ClearCache" value="'.
         &mt('Clear Caches').'" />';          &mt('Clear Caches').'" />';
     $Str .= '<p>';      $Str .= '<p>'
     $Str .=              .'<input type="submit" name="Generate Chart"'
         &mt('Status [_1]',             .' value="'.&mt('Generate Chart').'" />'
             '<input type="text" name="stats_status" size="60" value="" readonly="readonly" />');             .'</p>';
     $Str .= '</p>';  
     return $Str;      return $Str;
 }  }
   
Line 546  my @OutputDataOptions = Line 546  my @OutputDataOptions =
        summary_table => 1,         summary_table => 1,
        maximum_row => 0,         maximum_row => 0,
        ignore_weight => 1,         ignore_weight => 1,
        shortdesc => 'Number of Problem Parts completed successfully.',         shortdesc => 'Number of Problem Parts completed successfully',
        longdesc => 'The Number of Problem Parts completed successfully and '.         longdesc => 'The Number of Problem Parts completed successfully and '.
            'the maximum possible for each student',             'the maximum possible for each student',
        },         },
Line 554  my @OutputDataOptions = Line 554  my @OutputDataOptions =
   
 sub HTMLifyOutputDataDescriptions {  sub HTMLifyOutputDataDescriptions {
     my $Str = '';      my $Str = '';
     $Str .= "<h2>Output Data</h2>\n";      $Str .= '<h2>'.&mt('Output Data').'</h2>'."\n";
     $Str .= "<dl>\n";      $Str .= "<dl>\n";
     foreach my $option (@OutputDataOptions) {      foreach my $option (@OutputDataOptions) {
         $Str .= '    <dt>'.$option->{'name'}.'</dt>';          $Str .= '    <dt>'.$option->{'name'}.'</dt>';
Line 663  sub html_initialize { Line 663  sub html_initialize {
         &Apache::lonstatistics::selected_sequences_with_assessments();          &Apache::lonstatistics::selected_sequences_with_assessments();
     if (! ref($navmap)) {      if (! ref($navmap)) {
         # Unable to get data, so bail out          # Unable to get data, so bail out
         $r->print("<h3>".          $r->print('<p class="LC_error">'
                   &mt('Unable to retrieve course information.').                   .&mt('Unable to retrieve course information.')
                   '</h3>');                   .'</p>');
     }      }
   
     # If we're showing links, show a checkbox to open in new      # If we're showing links, show a checkbox to open in new
     # windows.      # windows.
     if ($show_links ne 'no') {      if ($show_links ne 'no') {
         my $labeltext = &mt('Show links in new window:');          my $labeltext = &mt('Show links in new window');
         $r->print(<<NEW_WINDOW_CHECKBOX);          $r->print(<<NEW_WINDOW_CHECKBOX);
 <script type="text/javascript">new_window = true;</script>  <script type="text/javascript">new_window = true;</script>
 <p><label>$labeltext   <p><label> 
 <input type="checkbox" checked="checked" onclick="new_window=this.checked" />  <input type="checkbox" checked="checked" onclick="new_window=this.checked" />
   $labeltext
 </label></p>  </label></p>
 NEW_WINDOW_CHECKBOX  NEW_WINDOW_CHECKBOX
     }      }
   
     #      #
     $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;".&Apache::lonlocal::locallocaltime(time)."</h3>");
     #      #
     if ($chosen_output->{'base'} !~ /^final table/) {      if ($chosen_output->{'base'} !~ /^final table/) {
         $r->print("<h3>".&mt($chosen_output->{'shortdesc'})."</h3>");                  $r->print("<h3>".&mt($chosen_output->{'shortdesc'})."</h3>");        
Line 825  sub html_outputstudent { Line 826  sub html_outputstudent {
     return if (! defined($navmap));      return if (! defined($navmap));
     #      #
     if($count++ % 5 == 0 && $count > 0) {      if($count++ % 5 == 0 && $count > 0) {
         $r->print("</pre><pre>");  #       $r->print("</pre><pre>");
           $r->print('</pre>');
           &Apache::lonhtmlcommon::Increment_PrgWin(
               $r,\%prog_state,'last five students',5);
           $r->rflush();
           $r->print('<pre>');
     }      }
     # First, the @StudentData fields need to be listed      # First, the @StudentData fields need to be listed
     my @to_show = &get_student_fields_to_show();      my @to_show = &get_student_fields_to_show();
Line 835  sub html_outputstudent { Line 841  sub html_outputstudent {
         if ($field eq 'comments') {          if ($field eq 'comments') {
             $title = '<a href="/adm/'.$student->{'domain'}.'/'.$student->{'username'}.'/'.'aboutme#coursecomment">'.&mt('Comments').'</a>';              $title = '<a href="/adm/'.$student->{'domain'}.'/'.$student->{'username'}.'/'.'aboutme#coursecomment">'.&mt('Comments').'</a>';
         }          }
           utf8::decode($title);
         my $base = length($title);          my $base = length($title);
         my $width=$Apache::lonstatistics::StudentData{$field}->{'width'};          my $width=$Apache::lonstatistics::StudentData{$field}->{'width'};
         $Str .= $title.' 'x($width-$base).$padding;          $Str .= $title.' 'x($width-$base).$padding;
Line 937  sub html_outputstudent { Line 944  sub html_outputstudent {
     #      #
     $r->print($Str);      $r->print($Str);
     #      #
     $r->rflush();  #   $r->rflush();
     &Apache::lonhtmlcommon::Increment_PrgWin($r,\%prog_state,'last student');  #   &Apache::lonhtmlcommon::Increment_PrgWin($r,\%prog_state,'last student');
     return;      return;
 }      }    
   
Line 995  sub StudentAverageTotal { Line 1002  sub StudentAverageTotal {
 sub SingleStudentTotal {  sub SingleStudentTotal {
     return if (! defined($navmap));      return if (! defined($navmap));
     my $student = &Apache::lonstatistics::current_student();      my $student = &Apache::lonstatistics::current_student();
     my $Str = '<h3>'.&mt('Summary table for [_1] ([_2]@[_3])',      my $Str = '<h3>'.&mt('Summary table for [_1] ([_2])',
                          $student->{'fullname'},                           $student->{'fullname'},
                          $student->{'username'},$student->{'domain'}).'</h3>';                           $student->{'username'}.':'.$student->{'domain'}).'</h3>';
     $Str .= $/;      $Str .= $/;
     $Str .= &Apache::loncommon::start_data_table()."\n";      $Str .= &Apache::loncommon::start_data_table()."\n";
     $Str .=       $Str .= 
Line 1178  sub excel_initialize { Line 1185  sub excel_initialize {
     #      #
     # Put the date in there too      # Put the date in there too
     $excel_sheet->write($header_row,$cols_output++,      $excel_sheet->write($header_row,$cols_output++,
                         'Compiled on '.localtime(time),$format->{'h3'});                          &mt('Compiled on [_1]',&Apache::lonlocal::locallocaltime(time)),$format->{'h3'});
     #      #
     $cols_output = 0;      $cols_output = 0;
     $excel_sheet->write($description_row,$cols_output++,      $excel_sheet->write($description_row,$cols_output++,
                         $chosen_output->{'shortdesc'},                          &mt($chosen_output->{'shortdesc'}),
                         $format->{'b'});                          $format->{'b'});
     #      #
     $cols_output = 0;      $cols_output = 0;
Line 1260  sub excel_initialize { Line 1267  sub excel_initialize {
         $formula_data{$symb}->{'Excel:scorecol'}=$cols_output;          $formula_data{$symb}->{'Excel:scorecol'}=$cols_output;
         if ($chosen_output->{'base'} eq 'parts correct total') {          if ($chosen_output->{'base'} eq 'parts correct total') {
             $excel_sheet->write($resource_name_row,$cols_output++,              $excel_sheet->write($resource_name_row,$cols_output++,
                                 'parts correct',                                  &mt('parts correct'),
                                 $format->{'bold'});                                  $format->{'bold'});
         } elsif ($chosen_output->{'sequence_sum'}) {          } elsif ($chosen_output->{'sequence_sum'}) {
             if ($chosen_output->{'correct'}) {              if ($chosen_output->{'correct'}) {
                 # Only reporting the number correct, so do not call it score                  # Only reporting the number correct, so do not call it score
                 $excel_sheet->write($resource_name_row,$cols_output++,                  $excel_sheet->write($resource_name_row,$cols_output++,
                                     'sum',                                      &mt('sum'),
                                     $format->{'bold'});                                      $format->{'bold'});
             } else {              } else {
                 $excel_sheet->write($resource_name_row,$cols_output++,                  $excel_sheet->write($resource_name_row,$cols_output++,
                                     'score',                                      &mt('score'),
                                     $format->{'bold'});                                      $format->{'bold'});
             }              }
         }          }
Line 1280  sub excel_initialize { Line 1287  sub excel_initialize {
             ($first_data_row,$cols_output-1);              ($first_data_row,$cols_output-1);
         if ($chosen_output->{'sequence_max'}) {          if ($chosen_output->{'sequence_max'}) {
             $excel_sheet->write($resource_name_row,$cols_output,              $excel_sheet->write($resource_name_row,$cols_output,
                                 'maximum',                                  &mt('maximum'),
                                 $format->{'bold'});                                  $format->{'bold'});
             $formula_data{$symb}->{'Excel:maxcell'} =               $formula_data{$symb}->{'Excel:maxcell'} = 
                 &Spreadsheet::WriteExcel::Utility::xl_rowcol_to_cell                  &Spreadsheet::WriteExcel::Utility::xl_rowcol_to_cell
Line 1294  sub excel_initialize { Line 1301  sub excel_initialize {
         }          }
     }      }
     if ($chosen_output->{'grand_total'}) {      if ($chosen_output->{'grand_total'}) {
         $excel_sheet->write($resource_name_row,$cols_output++,'Total',          $excel_sheet->write($resource_name_row,$cols_output++,&mt('Total'),
                             $format->{'bold'});                              $format->{'bold'});
     }      }
     if ($chosen_output->{'grand_maximum'}) {      if ($chosen_output->{'grand_maximum'}) {
         $excel_sheet->write($resource_name_row,$cols_output++,'Max. Total',          $excel_sheet->write($resource_name_row,$cols_output++,&mt('Max. Total'),
                             $format->{'bold'});                              $format->{'bold'});
     }      }
     $total_formula = $excel_sheet->store_formula($total_formula_string);      $total_formula = $excel_sheet->store_formula($total_formula_string);
Line 1389  sub excel_initialize { Line 1396  sub excel_initialize {
     if ($chosen_output->{'summary_table'}) {      if ($chosen_output->{'summary_table'}) {
         $cols_output = 0;          $cols_output = 0;
         $excel_sheet->write($summary_header_row,$cols_output++,          $excel_sheet->write($summary_header_row,$cols_output++,
                             'Summary Table',$format->{'bold'});                              &mt('Summary Table'),$format->{'bold'});
         if ($chosen_output->{'maximum_row'}) {          if ($chosen_output->{'maximum_row'}) {
             $excel_sheet->write($summary_header_row,$cols_output++,              $excel_sheet->write($summary_header_row,$cols_output++,
                                 'Maximum',$format->{'bold'});                                  &mt('Maximum'),$format->{'bold'});
         }          }
         $excel_sheet->write($summary_header_row,$cols_output++,          $excel_sheet->write($summary_header_row,$cols_output++,
                             'Average',$format->{'bold'});                              &mt('Average'),$format->{'bold'});
         $excel_sheet->write($summary_header_row,$cols_output++,          $excel_sheet->write($summary_header_row,$cols_output++,
                             'Median',$format->{'bold'});                              &mt('Median'),$format->{'bold'});
         $excel_sheet->write($summary_header_row,$cols_output++,          $excel_sheet->write($summary_header_row,$cols_output++,
                             'Std Dev',$format->{'bold'});                              &mt('Std Dev'),$format->{'bold'});
         my $row = $summary_header_row+1;          my $row = $summary_header_row+1;
         foreach my $seq (@sequences) {          foreach my $seq (@sequences) {
             my $symb = $seq->symb;              my $symb = $seq->symb;
Line 1673  END Line 1680  END
     # 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(&Apache::lonlocal::locallocaltime(time))).'"'.
             "\n";              "\n";
     print $outputfile '"'.      print $outputfile '"'.
         &Apache::loncommon::csv_translate          &Apache::loncommon::csv_translate
Line 1713  END Line 1720  END
         $sequence_row.='"",'x$count;          $sequence_row.='"",'x$count;
         if ($chosen_output->{'sequence_sum'}) {          if ($chosen_output->{'sequence_sum'}) {
             if($chosen_output->{'correct'}) {              if($chosen_output->{'correct'}) {
                 $resource_row .= '"sum",';                  $resource_row .= '"'.&mt('sum').'",';
             } else {              } else {
                 $resource_row .= '"score",';                  $resource_row .= '"'.&mt('score').'",';
             }              }
         }          }
         if ($chosen_output->{'sequence_max'}) {          if ($chosen_output->{'sequence_max'}) {
             $sequence_row.= '"",';              $sequence_row.= '"",';
             $resource_row .= '"maximum possible",';              $resource_row .= '"'.&mt('maximum possible').'",';
         }          }
     }      }
     if ($chosen_output->{'grand_total'}) {      if ($chosen_output->{'grand_total'}) {
         $sequence_row.= '"",';          $sequence_row.= '"",';
         $resource_row.= '"Total",';          $resource_row.= '"'.&mt('Total').'",';
     }       } 
     if ($chosen_output->{'grand_maximum'}) {      if ($chosen_output->{'grand_maximum'}) {
         $sequence_row.= '"",';          $sequence_row.= '"",';
         $resource_row.= '"Maximum",';          $resource_row.= '"'.&mt('Maximum').'",';
     }       } 
     chomp($sequence_row);      chomp($sequence_row);
     chomp($resource_row);      chomp($resource_row);

Removed from v.1.155  
changed lines
  Added in v.1.162.2.1


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