--- loncom/interface/lonprintout.pm 2003/05/02 13:39:04 1.141 +++ loncom/interface/lonprintout.pm 2003/05/02 15:48:26 1.143 @@ -1,7 +1,7 @@ # The LearningOnline Network # Printout # -# $Id: lonprintout.pm,v 1.141 2003/05/02 13:39:04 sakharuk Exp $ +# $Id: lonprintout.pm,v 1.143 2003/05/02 15:48:26 sakharuk Exp $ # # Copyright Michigan State University Board of Trustees # @@ -1389,21 +1389,27 @@ ENDPART if ($helper->{'VARS'}->{'PRINT_TYPE'} eq 'current_document') { - #-- single document - problem, page, html, xml, ... + #-- single document - problem, page, html, xml, ... + my $currentURL; + if (defined $helper->{'VARS'}->{'url'}) { + $currentURL=$helper->{'VARS'}->{'url'}; + } else { + $currentURL=$helper->{'VARS'}->{'postdata'}; + } $selectionmade = 1; - if ($helper->{'VARS'}->{'url'}=~/\.(problem|exam|quiz|assess|survey|form|library|page|xml|html|htm|xhtml|xhtm)$/) { + if ($currentURL=~/\.(problem|exam|quiz|assess|survey|form|library|page|xml|html|htm|xhtml|xhtm)$/) { my %moreenv; $moreenv{'form.grade_target'}='tex'; - if (&Apache::lonnet::allowed('bre',$helper->{'VARS'}->{'url'})) { - $helper->{'VARS'}->{'url'}=~s/http:\/\/[^\/]+//; - } - $moreenv{'request.filename'}=$helper->{'VARS'}->{'url'}; + if (&Apache::lonnet::allowed('bre',$currentURL)) { + $currentURL=~s/http:\/\/[^\/]+//; + } + $moreenv{'request.filename'}=$currentURL; $moreenv{'form.textwidth'}=$LaTeXwidth; &Apache::lonnet::appenv(%moreenv); - my $texversion=&Apache::lonnet::ssi($helper->{'VARS'}->{'url'}); + my $texversion=&Apache::lonnet::ssi($currentURL); &Apache::lonnet::delenv('form.grade_target','form.textwidth','form.counter'); $result .= $texversion; - if ($helper->{'VARS'}->{'url'}=~m/\.page\s*$/) { + if ($currentURL=~m/\.page\s*$/) { ($result,$number_of_columns) = &page_cleanup($result); } } else { @@ -1417,7 +1423,9 @@ ENDPART } - } elsif ($helper->{'VARS'}->{'PRINT_TYPE'} eq 'map_problems') { + } elsif (($helper->{'VARS'}->{'PRINT_TYPE'} eq 'map_problems') or + ($helper->{'VARS'}->{'PRINT_TYPE'} eq 'map_problems_pages') or + ($helper->{'VARS'}->{'PRINT_TYPE'} eq 'all_problems')) { #-- produce an output string my $flag_latex_header_remove = 'NO'; my $flag_page_in_sequence = 'NO'; @@ -1432,9 +1440,11 @@ ENDPART $master_seq[$i]=~/___\d+___(.*)$/; my $urlp='/res/'.$1; if ($helper->{'VARS'}->{'PRINT_TYPE'} eq 'map_problems') { - $selectionmade = 2; -# } elsif ($choice eq 'Standard LaTeX output for whole primary sequence') { -# $selectionmade = 3; + $selectionmade = 2; + } elsif ($helper->{'VARS'}->{'PRINT_TYPE'} eq 'map_problems_pages') { + $selectionmade = 3; + } elsif ($helper->{'VARS'}->{'PRINT_TYPE'} eq 'all_problems') { + $selectionmade = 4; } my %moreenv; $moreenv{'form.grade_target'}='tex'; @@ -1635,7 +1645,7 @@ ENDPART } print $temp_file $result; - +# $r->print(< @@ -1659,7 +1669,7 @@ sub handler { $helper = $result; - my $key; +# my $key; # foreach $key (keys %{$helper->{'VARS'}}) { # $r->print(' '.$key.'->'.$helper->{'VARS'}->{$key}.'
'); # }