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

sakharuk lon-capa-cvs@mail.lon-capa.org
Mon, 05 Aug 2002 19:18:43 -0000


sakharuk		Mon Aug  5 15:18:43 2002 EDT

  Modified files:              
    /loncom/interface	lonprintout.pm 
  Log:
   remove one stupid line which I forgot to remove earlier.
  
  
Index: loncom/interface/lonprintout.pm
diff -u loncom/interface/lonprintout.pm:1.46 loncom/interface/lonprintout.pm:1.47
--- loncom/interface/lonprintout.pm:1.46	Fri Aug  2 14:27:04 2002
+++ loncom/interface/lonprintout.pm	Mon Aug  5 15:18:43 2002
@@ -1,7 +1,7 @@
 # The LearningOnline Network
 # Printout
 #
-# $Id: lonprintout.pm,v 1.46 2002/08/02 18:27:04 sakharuk Exp $
+# $Id: lonprintout.pm,v 1.47 2002/08/05 19:18:43 sakharuk Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -167,11 +167,6 @@
 	my $sequence_file=&Apache::lonnet::filelocation("",$primary_sequence);
 	my $sequencefilecontents=&Apache::lonnet::getfile($sequence_file);
 	my @master_seq = &content_map($sequencefilecontents);
-#
-#	for (my $iu=0;$iu<=$#master_seq;$iu++) {
-#	    $result .= ' '.$master_seq[$iu].'    ';
-#	}
-#
         #-- produce an output string
 	for (my $i=0;$i<=$#master_seq;$i++) {
 	    $_ = $master_seq[$i];
@@ -200,26 +195,47 @@
     }  elsif ($choice eq 'Standard LaTeX output for the top level sequence') {
 	my @master_seq = ();
 	my @add_file_seq = ();
-#-- where is the main sequence of the course?
+        # where is the main sequence of the course?
 	my $main_seq = '/res/'.$ENV{'request.course.uri'};
 	my $file=&Apache::lonnet::filelocation("",$main_seq);
 	my $filecontents=&Apache::lonnet::getfile($file);
 	my @file_seq = &content_map($filecontents);
-#-- do we have any other sequence inside?
-	my $i=0;
+        # do we have any other sequence inside?
+#	$result.=$#file_seq.'   ';
+	my $i=1;
 	while ($i<=$#file_seq) {
-	    $_ = $file_seq[$i];
-	    if (/\.sequence$/) {
+#	    $result.='      '.$file_seq[$i].'    ';
+	    $file_seq[$i]=~s/^"//;
+	    $file_seq[$i]=~s/"$//;
+	    if ($file_seq[$i]=~m/\.sequence\s*$/) {
 		$file = &Apache::lonnet::filelocation("",$file_seq[$i]);
+#		$result.='  location    '.$file.'   ';
+#		$result .= 'FFFFFFFFF'.$file.'  ';
 		$filecontents=&Apache::lonnet::getfile($file);
 		@add_file_seq = &content_map($filecontents);
+
+#
+#	for (my $iu=0;$iu<=$#add_file_seq;$iu++) {
+#	    $result .= ' SDSD '.$add_file_seq[$iu].' FDFD   ';
+#	}
+#
+
+
 		splice(@file_seq,$i,1,@add_file_seq);
 		@add_file_seq = ();
 		$i = -1;
 	    }
 	    $i++;
+	    last; #do not forget to remove 
 	}
 	@master_seq = @file_seq;	
+
+#
+#	for (my $iu=0;$iu<=$#file_seq;$iu++) {
+#	    $result .= ' SSS '.$file_seq[$iu].' FFF   ';
+#	}
+#
+
 #-- produce an output string
 	for (my $i=0;$i<=$#master_seq;$i++) {
 	    $_ = $master_seq[$i];
@@ -307,10 +323,10 @@
 	$first_comment = index($result,'<!--',$first_comment);
     }
     $result =~ s/^\s+$//gm; #remove empty lines
-    $result =~ s/([^\\])%/\$1\%/g;   #corrects %
+    $result =~ s/\s%/\\%/g;   #corrects %
     $result =~ s/(\s)+/$1/g; #removes more than one empty space
     $result =~ s/\\\\\s*\\vskip/\\vskip/gm;
-    $result =~ s/ (<|>|) / \$$1\$ /g; #corrects < or >
+#    $result =~ s/ (<|>|) / \$$1\$ /g; #corrects < or >
     $result =~ s/\\\\\s*\\noindent\s*(\\\\)+/\\\\\\noindent /g;
     $result =~ s/{\\par }\s*\\\\/\\\\/gm;
 	$result =~ s/\\\\\s+\[/ \[/g;