[LON-CAPA-cvs] cvs: loncom /interface printout.pl

albertel lon-capa-cvs@mail.lon-capa.org
Wed, 23 Mar 2005 22:37:46 -0000


albertel		Wed Mar 23 17:37:46 2005 EDT

  Modified files:              
    /loncom/interface	printout.pl 
  Log:
  - correct the speeling of some vars
  - BUG#4026, in some cases you would end up with no links to the log/tex files
  
  
Index: loncom/interface/printout.pl
diff -u loncom/interface/printout.pl:1.74 loncom/interface/printout.pl:1.75
--- loncom/interface/printout.pl:1.74	Tue Mar 15 06:19:28 2005
+++ loncom/interface/printout.pl	Wed Mar 23 17:37:46 2005
@@ -1,7 +1,7 @@
 #!/usr/bin/perl
 # CGI-script to run LaTeX, dvips, ps2ps, ps2pdf etc.
 #
-# $Id: printout.pl,v 1.74 2005/03/15 11:19:28 foxr Exp $
+# $Id: printout.pl,v 1.75 2005/03/23 22:37:46 albertel Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -65,7 +65,7 @@
   my $selectionmade = $ENV{'cgi.'.$identifier.'.selection'};
   my $tableofcontents = $ENV{'cgi.'.$identifier.'tableofcontents'};
   my $tableofindex = $ENV{'cgi.'.$identifier.'tableofindex'};
-  my $advans_role = $ENV{'cgi.'.$identifier.'role'};
+  my $advanced_role = $ENV{'cgi.'.$identifier.'role'};
   my $number_of_files = $ENV{'cgi.'.$identifier.'numberoffiles'}+1;
   my $student_names = $ENV{'cgi.'.$identifier.'studentnames'};
   my $backref = &Apache::lonnet::unescape($ENV{'cgi.'.$identifier.'backref'});
@@ -245,7 +245,7 @@
 	      }  
 	  }
 	  print "</pre>\n";
-          if ($advans_role) {  
+          if ($advanced_role) {  
               print "<b><big>The link to ";
               $logfilename=~s/\/home\/httpd//;
 	      print "<a href=\"$logfilename\">Your log file </a></big></b>";
@@ -324,26 +324,26 @@
 #	  unlink @garb;
 	      unlink $duefile;
 	      print "<a href=\"/prtspool/$pdf_file\">Your PDF document</a>";
-	      if ($advans_role) {  
-		  print "<br /><br />";
-		  print "<b><big>The link to ";
-		  $logfilename=~s/\/home\/httpd//;
-		  print "<a href=\"$logfilename\">Your log file </a></big></b>";
-		  print "\n";
-		  #link tooriginal LaTeX file (included according Michael Hamlin desire)
-		  my $tex_temporary_file=IO::File->new($texfile) || die "Couldn't open tex file $texfile for reading: $!\n";
-		  my @tex_content_of_file = <$tex_temporary_file>;
-		  close $tex_temporary_file; 
-		  my $body_tex_file = join(' ',@tex_content_of_file);
-		  $texfile =~ s/\.tex$/aaaaa\.html/;
-		  $tex_temporary_file = IO::File->new('>'.$texfile); 
-		  print $tex_temporary_file '<html><head><title>LOGFILE</title></head><body><pre>'.$body_tex_file.'</pre></body></html>'."\n";
-		  print "<br /><br />";
-		  print "<b><big>The link to ";
-		  $texfile=~s/\/home\/httpd//;
-		  print "<a href=\"$texfile\">Your original LaTeX file </a></big></b>";
-		  print "\n";
-	      }
+	  }
+	  if ($advanced_role) {  
+	      print "<br /><br />";
+	      print "<b><big>The link to ";
+	      $logfilename=~s/\/home\/httpd//;
+	      print "<a href=\"$logfilename\">Your log file </a></big></b>";
+	      print "\n";
+	      #link tooriginal LaTeX file (included according Michael Hamlin desire)
+	      my $tex_temporary_file=IO::File->new($texfile) || die "Couldn't open tex file $texfile for reading: $!\n";
+	      my @tex_content_of_file = <$tex_temporary_file>;
+	      close $tex_temporary_file; 
+	      my $body_tex_file = join(' ',@tex_content_of_file);
+	      $texfile =~ s/\.tex$/aaaaa\.html/;
+	      $tex_temporary_file = IO::File->new('>'.$texfile); 
+	      print $tex_temporary_file '<html><head><title>LOGFILE</title></head><body><pre>'.$body_tex_file.'</pre></body></html>'."\n";
+	      print "<br /><br />";
+	      print "<b><big>The link to ";
+	      $texfile=~s/\/home\/httpd//;
+	      print "<a href=\"$texfile\">Your original LaTeX file </a></big></b>";
+	      print "\n";
 	  }
       } else {
 	  #LaTeX successfully parsed tex file