--- loncom/interface/lonstatistics.pm 2008/02/22 18:19:38 1.139 +++ loncom/interface/lonstatistics.pm 2008/12/12 17:11:27 1.142.2.1 @@ -1,6 +1,6 @@ # The LearningOnline Network with CAPA # -# $Id: lonstatistics.pm,v 1.139 2008/02/22 18:19:38 raeburn Exp $ +# $Id: lonstatistics.pm,v 1.142.2.1 2008/12/12 17:11:27 raeburn Exp $ # # Copyright Michigan State University Board of Trustees # @@ -462,7 +462,7 @@ sub section_and_enrollment_description { $description = §ion_or_group_text($mode,'section',@sections). ' '.§ion_or_group_text($mode,'group',@groups); if ($mode eq 'localized') { - $description .= &mt(' [_1] access status.',$env{'form.Status'}); + $description .= ' '.&mt($env{'form.Status'}.' access status.'); } elsif ($mode eq 'plaintext') { $description .= ' '.$env{'form.Status'}.' access status.'; } @@ -488,21 +488,21 @@ sub section_or_group_text { ); if (scalar(@items) == 1 && $items[0] ne 'all') { if ($mode eq 'localized') { - $text = &mt('[_1] [_2].',$phrases{$type}{single},$items[0]); + $text = &mt($phrases{$type}{single}.' [_1].',$items[0]); } elsif ($mode eq 'plaintext') { $text = $phrases{$type}{single}.' '.$items[0].'.'; } } elsif (scalar(@items) && $items[0] eq 'all') { if ($mode eq 'localized') { - $text = &mt('[_1].',$phrases{$type}{all}); + $text = &mt($phrases{$type}{all}.'.'); } elsif ($mode eq 'plaintext') { $text = $phrases{$type}{all}.'.'; } } elsif (scalar(@items)) { my $lastitem = pop(@items); if ($mode eq 'localized') { - $text = &mt('[_1] [_2] and [_3].',$phrases{$type}{plural}, + $text = &mt($phrases{$type}{plural}.' [_1] and [_2].', join(', ',@items),$lastitem); } elsif ($mode eq 'plaintext') { $text = $phrases{$type}{plural}.' '.join(', ',@items).' and '. @@ -965,46 +965,55 @@ sub DisplayClasslist { my @selected_sections = &get_selected_sections(); if (! @Students) { if ($selected_sections[0] eq 'all') { - if (lc($env{'form.Status'}) eq 'any') { - $Str .= '

'. - &mt('There are no students in the course.'). - '

'; - } elsif (lc($env{'form.Status'}) eq 'active') { - $Str .= '

'. + if (lc($env{'form.Status'}) eq 'active') { + $Str .= '

'. &mt('There are no currently enrolled students in the course.'). - '

'; + '

'; } elsif (lc($env{'form.Status'}) eq 'expired') { - $Str .= '

'. + $Str .= '

'. &mt('There are no previously enrolled students in the course.'). - '

'; + '

'; + } elsif (lc($env{'form.Status'}) eq 'future') { + $Str .= '

'. + &mt('There are no students with future access in the course.'). + '

'; + } else { # 'any' and any others + $Str .= '

'. + &mt('There are no students in the course.'). + '

'; } } else { - my $sections; - if (lc($env{'form.Status'}) eq 'any') { - $Str .= '

'. - &mt('There are no students in the selected sections.'). - '

'; - } elsif (lc($env{'form.Status'}) eq 'active') { - $Str .= '

'. + if (lc($env{'form.Status'}) eq 'active') { + $Str .= '

'. &mt('There are no currently enrolled students in the selected sections.'). - '

'; + '

'; } elsif (lc($env{'form.Status'}) eq 'expired') { - $Str .= '

'. + $Str .= '

'. &mt('There are no previously enrolled students in the selected sections.'). - '

'; + '

'; + } elsif (lc($env{'form.Status'}) eq 'future') { + $Str .= '

'. + &mt('There are no students with future access in the selected sections.'). + '

'; + } else { # 'any' and any others + $Str .= '

'. + &mt('There are no students in the selected sections.'). + '

'; } } - $Str.= ''. - &mt('Click here to return to the chart').''; + $Str.= '

' + .'' + .&mt('Return to the chart').'' + .'

'; $r->print($Str); $r->rflush(); return; } - # "Click" is asinine but it is probably not my place to change the world. - $Str .= '

Click on a students name or username to view their chart

'; - $Str .= '
'."\n"; - $Str .= ''."\n"; + $Str .= '

'.&mt('Select One Student').'

' + .'

'.&mt("Click on a student's name or username to view their chart").'

' + .&Apache::loncommon::start_data_table() + .&Apache::loncommon::start_data_table_header_row(); foreach my $field (@Fields) { $Str .= ''; } - $Str .= ''."\n"; + $Str .= &Apache::loncommon::end_data_table_header_row(); # - my $alternate = 0; foreach my $student (@Students) { # @Students is a package variable my $sname = $student->{'username'}.':'.$student->{'domain'}; - if($alternate) { - $Str .= ''; - } else { - $Str .= ''; - } - $alternate = ($alternate + 1) % 2; + $Str .= &Apache::loncommon::start_data_table_row(); # foreach my $field (@Fields) { $Str .= ''; } - $Str .= "\n"; + $Str .= &Apache::loncommon::end_data_table_row(); } - $Str .= '
'.&mt($field). '
'; @@ -1032,7 +1035,7 @@ sub DisplayClasslist { $Str .= '&sort='.&escape($env{'form.sort'}); $Str .= '&SelectedStudent='; $Str .= &escape($sname).'">'; - $Str .= $student->{$field}.' '; + $Str .= $student->{$field}.' '; $Str .= ''; } elsif ($field eq 'status') { $Str .= &mt($student->{$field}); @@ -1041,9 +1044,9 @@ sub DisplayClasslist { } $Str .= '
'."\n"; + $Str .= &Apache::loncommon::end_data_table(); # $r->print($Str); $r->rflush(); @@ -1181,12 +1184,13 @@ ENDSTYLE # if (! &Apache::lonmysql::verify_sql_connection()) { my $serveradmin = $r->dir_config('lonAdmEMail'); - $r->print('

'. + $r->print('

'. &mt('Unable to connect to database!'). - '

'); - $r->print('

'. - &mt('Please notify the server administrator '). - ''.$serveradmin.'

'); + '

'); + $r->print('

' + .&mt('Please notify the server administrator [_1]', + ,''.$serveradmin.'') + .'

'); $r->print('

'. &mt('Course Statistics and Charts cannot be '. 'retrieved until the database is restarted. '.