[LON-CAPA-cvs] cvs: loncom /interface printout.pl
sakharuk
lon-capa-cvs@mail.lon-capa.org
Thu, 28 Aug 2003 13:52:22 -0000
sakharuk Thu Aug 28 09:52:22 2003 EDT
Modified files:
/loncom/interface printout.pl
Log:
Bug 2076 (which is not a bug but rather enhancement) is partly fixed: in the batch mode I added a link to original LaTeX source file (michael hamlin wanted to have this). Continue to work with the case of plane LaTeX processing (without batch mode).
Index: loncom/interface/printout.pl
diff -u loncom/interface/printout.pl:1.33 loncom/interface/printout.pl:1.34
--- loncom/interface/printout.pl:1.33 Thu Aug 14 10:46:52 2003
+++ loncom/interface/printout.pl Thu Aug 28 09:52:22 2003
@@ -95,7 +95,7 @@
my $tempobegin=$whereitbegins;
$whereitbegins = rindex $body_log_file,'STAMPOFPASSEDRESOURCESTART',$whereitbegins;
my $whereitends = index $body_log_file,'STAMPOFPASSEDRESOURCEEND',$whereitbegins;
- print "<br />It has found an error in".substr($body_log_file,$whereitbegins+26,$whereitends-$whereitbegins-26)." and corrected it.\n";
+ print "<br />It has found an error in".substr($body_log_file,$whereitbegins+26,$whereitends-$whereitbegins-26)." <br /> and corrected it.\n";
print "Usually this correction is valid but you probably need to check the indicated resource one more time and implement neccessary corrections by yourself.\n";
$whereitbegins = index $body_log_file,'<inserted text>',$tempobegin+10;
}
@@ -136,6 +136,19 @@
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 file 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 {