--- loncom/interface/statistics/lonstudentassessment.pm 2007/12/20 13:57:13 1.146 +++ loncom/interface/statistics/lonstudentassessment.pm 2009/04/04 20:06:49 1.152 @@ -1,6 +1,6 @@ # The LearningOnline Network with CAPA # -# $Id: lonstudentassessment.pm,v 1.146 2007/12/20 13:57:13 bisitz Exp $ +# $Id: lonstudentassessment.pm,v 1.152 2009/04/04 20:06:49 bisitz Exp $ # # Copyright Michigan State University Board of Trustees # @@ -675,7 +675,7 @@ sub html_initialize { $r->print(<<NEW_WINDOW_CHECKBOX); <script type="text/javascript">new_window = true;</script> <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> NEW_WINDOW_CHECKBOX } @@ -713,8 +713,8 @@ NEW_WINDOW_CHECKBOX $width{$symb}->{'width_sum'} += 1; } $total_count += &count_parts($navmap,$seq); - # Use 3 digits for the sum - $width{$symb}->{'width_sum'} += 3; + # Use 6 digits for the sum + $width{$symb}->{'width_sum'} += 6; } # Compute width of maximum if ($chosen_output->{'sequence_max'}) { @@ -722,8 +722,8 @@ NEW_WINDOW_CHECKBOX # One digit for the '/' $width{$symb}->{'width_sum'} +=1; } - # Use 3 digits for the total - $width{$symb}->{'width_sum'}+=3; + # Use 6 digits for the total + $width{$symb}->{'width_sum'}+=6; } # if ($chosen_output->{'every_problem'}) { @@ -849,10 +849,13 @@ sub html_outputstudent { } else { my $error = $1; if (scalar(@tmp) < 1) { - $Str .= '<font color="blue">No Course Data</font>'."\n"; + $Str .= '<span class="LC_warning">' + .&mt('No Course Data') + .'</span>'."\n"; } else { - $Str .= '<span class="LC_error">Error getting student data ('. - $error.') </span>'."\n"; + $Str .= '<span class="LC_error">' + .&mt('Error getting student data ([_1])',$error) + .'</span>'."\n"; } $nodata_count++; $r->print($Str); @@ -882,16 +885,17 @@ sub html_outputstudent { $ratio .= ' '; } if ($chosen_output->{'sequence_sum'} && $score ne ' ') { - my $score .= sprintf("%3.0f",$score); - $ratio .= (' 'x(3-length($score))).$score; + my $score .= sprintf("%3.2f",$score); + $ratio .= (' 'x(6-length($score))).$score; } elsif($chosen_output->{'sequence_sum'}) { - $ratio .= ' 'x3; + $ratio .= ' 'x6; } if ($chosen_output->{'sequence_max'}) { if ($chosen_output->{'sequence_sum'}) { $ratio .= '/'; } - $ratio .= sprintf("%3.0f",$seq_max); + my $sequence_total=sprintf("%3.2f",$seq_max); + $ratio .= $sequence_total.(' 'x(6-length($sequence_total))); } # if (! $chosen_output->{'every_problem'}) { @@ -925,8 +929,8 @@ sub html_outputstudent { if (! defined($score)) { $score = ' ' x $total_sum_width; } else { - $score = sprintf("%.0f",$score); - $score = (' 'x(3-length($score))).$score; + $score = sprintf("%.2f",$score); + $score = (' 'x(6-length($score))).$score; } $Str .= ' '.' 'x($total_sum_width-length($score)).$score.' / '.$max; $Str .= " \n"; @@ -959,12 +963,12 @@ sub html_finish { sub StudentAverageTotal { my $Str = '<h3>'.&mt('Summary Tables').'</h3>'.$/; - $Str .= '<table border=2 cellspacing="1">'."\n"; - $Str .= '<tr>'. + $Str .= &Apache::loncommon::start_data_table(); + $Str .= &Apache::loncommon::start_data_table_header_row(). '<th>'.&mt('Title').'</th>'. '<th>'.&mt('Average').'</th>'. '<th>'.&mt('Maximum').'</th>'. - '</tr>'.$/; + &Apache::loncommon::end_data_table_header_row().$/; foreach my $seq (@sequences) { my $symb = $seq->symb; my $ave; @@ -978,11 +982,13 @@ sub StudentAverageTotal { } my $max = $Statistics->{$symb}->{'max'}; $ave = sprintf("%.2f",$ave); - $Str .= '<tr><td>'.$seq->compTitle.'</td>'. + $Str .= &Apache::loncommon::start_data_table_row(). + '<td>'.$seq->compTitle.'</td>'. '<td align="right">'.$ave.' </td>'. - '<td align="right">'.$max.' '.'</td></tr>'."\n"; + '<td align="right">'.$max.' '.'</td>'. + &Apache::loncommon::end_data_table_row()."\n"; } - $Str .= "</table>\n"; + $Str .= &Apache::loncommon::end_data_table()."\n"; return $Str; } @@ -993,31 +999,36 @@ sub SingleStudentTotal { $student->{'fullname'}, $student->{'username'},$student->{'domain'}).'</h3>'; $Str .= $/; - $Str .= '<table border=2 cellspacing="1">'."\n"; + $Str .= &Apache::loncommon::start_data_table()."\n"; $Str .= - '<tr>'. + &Apache::loncommon::start_data_table_header_row(). '<th>'.&mt('Sequence or Folder').'</th>'; if ($chosen_output->{'base'} eq 'tries') { $Str .= '<th>'.&mt('Parts Correct').'</th>'; } else { $Str .= '<th>'.&mt('Score').'</th>'; } - $Str .= '<th>'.&mt('Maximum').'</th>'."</tr>\n"; + $Str .= '<th>'.&mt('Maximum').'</th>'. + &Apache::loncommon::end_data_table_header_row()."\n"; my $total = 0; my $total_max = 0; foreach my $seq (@sequences) { my $value = $Statistics->{$seq->symb}->{'score'}; my $max = $Statistics->{$seq->symb}->{'max'}; - $Str .= '<tr><td>'.&HTML::Entities::encode($seq->compTitle).'</td>'. + $Str .= &Apache::loncommon::start_data_table_row(). + '<td>'.&HTML::Entities::encode($seq->compTitle).'</td>'. '<td align="right">'.$value.'</td>'. - '<td align="right">'.$max.'</td></tr>'."\n"; + '<td align="right">'.$max.'</td>'. + &Apache::loncommon::end_data_table_row()."\n"; $total += $value; $total_max +=$max; } - $Str .= '<tr><td><b>'.&mt('Total').'</b></td>'. + $Str .= &Apache::loncommon::start_data_table_row(). + '<td><b>'.&mt('Total').'</b></td>'. '<td align="right">'.$total.'</td>'. - '<td align="right">'.$total_max."</td></tr>\n"; - $Str .= "</table>\n"; + '<td align="right">'.$total_max.'</td>'. + &Apache::loncommon::end_data_table_row()."\n"; + $Str .= &Apache::loncommon::end_data_table()."\n"; return $Str; } @@ -1826,7 +1837,7 @@ sub csv_finish { # # Tell the user where to get their csv file $r->print('<br />'. - '<a href="'.$filename.'">'.&mt('Your csv file.').'</a>'."\n"); + '<a href="'.$filename.'">'.&mt('Your CSV file.').'</a>'."\n"); $r->rflush(); &csv_cleanup(); return; @@ -1958,7 +1969,7 @@ sub student_tries_on_sequence { if ( ($links eq 'yes' && $symbol ne ' ') || ($links eq 'all')) { my $link = '/adm/grades'. - '?symb='.&escape($resource->symb). + '?symb='.&escape($resource->shown_symb). '&student='.$student->{'username'}. '&userdom='.$student->{'domain'}. '&command=submission'; @@ -2113,7 +2124,7 @@ sub student_performance_on_sequence { # if ( ($links eq 'yes' && $symbol ne ' ') || ($links eq 'all')) { my $link = '/adm/grades' . - '?symb='.&escape($symb). + '?symb='.&escape($resource->shown_symb). '&student='.$student->{'username'}. '&userdom='.$student->{'domain'}. '&command=submission';