[LON-CAPA-cvs] cvs: rat / lonpage.pm

sakharuk lon-capa-cvs@mail.lon-capa.org
Mon, 01 Jul 2002 15:02:19 -0000


sakharuk		Mon Jul  1 11:02:19 2002 EDT

  Modified files:              
    /rat	lonpage.pm 
  Log:
  capable to print pages with multiple columns
  
  
Index: rat/lonpage.pm
diff -u rat/lonpage.pm:1.42 rat/lonpage.pm:1.43
--- rat/lonpage.pm:1.42	Thu Jun 27 14:48:30 2002
+++ rat/lonpage.pm	Mon Jul  1 11:02:19 2002
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # Page Handler
 #
-# $Id: lonpage.pm,v 1.42 2002/06/27 18:48:30 sakharuk Exp $
+# $Id: lonpage.pm,v 1.43 2002/07/01 15:02:19 sakharuk Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -152,10 +152,10 @@
        $r->send_http_header;
        return OK;
    }
- 
+  
    &Apache::loncommon::get_unprocessed_cgi($ENV{'QUERY_STRING'},
                                           ['forceselect','launch']);
-
+  my $number_of_columns = 1;
   my $requrl=$r->uri;  
   my $target = $ENV{'form.grade_target'};
 # ----------------------------------------------------------------- Tie db file
@@ -196,7 +196,6 @@
 
 # ------------------------------------------------------------------ Page parms
 
-                  my $number_of_columns = 1;
                   my $j;
                   my $lcm=1;
                   my $contents=0;
@@ -380,6 +379,7 @@
 # ----------------------------------------------------------------- Start table
 		      if ($target eq 'tex') {
 			  $r->print('\begin{longtable}INSERTTHEHEADOFLONGTABLE\endfirsthead\endhead ');
+			  if ($number_of_columns le $lcm) {$number_of_columns=$lcm;};
 		      } else {
 			  $r->print('<table cols="'.$lcm.'" border="0">');
 		      }
@@ -471,14 +471,14 @@
 			      unless ($target eq 'tex') {
 				  $r->print('</td>');
 			      } else {
-				  $number_of_columns++;
-				  $r->print(' & ');
+                                  for (my $incol=1;$incol<=$avespan;$incol++) {
+				      $r->print(' & ');
+				  }
 			      }
                           }
 			      unless ($target eq 'tex') {
 				  $r->print('</tr>');
 			      } else {
-				  $number_of_columns = 1;
 				  $r->print('REMOVETHEHEADOFLONGTABLE\\\\');
 			      }
 		        }