[LON-CAPA-cvs] cvs: loncom /homework lonhomework.pm /localize/localize de.pm zh.pm

bisitz bisitz@source.lon-capa.org
Thu, 26 Mar 2009 18:21:28 -0000


bisitz		Thu Mar 26 18:21:28 2009 EDT

  Modified files:              
    /loncom/homework	lonhomework.pm 
    /loncom/localize/localize	de.pm zh.pm 
  Log:
  Optimizations and standardization for "Calculate answers" screen
  - Replaced special table by standard data_table
  - Optimized &mt usage
  - Make the headline a headline
  - Removed calls of non existing styles "thinborder" and "center"
  - Shortened code lines by inserting line breaks
  
  
Index: loncom/homework/lonhomework.pm
diff -u loncom/homework/lonhomework.pm:1.307 loncom/homework/lonhomework.pm:1.308
--- loncom/homework/lonhomework.pm:1.307	Thu Mar 26 12:03:45 2009
+++ loncom/homework/lonhomework.pm	Thu Mar 26 18:21:24 2009
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # The LON-CAPA Homework handler
 #
-# $Id: lonhomework.pm,v 1.307 2009/03/26 12:03:45 bisitz Exp $
+# $Id: lonhomework.pm,v 1.308 2009/03/26 18:21:24 bisitz Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -777,29 +777,48 @@
     }
     &Apache::lonhtmlcommon::Update_PrgWin($request,\%prog_state,
 					  &mt('Analyzing Results'));
-    $request->print('<hr class="LC_edit_problem_divide" />'.&mt('List of possible answers').': ');
+    $request->print('<hr class="LC_edit_problem_divide" />'
+                   .'<h3>'
+                   .&mt('List of possible answers')
+                   .'</h3>'
+    );
     foreach my $part (sort(keys(%allparts))) {
 	if (defined(@{ $overall{$part.'.answer'} })) {
 	    for (my $i=0;$i<scalar(@{ $overall{$part.'.answer'} });$i++) {
 		my $num_cols=scalar(@{ $overall{$part.'.answer'}[$i][0] });
-		$request->print('<table class="thinborder"><tr><th colspan="'.($num_cols+1).'">'.&mt('Part').' '.$part);
+                $request->print(&Apache::loncommon::start_data_table()
+                               .&Apache::loncommon::start_data_table_header_row()
+                               .'<th colspan="'.($num_cols+1).'">'
+                               .&mt('Part').' '.$part
+                );
 		if (scalar(@{ $overall{$part.'.answer'} }) > 1) {
-		    $request->print(&mt(' Answer [_1]',$i+1));
+		    $request->print(' '.&mt('Answer [_1]',$i+1));
 		}
-		$request->print('</th></tr>');
+		$request->print('</th>'
+                               .&Apache::loncommon::end_data_table_header_row()
+                );
 		my %frequency;
 		foreach my $answer (sort {$a->[0] <=> $b->[0]} (@{ $overall{$part.'.answer'}[$i] })) {
 		    $frequency{join("\0",@{ $answer })}++;
 		}
-		$request->print('<tr><th colspan="'.($num_cols).'">'.&mt('Answer').'</th><th>'.&mt('Frequency').'<br />('
-				.&mt('click for example').')</th></tr>');
+                $request->print(&Apache::loncommon::start_data_table_header_row()
+                               .'<th colspan="'.($num_cols).'">'.&mt('Answer').'</th>'
+                               .'<th>'.&mt('Frequency').'<br />'
+                               .'('.&mt('click for example').')</th>'
+                               .&Apache::loncommon::end_data_table_header_row()
+                );
 		foreach my $answer (sort {(split("\0",$a))[0] <=> (split("\0",$b))[0]} (keys(%frequency))) {
-		    $request->print('<tr><td class="center">'.
-				    join('</td><td class="center">',split("\0",$answer)).
-				    '</td><td class="center"><a href="'.$request->uri.'?rndseed='.$seedexample{join("\0",$part,$i,$answer)}.'">'.$frequency{$answer}.
-				    '</a></td></tr>');
+                    $request->print(&Apache::loncommon::start_data_table_row()
+                                   .'<td>'
+                                   .join('</td><td>',split("\0",$answer))
+				   .'</td>'
+                                   .'<td>'
+                                   .'<a href="'.$request->uri.'?rndseed='.$seedexample{join("\0",$part,$i,$answer)}.'">'.$frequency{$answer}.'</a>'
+				   .'</td>'
+                                   .&Apache::loncommon::end_data_table_row()
+                    );
 		}
-		$request->print('</table>');
+                $request->print(&Apache::loncommon::end_data_table());
 	    }
 	} else {
             $request->print('<p class="LC_warning">'
Index: loncom/localize/localize/de.pm
diff -u loncom/localize/localize/de.pm:1.264 loncom/localize/localize/de.pm:1.265
--- loncom/localize/localize/de.pm:1.264	Thu Mar 26 16:50:16 2009
+++ loncom/localize/localize/de.pm	Thu Mar 26 18:21:27 2009
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # German Localization Lexicon
 #
-# $Id: de.pm,v 1.264 2009/03/26 16:50:16 bisitz Exp $
+# $Id: de.pm,v 1.265 2009/03/26 18:21:27 bisitz Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -11309,8 +11309,8 @@
    'Public'
 => 'Öffentlich',
 
-   ' Answer [_1]'
-=> ' Antwort [_1]',
+   'Answer [_1]'
+=> 'Antwort [_1]',
 
    'EditXML [_1]'
 => 'XML-Editor [_1]',
Index: loncom/localize/localize/zh.pm
diff -u loncom/localize/localize/zh.pm:1.34 loncom/localize/localize/zh.pm:1.35
--- loncom/localize/localize/zh.pm:1.34	Thu Mar 26 16:50:16 2009
+++ loncom/localize/localize/zh.pm	Thu Mar 26 18:21:27 2009
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # Chinese Simplified Localization Lexicon
 #
-# $Id: zh.pm,v 1.34 2009/03/26 16:50:16 bisitz Exp $
+# $Id: zh.pm,v 1.35 2009/03/26 18:21:27 bisitz Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -11427,8 +11427,8 @@
    'Public'
 => '公开的',
 
-   ' Answer [_1]'
-=> ' 答复 [_1]',
+   'Answer [_1]'
+=> '答复 [_1]',
 
    'EditXML [_1]'
 => 'XML-编辑器 [_1]',