--- loncom/interface/statistics/lonstudentassessment.pm 2007/12/20 13:57:13 1.146 +++ loncom/interface/statistics/lonstudentassessment.pm 2009/05/17 23:13:49 1.155 @@ -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.155 2009/05/17 23:13:49 bisitz Exp $ # # Copyright Michigan State University Board of Trustees # @@ -248,14 +248,14 @@ sub next_and_previous_buttons { if (defined($previous)) { my $sname = $previous->{'username'}.':'.$previous->{'domain'}; $previousbutton .= ''; } else { $previousbutton .= ''; + &mt('Previous Student').'" disabled="disabled" />'; } # # Build the next student link @@ -264,19 +264,19 @@ sub next_and_previous_buttons { if (defined($next)) { my $sname = $next->{'username'}.':'.$next->{'domain'}; $nextbutton .= ''; } else { $nextbutton .= ''; + &mt('Next Student').'" disabled="disabled" />'; } # # Build the 'all students' button my $all = ''; - $all .= ''; $Str .= $previousbutton.(' 'x5).$all.(' 'x5).$nextbutton; @@ -369,11 +369,11 @@ sub CreateInterface { $Str .= ' 'x5; $Str .= ''; - $Str .= ' 'x5; + $Str .= '

'; $Str .= &mt('Status [_1]', ''); - $Str .= '
'; + $Str .= '

'; return $Str; } @@ -675,7 +675,7 @@ sub html_initialize { $r->print(<new_window = true;

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 .= 'No Course Data'."\n"; + $Str .= '' + .&mt('No Course Data') + .''."\n"; } else { - $Str .= 'Error getting student data ('. - $error.') '."\n"; + $Str .= '' + .&mt('Error getting student data ([_1])',$error) + .''."\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 = '

'.&mt('Summary Tables').'

'.$/; - $Str .= ''."\n"; - $Str .= ''. + $Str .= &Apache::loncommon::start_data_table(); + $Str .= &Apache::loncommon::start_data_table_header_row(). ''. ''. ''. - ''.$/; + &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 .= ''. + $Str .= &Apache::loncommon::start_data_table_row(). + ''. ''. - ''."\n"; + ''. + &Apache::loncommon::end_data_table_row()."\n"; } - $Str .= "
'.&mt('Title').''.&mt('Average').''.&mt('Maximum').'
'.$seq->compTitle.''.$seq->compTitle.''.$ave.' '.$max.' '.'
'.$max.' '.'
\n"; + $Str .= &Apache::loncommon::end_data_table()."\n"; return $Str; } @@ -993,31 +999,36 @@ sub SingleStudentTotal { $student->{'fullname'}, $student->{'username'},$student->{'domain'}).''; $Str .= $/; - $Str .= ''."\n"; + $Str .= &Apache::loncommon::start_data_table()."\n"; $Str .= - ''. + &Apache::loncommon::start_data_table_header_row(). ''; if ($chosen_output->{'base'} eq 'tries') { $Str .= ''; } else { $Str .= ''; } - $Str .= ''."\n"; + $Str .= ''. + &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 .= ''. + $Str .= &Apache::loncommon::start_data_table_row(). + ''. ''. - ''."\n"; + ''. + &Apache::loncommon::end_data_table_row()."\n"; $total += $value; $total_max +=$max; } - $Str .= ''. + $Str .= &Apache::loncommon::start_data_table_row(). + ''. ''. - '\n"; - $Str .= "
'.&mt('Sequence or Folder').''.&mt('Parts Correct').''.&mt('Score').''.&mt('Maximum').'
'.&mt('Maximum').'
'.&HTML::Entities::encode($seq->compTitle).''.&HTML::Entities::encode($seq->compTitle).''.$value.''.$max.'
'.$max.'
'.&mt('Total').''.&mt('Total').''.$total.''.$total_max."
\n"; + ''.$total_max.''. + &Apache::loncommon::end_data_table_row()."\n"; + $Str .= &Apache::loncommon::end_data_table()."\n"; return $Str; } @@ -1428,14 +1439,10 @@ sub excel_initialize { if ($env{'form.SelectedStudent'}) { $studentcount = '1'; } - if ($studentcount > 1) { - $r->print('

'.&mt('Compiling Excel spreadsheet for [_1] students', - $studentcount)."

\n"); - } else { - $r->print('

'. - &mt('Compiling Excel spreadsheet for 1 student'). - "

\n"); - } + $r->print('

' + .&mt('Compiling Excel spreadsheet for [quant,_1,student]...',$studentcount) + ."

\n" + ); $r->rflush(); # # Initialize progress window @@ -1583,7 +1590,7 @@ sub excel_finish { # # Tell the user where to get their excel file $r->print('
'. - 'Your Excel spreadsheet.'."\n"); + ''.&mt('Your Excel spreadsheet').''."\n"); $r->rflush(); &excel_cleanup(); return; @@ -1826,7 +1833,7 @@ sub csv_finish { # # Tell the user where to get their csv file $r->print('
'. - ''.&mt('Your csv file.').''."\n"); + ''.&mt('Your CSV file.').''."\n"); $r->rflush(); &csv_cleanup(); return; @@ -1958,7 +1965,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 +2120,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';