Diff for /loncom/interface/statistics/lonstudentassessment.pm between versions 1.150 and 1.150.2.4

version 1.150, 2008/09/16 13:10:19 version 1.150.2.4, 2010/02/12 15:11:08
Line 248  sub next_and_previous_buttons { Line 248  sub next_and_previous_buttons {
     if (defined($previous)) {      if (defined($previous)) {
         my $sname = $previous->{'username'}.':'.$previous->{'domain'};          my $sname = $previous->{'username'}.':'.$previous->{'domain'};
         $previousbutton .= '<input type="button" value="'.          $previousbutton .= '<input type="button" value="'.
             'Previous Student ('.              &mt('Previous Student ([_1])',
             $previous->{'username'}.'@'.$previous->{'domain'}.')'.              $previous->{'username'}.':'.$previous->{'domain'}).
             '" onclick="document.Statistics.SelectedStudent.value='.              '" onclick="document.Statistics.SelectedStudent.value='.
             "'".$sname."'".';'.              "'".$sname."'".';'.
             'document.Statistics.submit();" />';              'document.Statistics.submit();" />';
     } else {      } else {
         $previousbutton .= '<input type="button" value="'.          $previousbutton .= '<input type="button" value="'.
             'Previous student (none)'.'" />';              &mt('Previous student').'" disabled="disabled" />';
     }      }
     #      #
     # Build the next student link      # Build the next student link
Line 264  sub next_and_previous_buttons { Line 264  sub next_and_previous_buttons {
     if (defined($next)) {      if (defined($next)) {
         my $sname = $next->{'username'}.':'.$next->{'domain'};          my $sname = $next->{'username'}.':'.$next->{'domain'};
         $nextbutton .= '<input type="button" value="'.          $nextbutton .= '<input type="button" value="'.
             'Next Student ('.              &mt('Next Student ([_1])',
             $next->{'username'}.'@'.$next->{'domain'}.')'.              $next->{'username'}.':'.$next->{'domain'}).
             '" onclick="document.Statistics.SelectedStudent.value='.              '" onclick="document.Statistics.SelectedStudent.value='.
             "'".$sname."'".';'.              "'$sname'".';'.
             'document.Statistics.submit();" />';              'document.Statistics.submit();" />';
     } else {      } else {
         $nextbutton .= '<input type="button" value="'.          $nextbutton .= '<input type="button" value="'.
             'Next student (none)'.'" />';              &mt('Next student').'" disabled="disabled" />';
     }      }
     #      #
     # Build the 'all students' button      # Build the 'all students' button
     my $all = '';      my $all = '';
     $all .= '<input type="button" value="All Students" '.      $all .= '<input type="button" value="'.&mt('All Students').'" '.
             '" onclick="document.Statistics.SelectedStudent.value='.              '" onclick="document.Statistics.SelectedStudent.value='.
             "''".';'.'document.Statistics.submit();" />';              "''".';'.'document.Statistics.submit();" />';
     $Str .= $previousbutton.('&nbsp;'x5).$all.('&nbsp;'x5).$nextbutton;      $Str .= $previousbutton.('&nbsp;'x5).$all.('&nbsp;'x5).$nextbutton;
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 .= '&nbsp;'x5;      $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 .= '<br />';  
     return $Str;      return $Str;
 }  }
   
Line 546  my @OutputDataOptions = Line 547  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 555  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 665  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
Line 675  sub html_initialize { Line 677  sub html_initialize {
         $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>$labeltext 
 <input type="checkbox" checked="1" onclick="new_window=this.checked" />  <input type="checkbox" checked="checked" onclick="new_window=this.checked" />
 </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 994  sub StudentAverageTotal { Line 996  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 1177  sub excel_initialize { Line 1179  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 1259  sub excel_initialize { Line 1261  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 1279  sub excel_initialize { Line 1281  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 1293  sub excel_initialize { Line 1295  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 1388  sub excel_initialize { Line 1390  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 1438  sub excel_initialize { Line 1440  sub excel_initialize {
     if ($env{'form.SelectedStudent'}) {      if ($env{'form.SelectedStudent'}) {
         $studentcount = '1';          $studentcount = '1';
     }      }
     if ($studentcount > 1) {      $r->print('<p>'
         $r->print('<h1>'.&mt('Compiling Excel spreadsheet for [_1] students',               .&mt('Compiling Excel spreadsheet for [quant,_1,student]...',$studentcount)
                              $studentcount)."</h1>\n");              ."</p>\n"
     } else {      );
         $r->print('<h1>'.  
                   &mt('Compiling Excel spreadsheet for 1 student').  
                   "</h1>\n");  
     }  
     $r->rflush();      $r->rflush();
     #      #
     # Initialize progress window      # Initialize progress window
Line 1593  sub excel_finish { Line 1591  sub excel_finish {
     #      #
     # Tell the user where to get their excel file      # Tell the user where to get their excel file
     $r->print('<br />'.      $r->print('<br />'.
               '<a href="'.$filename.'">Your Excel spreadsheet.</a>'."\n");                '<a href="'.$filename.'">'.&mt('Your Excel spreadsheet').'</a>'."\n");
     $r->rflush();      $r->rflush();
     &excel_cleanup();      &excel_cleanup();
     return;      return;
Line 1716  END Line 1714  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.150  
changed lines
  Added in v.1.150.2.4


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