version 1.88, 2005/08/03 10:34:03
|
version 1.91, 2005/09/16 19:36:08
|
Line 121 sub send_error_mail {
|
Line 121 sub send_error_mail {
|
my $subject = "Error [$badurl] Print failed for $user".'@'.$domain; |
my $subject = "Error [$badurl] Print failed for $user".'@'.$domain; |
my $message .= "Print failed to render LaTeX for $user".'@'."$domain\n"; |
my $message .= "Print failed to render LaTeX for $user".'@'."$domain\n"; |
$message .= " User was attempting to print: \n"; |
$message .= " User was attempting to print: \n"; |
$message .= " $resources\n"; |
foreach my $resource (split(/:/,$resources)) { |
|
$message .= " $resource\n"; |
|
} |
$message .= "--------------------LaTeX logfile:------------ \n"; |
$message .= "--------------------LaTeX logfile:------------ \n"; |
$message .= $logfile; |
$message .= $logfile; |
$message .= "-----------------LaTeX source file: ------------\n"; |
$message .= "-----------------LaTeX source file: ------------\n"; |
Line 285 foreach $texfile (@texfile) {
|
Line 287 foreach $texfile (@texfile) {
|
my $name_range=''; |
my $name_range=''; |
if ($tempo_array[3]) { |
if ($tempo_array[3]) { |
$name=$tempo_array[3]; |
$name=$tempo_array[3]; |
my @full_names = split(/,/,$name); # split last name from others... |
($name_range) = split(/,/,$name, 2); |
$name_range = $full_names[0]; |
|
} else { |
} else { |
$name=$tempo_array[0].'@'.$tempo_array[1]; |
$name=$tempo_array[0].'@'.$tempo_array[1]; |
$name_range = $tempo_array[0]; |
$name_range = $tempo_array[0]; |
Line 299 foreach $texfile (@texfile) {
|
Line 300 foreach $texfile (@texfile) {
|
@tempo_array=split(/:/,$stud_info[-1]); |
@tempo_array=split(/:/,$stud_info[-1]); |
if ($tempo_array[3]) { |
if ($tempo_array[3]) { |
$name=$tempo_array[3]; |
$name=$tempo_array[3]; |
my @full_names = split(/,/, $name); |
my ($lastname) = split(/,/, $name,2); |
$name_range .= "-".$full_names[0]; |
$name_range .= "-".$lastname; |
} else { |
} else { |
$name=$tempo_array[0].'@'.$tempo_array[1]; |
$name=$tempo_array[0].'@'.$tempo_array[1]; |
$name_range .= '-'.$tempo_array[0]; |
$name_range .= '-'.$tempo_array[0]; |
Line 382 foreach $texfile (@texfile) {
|
Line 383 foreach $texfile (@texfile) {
|
print "It probably has errors in it.<br />"; |
print "It probably has errors in it.<br />"; |
print "With very high probability this error occured in ".$badtext."<br /><br />"; |
print "With very high probability this error occured in ".$badtext."<br /><br />"; |
print "Here are the error messages in the LaTeX log file<br /><pre>"; |
print "Here are the error messages in the LaTeX log file<br /><pre>"; |
|
|
my $sygnal = 0; |
my $sygnal = 0; |
for (my $i=0;$i<=$#content_of_file;$i++) { |
for (my $i=0;$i<=$#content_of_file;$i++) { |
if ($content_of_file[$i]=~m/^Runaway argument?/ or $content_of_file[$i]=~m/^!/) { |
if ($content_of_file[$i]=~m/^Runaway argument?/ or $content_of_file[$i]=~m/^!/) { |
Line 413 foreach $texfile (@texfile) {
|
Line 415 foreach $texfile (@texfile) {
|
$texfile=~s/\/home\/httpd//; |
$texfile=~s/\/home\/httpd//; |
print "<a href=\"$texfile\">Your original LaTeX file </a></big></b>"; |
print "<a href=\"$texfile\">Your original LaTeX file </a></big></b>"; |
print "\n"; |
print "\n"; |
|
my $help_text = &Apache::loncommon::help_open_topic("Print_Resource", "Help on printing"); |
|
print ("$help_text"); |
|
|
} else { # Student role... |
} else { # Student role... |
# at this point: |
# at this point: |
# $body_log_file - contains the log file. |
# $body_log_file - contains the log file. |
Line 424 foreach $texfile (@texfile) {
|
Line 429 foreach $texfile (@texfile) {
|
my $tex_handle = IO::File->new($name_file); |
my $tex_handle = IO::File->new($name_file); |
my @tex_contents = <$tex_handle>; |
my @tex_contents = <$tex_handle>; |
&send_error_mail($identifier, $badresource, $body_log_file, \@tex_contents); |
&send_error_mail($identifier, $badresource, $body_log_file, \@tex_contents); |
print "<br />A message has been sent to the instructor describing this failure<br />" |
print "<br />A message has been sent to the instructor describing this failure<br />"; |
|
my $help_text = &Apache::loncommon::help_open_topic("Print_Resource", "Help on printing"); |
|
print ("$help_text"); |
|
|
} |
} |
|
|
} elsif ($body_log_file=~m/<inserted text>/) { |
} elsif ($body_log_file=~m/<inserted text>/) { |