--- loncom/interface/statistics/lonstudentassessment.pm 2006/12/21 02:53:42 1.144 +++ loncom/interface/statistics/lonstudentassessment.pm 2008/09/16 13:10:19 1.150 @@ -1,6 +1,6 @@ # The LearningOnline Network with CAPA # -# $Id: lonstudentassessment.pm,v 1.144 2006/12/21 02:53:42 albertel Exp $ +# $Id: lonstudentassessment.pm,v 1.150 2008/09/16 13:10:19 bisitz Exp $ # # Copyright Michigan State University Board of Trustees # @@ -372,7 +372,7 @@ sub CreateInterface { $Str .= ' 'x5; $Str .= &mt('Status [_1]', - ''); + ''); $Str .= ''; return $Str; } @@ -671,9 +671,10 @@ sub html_initialize { # If we're showing links, show a checkbox to open in new # windows. if ($show_links ne 'no') { + my $labeltext = &mt('Show links in new window:'); $r->print(<new_window = true; -Show links in new window: +$labeltext NEW_WINDOW_CHECKBOX @@ -684,7 +685,7 @@ NEW_WINDOW_CHECKBOX " ".localtime(time).""); # if ($chosen_output->{'base'} !~ /^final table/) { - $r->print("".$chosen_output->{'shortdesc'}.""); + $r->print("".&mt($chosen_output->{'shortdesc'}).""); } my $Str = "\n"; # First, the @StudentData fields need to be listed @@ -848,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); @@ -958,12 +962,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(). ''.&mt('Title').''. ''.&mt('Average').''. ''.&mt('Maximum').''. - ''.$/; + &Apache::loncommon::end_data_table_header_row().$/; foreach my $seq (@sequences) { my $symb = $seq->symb; my $ave; @@ -977,11 +981,13 @@ sub StudentAverageTotal { } my $max = $Statistics->{$symb}->{'max'}; $ave = sprintf("%.2f",$ave); - $Str .= ''.$seq->compTitle.''. + $Str .= &Apache::loncommon::start_data_table_row(). + ''.$seq->compTitle.''. ''.$ave.' '. - ''.$max.' '.''."\n"; + ''.$max.' '.''. + &Apache::loncommon::end_data_table_row()."\n"; } - $Str .= "\n"; + $Str .= &Apache::loncommon::end_data_table()."\n"; return $Str; } @@ -992,31 +998,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(). ''.&mt('Sequence or Folder').''; if ($chosen_output->{'base'} eq 'tries') { $Str .= ''.&mt('Parts Correct').''; } else { $Str .= ''.&mt('Score').''; } - $Str .= ''.&mt('Maximum').''."\n"; + $Str .= ''.&mt('Maximum').''. + &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 .= ''.&HTML::Entities::encode($seq->compTitle).''. + $Str .= &Apache::loncommon::start_data_table_row(). + ''.&HTML::Entities::encode($seq->compTitle).''. ''.$value.''. - ''.$max.''."\n"; + ''.$max.''. + &Apache::loncommon::end_data_table_row()."\n"; $total += $value; $total_max +=$max; } - $Str .= ''.&mt('Total').''. + $Str .= &Apache::loncommon::start_data_table_row(). + ''.&mt('Total').''. ''.$total.''. - ''.$total_max."\n"; - $Str .= "\n"; + ''.$total_max.''. + &Apache::loncommon::end_data_table_row()."\n"; + $Str .= &Apache::loncommon::end_data_table()."\n"; return $Str; } @@ -1825,7 +1836,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; @@ -1956,11 +1967,8 @@ sub student_tries_on_sequence { # if ( ($links eq 'yes' && $symbol ne ' ') || ($links eq 'all')) { - if (length($symbol) > 1) { - &Apache::lonnet::logthis('length of symbol "'.$symbol.'" > 1'); - } my $link = '/adm/grades'. - '?symb='.&escape($resource->symb). + '?symb='.&escape($resource->shown_symb). '&student='.$student->{'username'}. '&userdom='.$student->{'domain'}. '&command=submission'; @@ -2115,7 +2123,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';
Show links in new window: +$labeltext NEW_WINDOW_CHECKBOX @@ -684,7 +685,7 @@ NEW_WINDOW_CHECKBOX " ".localtime(time).""); # if ($chosen_output->{'base'} !~ /^final table/) { - $r->print("".$chosen_output->{'shortdesc'}.""); + $r->print("".&mt($chosen_output->{'shortdesc'}).""); } my $Str = "\n"; # First, the @StudentData fields need to be listed @@ -848,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); @@ -958,12 +962,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(). ''.&mt('Title').''. ''.&mt('Average').''. ''.&mt('Maximum').''. - ''.$/; + &Apache::loncommon::end_data_table_header_row().$/; foreach my $seq (@sequences) { my $symb = $seq->symb; my $ave; @@ -977,11 +981,13 @@ sub StudentAverageTotal { } my $max = $Statistics->{$symb}->{'max'}; $ave = sprintf("%.2f",$ave); - $Str .= ''.$seq->compTitle.''. + $Str .= &Apache::loncommon::start_data_table_row(). + ''.$seq->compTitle.''. ''.$ave.' '. - ''.$max.' '.''."\n"; + ''.$max.' '.''. + &Apache::loncommon::end_data_table_row()."\n"; } - $Str .= "\n"; + $Str .= &Apache::loncommon::end_data_table()."\n"; return $Str; } @@ -992,31 +998,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(). ''.&mt('Sequence or Folder').''; if ($chosen_output->{'base'} eq 'tries') { $Str .= ''.&mt('Parts Correct').''; } else { $Str .= ''.&mt('Score').''; } - $Str .= ''.&mt('Maximum').''."\n"; + $Str .= ''.&mt('Maximum').''. + &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 .= ''.&HTML::Entities::encode($seq->compTitle).''. + $Str .= &Apache::loncommon::start_data_table_row(). + ''.&HTML::Entities::encode($seq->compTitle).''. ''.$value.''. - ''.$max.''."\n"; + ''.$max.''. + &Apache::loncommon::end_data_table_row()."\n"; $total += $value; $total_max +=$max; } - $Str .= ''.&mt('Total').''. + $Str .= &Apache::loncommon::start_data_table_row(). + ''.&mt('Total').''. ''.$total.''. - ''.$total_max."\n"; - $Str .= "\n"; + ''.$total_max.''. + &Apache::loncommon::end_data_table_row()."\n"; + $Str .= &Apache::loncommon::end_data_table()."\n"; return $Str; } @@ -1825,7 +1836,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; @@ -1956,11 +1967,8 @@ sub student_tries_on_sequence { # if ( ($links eq 'yes' && $symbol ne ' ') || ($links eq 'all')) { - if (length($symbol) > 1) { - &Apache::lonnet::logthis('length of symbol "'.$symbol.'" > 1'); - } my $link = '/adm/grades'. - '?symb='.&escape($resource->symb). + '?symb='.&escape($resource->shown_symb). '&student='.$student->{'username'}. '&userdom='.$student->{'domain'}. '&command=submission'; @@ -2115,7 +2123,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';
$labeltext
\n"; # First, the @StudentData fields need to be listed @@ -848,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); @@ -958,12 +962,12 @@ sub html_finish { sub StudentAverageTotal { my $Str = ''.&mt('Summary Tables').''.$/; - $Str .= '