--- loncom/interface/printout.pl 2005/06/04 20:48:33 1.82 +++ loncom/interface/printout.pl 2005/07/05 10:23:35 1.83 @@ -330,15 +330,12 @@ foreach $texfile (@texfile) { $temporary_file = IO::File->new('>'.$logfilename); print $temporary_file 'LOGFILE
'.$body_log_file.'
'."\n"; if ($body_log_file=~m/!\s+Emergency stop/) { - #LaTeX failed to parse tex file - print "

LaTeX could not successfully parse your tex file.

"; - print "It probably has errors in it.
"; my $whereitbegins = rindex $body_log_file,'STAMPOFPASSEDRESOURCESTART'; my $whereitends = rindex $body_log_file,'STAMPOFPASSEDRESOURCEEND'; my $badresource; + my $badtext; if ($whereitbegins!=-1 and $whereitends!=-1) { - my $badtext = substr($body_log_file,$whereitbegins+26, $whereitends-$whereitbegins-26); - print "With very high probability this error occured in ".$badtext."

"; + $badtext = substr($body_log_file,$whereitbegins+26, $whereitends-$whereitbegins-26); $whereitbegins = rindex $badtext,'located in'; if ($whereitbegins != -1) { @@ -347,21 +344,26 @@ foreach $texfile (@texfile) { # print "
failing resourcename: $badresource
"; } } - 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/^!/) {
-		  $sygnal = 1;
-	      } 
-	      if ($content_of_file[$i]=~m/Here is how much of/) {
-		  $sygnal = 0;
-	      } 
-	      if ($sygnal) {
-		  print "$content_of_file[$i]";
-	      }  
-	  }
-	  print "
\n"; + if ($advanced_role) { + #LaTeX failed to parse tex file + 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

";
+	      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/^!/) {
+		      $sygnal = 1;
+		  } 
+		  if ($content_of_file[$i]=~m/Here is how much of/) {
+		      $sygnal = 0;
+		  } 
+		  if ($sygnal) {
+		      print "$content_of_file[$i]";
+		  }  
+	      }
+	      print "
\n"; # print "
Advanced role
"; print "The link to "; $logfilename=~s/\/home\/httpd//; @@ -386,9 +388,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"; 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
" } } elsif ($body_log_file=~m//) {