--- loncom/interface/lonprintout.pm 2003/05/08 18:33:03 1.158 +++ loncom/interface/lonprintout.pm 2003/05/13 20:42:39 1.165 @@ -1,7 +1,7 @@ # The LearningOnline Network # Printout # -# $Id: lonprintout.pm,v 1.158 2003/05/08 18:33:03 sakharuk Exp $ +# $Id: lonprintout.pm,v 1.165 2003/05/13 20:42:39 sakharuk Exp $ # # Copyright Michigan State University Board of Trustees # @@ -1380,7 +1380,19 @@ ENDPART $moreenv{'form.textwidth'}=$LaTeXwidth; &Apache::lonnet::appenv(%moreenv); my $texversion=&Apache::lonnet::ssi($currentURL); - &Apache::lonnet::delenv('form.grade_target','form.textwidth','form.counter'); + &Apache::lonnet::delenv('form.grade_target'); + &Apache::lonnet::delenv('form.textwidth'); + &Apache::lonnet::delenv('form.counter'); + if($helper->{'VARS'}->{'ANSWER_TYPE'} eq 'no') { + $moreenv{'form.grade_target'}='answer'; + $moreenv{'form.print_answer'}='yes'; + &Apache::lonnet::appenv(%moreenv); + my $answer=&Apache::lonnet::ssi($currentURL); + &Apache::lonnet::delenv('form.grade_target'); + &Apache::lonnet::delenv('form.print_answer'); +# $r->print('
'.$answer.''); return OK; + $texversion=~s/(\\end{document})/$answer$1/; + } $result .= $texversion; if ($currentURL=~m/\.page\s*$/) { ($result,$number_of_columns) = &page_cleanup($result); @@ -1394,8 +1406,6 @@ ENDPART # } # $result.=' \end{document}' } - - } 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')) { @@ -1419,7 +1429,8 @@ ENDPART &Apache::lonnet::appenv(%moreenv); #&Apache::lonnet::logthis("Trying to get $urlp with symb $master_seq[$i]"); my $texversion=&Apache::lonnet::ssi($urlp,('symb'=>$master_seq[$i])); - &Apache::lonnet::delenv('form.grade_target','form.textwidth'); + &Apache::lonnet::delenv('form.grade_target'); + &Apache::lonnet::delenv('form.textwidth'); if ($urlp=~/\.page$/) { ($texversion,my $number_of_columns_page) = &page_cleanup($texversion); if ($number_of_columns_page > $number_of_columns) {$number_of_columns=$number_of_columns_page;} @@ -1506,7 +1517,8 @@ ENDPART $urlp =~ s|^/home/httpd/html||; } my $texversion=&Apache::lonnet::ssi($urlp); - &Apache::lonnet::delenv('form.grade_target','form.textwidth'); + &Apache::lonnet::delenv('form.grade_target'); + &Apache::lonnet::delenv('form.textwidth'); #this chunck is responsible for printing the path to problem my $newurlp = ''; my $HowMany = length($urlp)*2; @@ -1584,10 +1596,11 @@ sub handler { $helper = $result; -# my $key; -# foreach $key (keys %{$helper->{'VARS'}}) { -# $r->print(' '.$key.'->'.$helper->{'VARS'}->{$key}.'<-