--- loncom/interface/lonprintout.pm 2003/05/08 19:16:42 1.160 +++ loncom/interface/lonprintout.pm 2003/05/13 15:28:32 1.164 @@ -1,7 +1,7 @@ # The LearningOnline Network # Printout # -# $Id: lonprintout.pm,v 1.160 2003/05/08 19:16:42 sakharuk Exp $ +# $Id: lonprintout.pm,v 1.164 2003/05/13 15:28:32 sakharuk Exp $ # # Copyright Michigan State University Board of Trustees # @@ -1381,6 +1381,18 @@ ENDPART &Apache::lonnet::appenv(%moreenv); my $texversion=&Apache::lonnet::ssi($currentURL); &Apache::lonnet::delenv('form.grade_target','form.textwidth','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','form.print_answer'); + my $start=index($answer,'\vskip 0 mm',0); + my $finish=rindex $answer,'\vskip 0 mm' ; + if ($start!=-1 && $finish!=-1) {$answer=substr($answer,$start,$finish-$start+12);} +# $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); @@ -1582,10 +1594,11 @@ sub handler { $helper = $result; -# my $key; -# foreach $key (keys %{$helper->{'VARS'}}) { -# $r->print(' '.$key.'->'.$helper->{'VARS'}->{$key}.'<-