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

albertel lon-capa-cvs-allow@mail.lon-capa.org
Tue, 13 Nov 2007 01:47:59 -0000


This is a MIME encoded message

--albertel1194918479
Content-Type: text/plain

albertel		Mon Nov 12 20:47:59 2007 EDT

  Modified files:              
    /loncom/homework	grades.pm 
    /loncom/interface	lonpickcode.pm loncommon.pm 
  Log:
  - data table the scantron action screen
  
  
--albertel1194918479
Content-Type: text/plain
Content-Disposition: attachment; filename="albertel-20071112204759.txt"

Index: loncom/homework/grades.pm
diff -u loncom/homework/grades.pm:1.488 loncom/homework/grades.pm:1.489
--- loncom/homework/grades.pm:1.488	Mon Nov 12 20:14:32 2007
+++ loncom/homework/grades.pm	Mon Nov 12 20:47:36 2007
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # The LON-CAPA Grading handler
 #
-# $Id: grades.pm,v 1.488 2007/11/13 01:14:32 albertel Exp $
+# $Id: grades.pm,v 1.489 2007/11/13 01:47:36 albertel Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -4901,52 +4901,48 @@
 
     # Chunk of form to prompt for a file to grade and how:
 
-    $result.= <<SCANTRONFORM;
-    <table width="100%" border="0">
-    <tr>
-      <td bgcolor="#777777">
-       <form method="post" enctype="multipart/form-data" action="/adm/grades" name="scantron_process">
-       <input type="hidden" name="command" value="scantron_warning" />
-        $default_form_data
-        <table width="100%" border="0">
-          <tr bgcolor="#e6ffff">
-            <td colspan="2">
-              &nbsp;<b>Specify file and which Folder/Sequence to grade</b>
-            </td>
-          </tr>
-          <tr bgcolor="#ffffe6">
-            <td> Sequence to grade: </td><td> $sequence_selector </td>
-          </tr>
-          <tr bgcolor="#ffffe6">
-            <td> Filename of scoring office file: </td><td> $file_selector </td>
-          </tr>
-          <tr bgcolor="#ffffe6">
-            <td> Format of data file: </td><td> $format_selector </td>
-          </tr>
-          <tr bgcolor="#ffffe6">
-            <td> Saved CODEs to validate against: </td><td> $CODE_selector</td>
-          </tr>
-          <tr bgcolor="#ffffe6">
-            <td> Each CODE is only to be used once:</td><td> $CODE_unique </td>
-          </tr>
-          <tr bgcolor="#ffffe6">
+    $result.= '
+    <br />
+    <form method="post" enctype="multipart/form-data" action="/adm/grades" name="scantron_process">
+    <input type="hidden" name="command" value="scantron_warning" />
+    '.$default_form_data.'
+    '.&Apache::loncommon::start_data_table('LC_scantron_action').'
+       '.&Apache::loncommon::start_data_table_header_row().'
+            <th colspan="2">
+              &nbsp;Specify file and which Folder/Sequence to grade
+            </th>
+       '.&Apache::loncommon::end_data_table_header_row().'
+       '.&Apache::loncommon::start_data_table_row().'
+            <td> Sequence to grade: </td><td> '.$sequence_selector.' </td>
+       '.&Apache::loncommon::end_data_table_row().'
+       '.&Apache::loncommon::start_data_table_row().'
+            <td> Filename of scoring office file: </td><td> '.$file_selector.' </td>
+       '.&Apache::loncommon::end_data_table_row().'
+       '.&Apache::loncommon::start_data_table_row().'
+            <td> Format of data file: </td><td> '.$format_selector.' </td>
+       '.&Apache::loncommon::end_data_table_row().'
+       '.&Apache::loncommon::start_data_table_row().'
+            <td> Saved CODEs to validate against: </td><td> '.$CODE_selector.' </td>
+       '.&Apache::loncommon::end_data_table_row().'
+       '.&Apache::loncommon::start_data_table_row().'
+            <td> Each CODE is only to be used once:</td><td> '.$CODE_unique.' </td>
+       '.&Apache::loncommon::end_data_table_row().'
+       '.&Apache::loncommon::start_data_table_row().'
 	    <td> Options: </td>
             <td>
 	       <label><input type="checkbox" name="scantron_options_redo" value="redo_skipped"/> Do only previously skipped records</label> <br />
                <label><input type="checkbox" name="scantron_options_ignore" value="ignore_corrections"/> Remove all existing corrections</label> <br />
                <label><input type="checkbox" name="scantron_options_hidden" value="ignore_hidden"/> Skip hidden resources when grading</label>
 	    </td>
-          </tr>
-          <tr bgcolor="#ffffe6">
+       '.&Apache::loncommon::end_data_table_row().'
+       '.&Apache::loncommon::start_data_table_row().'
             <td colspan="2">
               <input type="submit" value="Grading: Validate Scantron Records" />
             </td>
-          </tr>
-        </table>
-      </form>
-     </td>
-    </tr>
-SCANTRONFORM
+       '.&Apache::loncommon::end_data_table_row().'
+    '.&Apache::loncommon::end_data_table().'
+    </form>
+';
    
     $r->print($result);
 
@@ -4955,18 +4951,17 @@
 
 	# Chunk of form to prompt for a scantron file upload.
 
-        $r->print(<<SCANTRONFORM);
-    <tr>
-      <td bgcolor="#777777">
-        <table width="100%" border="0">
-          <tr bgcolor="#e6ffff">
-            <td>
-              &nbsp;<b>Specify a Scantron data file to upload.</b>
-            </td>
-          </tr>
-          <tr bgcolor="#ffffe6">
+        $r->print('
+    <br />
+    '.&Apache::loncommon::start_data_table('LC_scantron_action').'
+       '.&Apache::loncommon::start_data_table_header_row().'
+            <th>
+              &nbsp;Specify a Scantron data file to upload.
+            </th>
+       '.&Apache::loncommon::end_data_table_header_row().'
+       '.&Apache::loncommon::start_data_table_row().'
             <td>
-SCANTRONFORM
+');
     my $default_form_data=&defaultFormData(&get_symb($r,1));
     my $cdom= $env{'course.'.$env{'request.course.id'}.'.domain'};
     my $cnum= $env{'course.'.$env{'request.course.id'}.'.num'};
@@ -4992,47 +4987,38 @@
               </form>
 UPLOAD
 
-        $r->print(<<SCANTRONFORM);
+        $r->print('
             </td>
-          </tr>
-        </table>
-      </td>
-    </tr>
-SCANTRONFORM
+       '.&Apache::loncommon::end_data_table_row().'
+       '.&Apache::loncommon::end_data_table().'
+');
     }
 
     # Chunk of the form that prompts to view a scoring office file,
     # corrected file, skipped records in a file.
 
-    $r->print(<<SCANTRONFORM);
-    <tr>
-     <td bgcolor="#777777">
-       <form action='/adm/grades' name='scantron_download'>
-	  $default_form_data
-          <input type="hidden" name="command" value="scantron_download" />
-          <table width="100%" border="0">
-            <tr bgcolor="#e6ffff">
-              <td>
-                &nbsp;<b>Download a scoring office file</b>
-              </td>
-            </tr>
-            <tr bgcolor="#ffffe6">
-              <td> Filename of scoring office file: $file_selector </td>
-            </tr>
-            <tr bgcolor="#ffffe6">
-              <td>
+    $r->print('
+   <br />
+   <form action="/adm/grades" name="scantron_download">
+     '.$default_form_data.'
+     <input type="hidden" name="command" value="scantron_download" />
+     '.&Apache::loncommon::start_data_table('LC_scantron_action').'
+       '.&Apache::loncommon::start_data_table_header_row().'
+              <th>
+                &nbsp;Download a scoring office file
+              </th>
+       '.&Apache::loncommon::end_data_table_header_row().'
+       '.&Apache::loncommon::start_data_table_row().'
+              <td> Filename of scoring office file: '.$file_selector.' 
+                <br />
                 <input type="submit" value="Download: Show List of Associated Files" />
-              </td>
-            </tr>
-          </table>
-        </form>
-      </td>
-    </tr>
-SCANTRONFORM
+       '.&Apache::loncommon::end_data_table_row().'
+     '.&Apache::loncommon::end_data_table().'
+   </form>
+   <br />
+');
 
-    $r->print('<tr><td bgcolor="#777777">');
     &Apache::lonpickcode::code_list($r,2);
-    $r->print('</td></tr></table>');
     $r->print($grading_menu_button);
     return
 }
Index: loncom/interface/lonpickcode.pm
diff -u loncom/interface/lonpickcode.pm:1.14 loncom/interface/lonpickcode.pm:1.15
--- loncom/interface/lonpickcode.pm:1.14	Mon Nov 12 20:14:11 2007
+++ loncom/interface/lonpickcode.pm	Mon Nov 12 20:47:56 2007
@@ -1,7 +1,7 @@
 # The LearningOnline Network
 # Pick a CODE from the list of possible CODEs
 #
-# $Id: lonpickcode.pm,v 1.14 2007/11/13 01:14:11 albertel Exp $
+# $Id: lonpickcode.pm,v 1.15 2007/11/13 01:47:56 albertel Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -92,32 +92,34 @@
     # $context = 1 No page header, print enclosing table
     # $context = 2 No page header, no enclosing table
     my $table_head;
-    my $enc_table_start;
-    my $enc_table_close;
-    
+    my $extra_css;
     if (!$context) {
 	$r->print(&Apache::loncommon::start_page("View CODEs",undef,
 						 {'no_nav_bar' => 1}));
-	$table_head = ('<b>'.&mt('Select a set of saved CODEs to view.')."</b>");
+	$table_head = &mt('Select a set of saved CODEs to view.');
     } elsif ($context eq 1) {
-	$table_head = ('<b>'.&mt('Select another set of saved CODEs to view.')."</b>");
-	$enc_table_start = '<table width="100%"><tr><td bgcolor="#777777">';
-	$enc_table_close = '</tr></td></table>';
+	$table_head = &mt('Select another set of saved CODEs to view.');
     } elsif ($context eq 2) {
-        $table_head = ('<b>'.&mt('Select a set of saved CODEs to view.')."</b>");
+        $table_head = &mt('Select a set of saved CODEs to view.');
+	$extra_css = 'LC_scantron_action';
     }
     $r->print("<form method='post' action='/adm/pickcode' name='pickcode'>");
-    $r->print($enc_table_start);
-    $r->print('<table width="100%">');
-    $r->print('<tr><td bgcolor="#e6ffff">');
+    $r->print('
+     '.&Apache::loncommon::start_data_table($extra_css).'
+       '.&Apache::loncommon::start_data_table_header_row());
+    $r->print('<th>');
     $r->print($table_head);
-    $r->print('</td></tr>');
-    $r->print('<tr><td bgcolor="#ffffe6">');
+    $r->print('</th>');
+    $r->print('
+       '.&Apache::loncommon::end_data_table_header_row().'
+       '.&Apache::loncommon::start_data_table_row());
+    $r->print('<td>');
     $r->print("<input type='submit' name='submit' value='".&mt("View:")."' /> ");
     $r->print(&Apache::grades::scantron_CODElist());
-    $r->print('</td></tr>');
-    $r->print('</table>');
-    $r->print($enc_table_close); # conditional
+    $r->print('</td>');
+    $r->print('
+       '.&Apache::loncommon::end_data_table_row().'
+       '.&Apache::loncommon::end_data_table());
     $r->print("<input type='hidden' name='command' value='showcodes' />");
     $r->print("<input type='hidden' name='symb' value='".$env{'form.symb'}."' />");
     $r->print("<input type='hidden' name='url' value='".$env{'form.url'}."' />");
Index: loncom/interface/loncommon.pm
diff -u loncom/interface/loncommon.pm:1.612 loncom/interface/loncommon.pm:1.613
--- loncom/interface/loncommon.pm:1.612	Fri Nov  9 22:51:46 2007
+++ loncom/interface/loncommon.pm	Mon Nov 12 20:47:56 2007
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # a pile of common routines
 #
-# $Id: loncommon.pm,v 1.612 2007/11/10 03:51:46 raeburn Exp $
+# $Id: loncommon.pm,v 1.613 2007/11/13 01:47:56 albertel Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -5097,6 +5097,12 @@
   right: 1em;
 }
 
+table.LC_scantron_action {
+  width: 100%;
+}
+table.LC_scantron_action tr th {
+  font: normal bold $sans;
+}
 
 div.LC_edit_problem_header {
   font: normal medium $sans;

--albertel1194918479--