--- loncom/interface/printout.pl 2005/07/05 10:23:35 1.83 +++ loncom/interface/printout.pl 2005/07/25 10:27:51 1.86 @@ -59,11 +59,11 @@ sub is_student { # Debugging: Dump the environment for debugging. # sub dumpenv { - print "
-------------------
"; + print "
-------------------
"; foreach my $key (sort (keys %env)) { - print "
$key -> $env{$key}"; + print "
$key -> $env{$key}"; } - print "
-------------------
"; + print "
-------------------
"; } # @@ -113,7 +113,7 @@ sub send_error_mail { if (&is_student( $courseid, $coursedom)) { # build the subject and message body: - # print "sending message to course coordinators.
"; + # print "sending message to course coordinators.
"; # Todo: Convert badurl into a url from file path: @@ -130,9 +130,9 @@ sub send_error_mail { } my (undef, %receivers) = &Apache::lonfeedback::decide_receiver(undef, 0, 1,1,1); - # print "
sending...section: $env{'request.course.sec'}"; + # print "
sending...section: $env{'request.course.sec'}"; foreach my $dest (keys %receivers) { - # print "
dest is $dest"; + # print "
dest is $dest"; my @destinfo = split(/:/,$dest); my $user = $destinfo[0]; my $dom = $destinfo[1]; @@ -210,7 +210,8 @@ END # print "$status_statement\n"; $not_eps=~s|\/\.\/|\/|g; my $eps_f = $not_eps; - $eps_f =~ s/\.[^.]*$/\.eps/i; + # $eps_f =~ s/\.[^.]*$/\.eps/i; + $eps_f .= '.eps'; # Just append the eps ext. if ($eps_f=~/\/home\/([^\/]+)\/public_html\//) { $eps_f=~s/\/home\/([^\/]+)\/public_html/$1/; $eps_f = '/home/httpd/prtspool/'.$eps_f; @@ -261,7 +262,9 @@ END @texfile=(); for (my $i=1;$i<=$number_of_files;$i++) { my $new_texfile=$texfile; - $new_texfile=~s/\.tex/_$i\.tex/; + $new_texfile=~s/\.tex//; + $new_texfile = sprintf("%s_%03d.tex", $new_texfile,$i); + print "
Produced file: $new_texfile"; push @texfile,$new_texfile; } } @@ -341,7 +344,7 @@ foreach $texfile (@texfile) { $badresource = substr($badtext, $whereitbegins+27, length($badtext) - $whereitbegins - 48); - # print "
failing resourcename: $badresource
"; + # print "
failing resourcename: $badresource
"; } } @@ -350,7 +353,7 @@ foreach $texfile (@texfile) { print "

LaTeX could not successfully parse your tex file.

"; print "It probably has errors in it.
"; print "With very high probability this error occured in ".$badtext."

"; - print "Here are the error messages in the LaTeX log file

";
+	      print "Here are the error messages in the LaTeX log file
";
 	      my $sygnal = 0;
 	      for (my $i=0;$i<=$#content_of_file;$i++) {
 		  if ($content_of_file[$i]=~m/^Runaway argument?/ or $content_of_file[$i]=~m/^!/) {
@@ -364,7 +367,7 @@ foreach $texfile (@texfile) {
 		  }  
 	      }
 	      print "
\n"; - # print "
Advanced role
"; + # print "
Advanced role
"; print "The link to "; $logfilename=~s/\/home\/httpd//; print "Your log file "; @@ -388,12 +391,12 @@ foreach $texfile (@texfile) { # $name_file - is the name of the LaTeX file. # $identifier - is the unique LaTeX identifier.l - print "
There are errors in $badtext"; - print "
These errors prevent this resource from printing correctly"; + print "
There are errors in $badtext"; + print "
These errors prevent this resource from printing correctly"; my $tex_handle = IO::File->new($name_file); my @tex_contents = <$tex_handle>; &send_error_mail($identifier, $badresource, $body_log_file, \@tex_contents); - print "
A message has been sent to the instructor describing this failure
" + print "
A message has been sent to the instructor describing this failure
" } } elsif ($body_log_file=~m//) {