--- loncom/interface/statistics/lonstudentassessment.pm	2007/12/20 13:57:13	1.146
+++ loncom/interface/statistics/lonstudentassessment.pm	2009/08/14 12:37:44	1.150.2.3
@@ -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.150.2.3 2009/08/14 12:37:44 raeburn 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."'".';'.
+            "'$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.('&nbsp;'x5).$all.('&nbsp;'x5).$nextbutton;
@@ -361,19 +361,20 @@ sub CreateInterface {
     $Str .= &CreateAndParseOutputDataSelector();
     $Str .= '</td></tr>'."\n";
     $Str .= '</table>'."\n";
-    $Str .= '<input type="submit" name="Generate Chart" value="'.
-        &mt('Generate Chart').'" />';
-    $Str .= '&nbsp;'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 .= '&nbsp;'x5;
     $Str .= '<input type="submit" name="ClearCache" value="'.
         &mt('Clear Caches').'" />';
-    $Str .= '&nbsp;'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 +664,9 @@ sub html_initialize {
         &Apache::lonstatistics::selected_sequences_with_assessments();
     if (! ref($navmap)) {
         # Unable to get data, so bail out
-        $r->print("<h3>".
+        $r->print('<p class="LC_error">'.
                   &mt('Unable to retrieve course information.').
-                  '</h3>');
+                  '</p>');
     }
 
     # If we're showing links, show a checkbox to open in new
@@ -675,14 +676,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'}.
-              "&nbsp;&nbsp;".localtime(time)."</h3>");
+              "&nbsp;&nbsp;".&Apache::lonlocal::locallocaltime(time)."</h3>");
     #
     if ($chosen_output->{'base'} !~ /^final table/) {
         $r->print("<h3>".&mt($chosen_output->{'shortdesc'})."</h3>");        
@@ -849,10 +850,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);
@@ -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.'&nbsp;</td>'.
-            '<td align="right">'.$max.'&nbsp;'.'</td></tr>'."\n";
+            '<td align="right">'.$max.'&nbsp;'.'</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;
 }
 
@@ -1428,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
@@ -1583,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;
@@ -1826,7 +1833,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 +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';