--- loncom/interface/statistics/lonstudentassessment.pm 2008/09/16 13:10:19 1.150 +++ loncom/interface/statistics/lonstudentassessment.pm 2009/08/10 16:32:32 1.156 @@ -1,6 +1,6 @@ # The LearningOnline Network with CAPA # -# $Id: lonstudentassessment.pm,v 1.150 2008/09/16 13:10:19 bisitz Exp $ +# $Id: lonstudentassessment.pm,v 1.156 2009/08/10 16:32:32 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 .= '<input type="button" value="'. - 'Previous Student ('. - $previous->{'username'}.'@'.$previous->{'domain'}.')'. + &mt('Previous Student ([_1])', + $previous->{'username'}.':'.$previous->{'domain'}). '" onclick="document.Statistics.SelectedStudent.value='. "'".$sname."'".';'. 'document.Statistics.submit();" />'; } else { $previousbutton .= '<input type="button" value="'. - 'Previous student (none)'.'" />'; + &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 .= '<input type="button" value="'. - 'Next Student ('. - $next->{'username'}.'@'.$next->{'domain'}.')'. + &mt('Next Student ([_1])', + $next->{'username'}.':'.$next->{'domain'}). '" onclick="document.Statistics.SelectedStudent.value='. "'".$sname."'".';'. 'document.Statistics.submit();" />'; } else { $nextbutton .= '<input type="button" value="'. - 'Next student (none)'.'" />'; + &mt('Next Student').'" disabled="disabled" />'; } # # Build the 'all students' button my $all = ''; - $all .= '<input type="button" value="All Students" '. + $all .= '<input type="button" value="'.&mt('All Students').'" '. '" onclick="document.Statistics.SelectedStudent.value='. "''".';'.'document.Statistics.submit();" />'; $Str .= $previousbutton.(' 'x5).$all.(' 'x5).$nextbutton; @@ -361,19 +361,19 @@ sub CreateInterface { $Str .= &CreateAndParseOutputDataSelector(); $Str .= '</td></tr>'."\n"; $Str .= '</table>'."\n"; - $Str .= '<input type="submit" name="Generate Chart" value="'. - &mt('Generate Chart').'" />'; - $Str .= ' 'x5; + $Str .= '<p>' + .&mt('Status:').' ' + .'<input type="text" name="stats_status" size="60" value="" readonly="readonly" />' + .'</p>'; $Str .= '<input type="submit" name="selectstudent" value="'. &mt('Select One Student').'" />'; $Str .= ' 'x5; $Str .= '<input type="submit" name="ClearCache" value="'. &mt('Clear Caches').'" />'; - $Str .= ' 'x5; - $Str .= - &mt('Status [_1]', - '<input type="text" name="stats_status" size="60" value="" readonly="readonly" />'); - $Str .= '<br />'; + $Str .= '<p>' + .'<input type="submit" name="Generate Chart"' + .' value="'.&mt('Generate Chart').'" />' + .'</p>'; return $Str; } @@ -663,9 +663,9 @@ sub html_initialize { &Apache::lonstatistics::selected_sequences_with_assessments(); if (! ref($navmap)) { # Unable to get data, so bail out - $r->print("<h3>". - &mt('Unable to retrieve course information.'). - '</h3>'); + $r->print('<p class="LC_error">' + .&mt('Unable to retrieve course information.') + .'</p>'); } # If we're showing links, show a checkbox to open in new @@ -675,14 +675,14 @@ 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 } # $r->print("<h3>".$env{'course.'.$env{'request.course.id'}.'.description'}. - " ".localtime(time)."</h3>"); + " ".&Apache::lonlocal::locallocaltime(time)."</h3>"); # if ($chosen_output->{'base'} !~ /^final table/) { $r->print("<h3>".&mt($chosen_output->{'shortdesc'})."</h3>"); @@ -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'}) { @@ -885,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'}) { @@ -928,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"; @@ -1438,14 +1439,10 @@ sub excel_initialize { if ($env{'form.SelectedStudent'}) { $studentcount = '1'; } - if ($studentcount > 1) { - $r->print('<h1>'.&mt('Compiling Excel spreadsheet for [_1] students', - $studentcount)."</h1>\n"); - } else { - $r->print('<h1>'. - &mt('Compiling Excel spreadsheet for 1 student'). - "</h1>\n"); - } + $r->print('<p>' + .&mt('Compiling Excel spreadsheet for [quant,_1,student]...',$studentcount) + ."</p>\n" + ); $r->rflush(); # # Initialize progress window @@ -1593,7 +1590,7 @@ sub excel_finish { # # Tell the user where to get their excel file $r->print('<br />'. - '<a href="'.$filename.'">Your Excel spreadsheet.</a>'."\n"); + '<a href="'.$filename.'">'.&mt('Your Excel spreadsheet').'</a>'."\n"); $r->rflush(); &excel_cleanup(); return;