version 1.74, 2005/03/15 11:19:28
|
version 1.76, 2005/04/07 06:56:23
|
Line 27
|
Line 27
|
# |
# |
|
|
use lib '/home/httpd/lib/perl'; |
use lib '/home/httpd/lib/perl'; |
use LONCAPA::loncgi(); |
use LONCAPA::loncgi; |
use File::Path; |
use File::Path; |
use IO::File; |
use IO::File; |
use Image::Magick; |
use Image::Magick; |
Line 38 use Apache::lonlocal;
|
Line 38 use Apache::lonlocal;
|
|
|
use strict; |
use strict; |
$|=1; |
$|=1; |
my %origENV=%ENV; |
|
if (! &LONCAPA::loncgi::check_cookie_and_load_env()) { |
if (! &LONCAPA::loncgi::check_cookie_and_load_env()) { |
print <<END; |
print <<END; |
Content-type: text/html |
Content-type: text/html |
Line 58 END
|
Line 57 END
|
print $bodytag; |
print $bodytag; |
|
|
my $identifier = $ENV{'QUERY_STRING'}; |
my $identifier = $ENV{'QUERY_STRING'}; |
my $texfile = $ENV{'cgi.'.$identifier.'.file'}; |
my $texfile = $env{'cgi.'.$identifier.'.file'}; |
my $laystyle = $ENV{'cgi.'.$identifier.'.layout'}; |
my $laystyle = $env{'cgi.'.$identifier.'.layout'}; |
my $numberofcolumns = $ENV{'cgi.'.$identifier.'.numcol'}; |
my $numberofcolumns = $env{'cgi.'.$identifier.'.numcol'}; |
my $paper = $ENV{'cgi.'.$identifier.'.paper'}; |
my $paper = $env{'cgi.'.$identifier.'.paper'}; |
my $selectionmade = $ENV{'cgi.'.$identifier.'.selection'}; |
my $selectionmade = $env{'cgi.'.$identifier.'.selection'}; |
my $tableofcontents = $ENV{'cgi.'.$identifier.'tableofcontents'}; |
my $tableofcontents = $env{'cgi.'.$identifier.'tableofcontents'}; |
my $tableofindex = $ENV{'cgi.'.$identifier.'tableofindex'}; |
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 $number_of_files = $env{'cgi.'.$identifier.'numberoffiles'}+1; |
my $student_names = $ENV{'cgi.'.$identifier.'studentnames'}; |
my $student_names = $env{'cgi.'.$identifier.'studentnames'}; |
my $backref = &Apache::lonnet::unescape($ENV{'cgi.'.$identifier.'backref'}); |
my $backref = &Apache::lonnet::unescape($env{'cgi.'.$identifier.'backref'}); |
|
|
|
|
my $adv = $ENV{'request.role.adv'}; |
my $adv = $env{'request.role.adv'}; |
|
|
my @names_pack=(); |
my @names_pack=(); |
if ($student_names=~/_END_/) { |
if ($student_names=~/_END_/) { |
@names_pack=split(/_ENDPERSON_/,$student_names); |
@names_pack=split(/_ENDPERSON_/,$student_names); |
} |
} |
#got what we needed reset ENV in case it is to big for system |
|
%ENV=%origENV; |
|
|
|
my $figfile = $texfile; |
my $figfile = $texfile; |
$figfile =~ s/^([^\.]+printout)[^t]+\.tex/$1\.dat/; |
$figfile =~ s/^([^\.]+printout)[^t]+\.tex/$1\.dat/; |
Line 245 foreach $texfile (@texfile) {
|
Line 242 foreach $texfile (@texfile) {
|
} |
} |
} |
} |
print "</pre>\n"; |
print "</pre>\n"; |
if ($advans_role) { |
if ($advanced_role) { |
print "<b><big>The link to "; |
print "<b><big>The link to "; |
$logfilename=~s/\/home\/httpd//; |
$logfilename=~s/\/home\/httpd//; |
print "<a href=\"$logfilename\">Your log file </a></big></b>"; |
print "<a href=\"$logfilename\">Your log file </a></big></b>"; |
Line 324 foreach $texfile (@texfile) {
|
Line 321 foreach $texfile (@texfile) {
|
# unlink @garb; |
# unlink @garb; |
unlink $duefile; |
unlink $duefile; |
print "<a href=\"/prtspool/$pdf_file\">Your PDF document</a>"; |
print "<a href=\"/prtspool/$pdf_file\">Your PDF document</a>"; |
if ($advans_role) { |
} |
print "<br /><br />"; |
if ($advanced_role) { |
print "<b><big>The link to "; |
print "<br /><br />"; |
$logfilename=~s/\/home\/httpd//; |
print "<b><big>The link to "; |
print "<a href=\"$logfilename\">Your log file </a></big></b>"; |
$logfilename=~s/\/home\/httpd//; |
print "\n"; |
print "<a href=\"$logfilename\">Your log file </a></big></b>"; |
#link tooriginal LaTeX file (included according Michael Hamlin desire) |
print "\n"; |
my $tex_temporary_file=IO::File->new($texfile) || die "Couldn't open tex file $texfile for reading: $!\n"; |
#link tooriginal LaTeX file (included according Michael Hamlin desire) |
my @tex_content_of_file = <$tex_temporary_file>; |
my $tex_temporary_file=IO::File->new($texfile) || die "Couldn't open tex file $texfile for reading: $!\n"; |
close $tex_temporary_file; |
my @tex_content_of_file = <$tex_temporary_file>; |
my $body_tex_file = join(' ',@tex_content_of_file); |
close $tex_temporary_file; |
$texfile =~ s/\.tex$/aaaaa\.html/; |
my $body_tex_file = join(' ',@tex_content_of_file); |
$tex_temporary_file = IO::File->new('>'.$texfile); |
$texfile =~ s/\.tex$/aaaaa\.html/; |
print $tex_temporary_file '<html><head><title>LOGFILE</title></head><body><pre>'.$body_tex_file.'</pre></body></html>'."\n"; |
$tex_temporary_file = IO::File->new('>'.$texfile); |
print "<br /><br />"; |
print $tex_temporary_file '<html><head><title>LOGFILE</title></head><body><pre>'.$body_tex_file.'</pre></body></html>'."\n"; |
print "<b><big>The link to "; |
print "<br /><br />"; |
$texfile=~s/\/home\/httpd//; |
print "<b><big>The link to "; |
print "<a href=\"$texfile\">Your original LaTeX file </a></big></b>"; |
$texfile=~s/\/home\/httpd//; |
print "\n"; |
print "<a href=\"$texfile\">Your original LaTeX file </a></big></b>"; |
} |
print "\n"; |
} |
} |
} else { |
} else { |
#LaTeX successfully parsed tex file |
#LaTeX successfully parsed tex file |