--- loncom/interface/lonprintout.pm 2001/09/18 14:35:11 1.4 +++ loncom/interface/lonprintout.pm 2001/10/02 14:09:25 1.6 @@ -19,7 +19,7 @@ use strict; use Apache::Constants qw(:common); use Apache::lonxml; use Apache::lonnet; -use Apache::File; +use Apache::File(); @@ -51,6 +51,7 @@ ENDMENUOUT } + sub output_data { my $r = shift; $r->print(<new($file)) { - $r->log_error("Couldn't open $file for output"); - return SERVER_ERROR; + { + my $temp_file; + $filename = "/home/httpd/prtspool/$ENV{'environment.firstname'}$ENV{'environment.lastname'}temp$ENV{'user.login.time'}.tex"; + unless ($temp_file = Apache::File->new('>'.$filename)) { + $r->log_error("Couldn't open $filename for output $!"); + return SERVER_ERROR; + } + print $temp_file $result; } - $r->print($result); + + } elsif ($choice eq 'Standard LaTeX output for the whole sequence') { my $current_file = '/res/'.$ENV{'request.ambiguous'}; @@ -88,27 +95,65 @@ ENDPART my $filecontents=&Apache::lonnet::getfile($file); $result = &Apache::lonxml::xmlparse('tex',$filecontents,'',%mystyle); - $result = &content_map($result); - $r->print($result); + my @number_seq = &content_map($result); + $r->print(@number_seq); + } + + $r->print(< FINALEND } + + sub content_map { #-- find a list of files to publish my $map_string = shift; - + my @number_seq = (); + my $startlink = index($map_string,'',$startlink); + my $chunk = substr($map_string,$startlink,$endlink-$startlink+7); + substr($map_string,$startlink,$endlink-$startlink+7) = ''; + $_ = $chunk; + m/from=\"(\d+)\"/; + push @number_seq,$1; + m/to=\"(\d+)\"/; + push @number_seq,$1; + $startlink = index($map_string,'',$start); +# my $chunk = substr($map_string,$start,$finish-$start+7); +# substr($map_string,$start,$finish-$start+7) = ''; +# $_ = $chunk; +# m/from=\"(\d+)\"/; +# push @one,$1; +# m/to=\"(\d+)\"/; +# push @two,$1; +# $start = index($map_string,'print(' SS '.$ere.' => '.$ENV{$ere}.' FF '."\n\n"); +# }