[LON-CAPA-cvs] cvs: loncom /interface loncommon.pm

albertel lon-capa-cvs-allow@mail.lon-capa.org
Fri, 26 Oct 2007 00:23:47 -0000


albertel		Thu Oct 25 20:23:47 2007 EDT

  Modified files:              
    /loncom/interface	loncommon.pm 
  Log:
  - data table the view of the previous data
  
  
Index: loncom/interface/loncommon.pm
diff -u loncom/interface/loncommon.pm:1.595 loncom/interface/loncommon.pm:1.596
--- loncom/interface/loncommon.pm:1.595	Thu Oct 25 20:22:36 2007
+++ loncom/interface/loncommon.pm	Thu Oct 25 20:23:45 2007
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # a pile of common routines
 #
-# $Id: loncommon.pm,v 1.595 2007/10/26 00:22:36 albertel Exp $
+# $Id: loncommon.pm,v 1.596 2007/10/26 00:23:45 albertel Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -2948,14 +2948,14 @@
 	  $lasthash{$key}=$returnhash{$version.':'.$key};
         }
       }
-      $prevattempts='<table border="0" width="100%"><tr><td bgcolor="#777777">';
-      $prevattempts.='<table border="0" width="100%"><tr bgcolor="#e6ffff"><td>History</td>';
+      $prevattempts=&start_data_table().&start_data_table_header_row();
+      $prevattempts.='<th>'.&mt('History').'</th>';
       foreach my $key (sort(keys(%lasthash))) {
 	my ($ign,@parts) = split(/\./,$key);
 	if ($#parts > 0) {
 	  my $data=$parts[-1];
 	  pop(@parts);
-	  $prevattempts.='<td>Part '.join('.',@parts).'<br />'.$data.'&nbsp;</td>';
+	  $prevattempts.='<th>'.&mt('Part ').join('.',@parts).'<br />'.$data.'&nbsp;</th>';
 	} else {
 	  if ($#parts == 0) {
 	    $prevattempts.='<th>'.$parts[0].'</th>';
@@ -2964,28 +2964,37 @@
 	  }
 	}
       }
+      $prevattempts.=&end_data_table_header_row();
       if ($getattempt eq '') {
 	for ($version=1;$version<=$returnhash{'version'};$version++) {
-	  $prevattempts.='</tr><tr bgcolor="#ffffe6"><td>Transaction '.$version.'</td>';
+	  $prevattempts.=&start_data_table_row().
+	      '<td>'.&mt('Transaction [_1]',$version).'</td>';
 	    foreach my $key (sort(keys(%lasthash))) {
 		my $value = &format_previous_attempt_value($key,
 							   $returnhash{$version.':'.$key});
 		$prevattempts.='<td>'.$value.'&nbsp;</td>';   
 	    }
+	  $prevattempts.=&end_data_table_row();
 	 }
       }
-      $prevattempts.='</tr><tr bgcolor="#ffffe6"><td>Current</td>';
+      $prevattempts.=&start_data_table_row().'<td>'.&mt('Current').'</td>';
       foreach my $key (sort(keys(%lasthash))) {
 	my $value = &format_previous_attempt_value($key,$lasthash{$key});
 	if ($key =~/$regexp$/ && (defined &$gradesub)) {$value = &$gradesub($value)}
 	$prevattempts.='<td>'.$value.'&nbsp;</td>';
       }
-      $prevattempts.='</tr></table></td></tr></table>';
+      $prevattempts.= &end_data_table_row().&end_data_table();
     } else {
-      $prevattempts='Nothing submitted - no attempts.';
+      $prevattempts=
+	  &start_data_table().&start_data_table_row().
+	  '<td>'.&mt('Nothing submitted - no attempts.').'</td>'.
+	  &end_data_table_row().&end_data_table();
     }
   } else {
-    $prevattempts='No data.';
+    $prevattempts=
+	  &start_data_table().&start_data_table_row().
+	  '<td>'.&mt('No data.').'</td>'.
+	  &end_data_table_row().&end_data_table();
   }
 }