--- loncom/interface/lonprintout.pm 2003/10/03 13:21:01 1.250 +++ loncom/interface/lonprintout.pm 2003/10/03 13:38:21 1.251 @@ -1,7 +1,7 @@ # The LearningOnline Network # Printout # -# $Id: lonprintout.pm,v 1.250 2003/10/03 13:21:01 sakharuk Exp $ +# $Id: lonprintout.pm,v 1.251 2003/10/03 13:38:21 sakharuk Exp $ # # Copyright Michigan State University Board of Trustees # @@ -1005,14 +1005,29 @@ ENDPART $urlp =~ s|^/home/httpd/html||; } my $texversion=&Apache::lonnet::ssi($urlp,%form); - if($helper->{'VARS'}->{'ANSWER_TYPE'} eq 'no') { + if(($helper->{'VARS'}->{'ANSWER_TYPE'} eq 'no') || + ($helper->{'VARS'}->{'ANSWER_TYPE'} eq 'only')) { my %form; $form{'grade_target'}='answer'; $form{'answer_output_mode'}='tex'; $form{'latex_type'}=$helper->{'VARS'}->{'LATEX_TYPE'}; $form{'rndseed'}=$rndseed; my $answer=&Apache::lonnet::ssi($urlp,%form); - $texversion=~s/(\\keephidden{ENDOFPROBLEM})/$answer$1/; + if ($helper->{'VARS'}->{'ANSWER_TYPE'} eq 'no') { + $texversion=~s/(\\keephidden{ENDOFPROBLEM})/$answer$1/; + } else { + $texversion=&print_latex_header($helper->{'VARS'}->{'LATEX_TYPE'}); + if ($helper->{'VARS'}->{'construction'} ne '1') { + $texversion.='\vskip 0 mm \noindent '; + $texversion.=&path_to_problem ($urlp,$LaTeXwidth); + } else { + $texversion.='\vskip 0 mm \noindent\textbf{Prints from construction space - there is no title.}\vskip 0 mm '; + my $URLpath=$urlp; + $URLpath=~s/~([^\/]+)/public_html\/$1\/$1/; + $texversion.=&path_to_problem ($URLpath,$LaTeXwidth); + } + $texversion.='\vskip 1 mm '.$answer.'\end{document}'; + } } #this chunck is responsible for printing the path to problem my $newurlp=&path_to_problem($urlp,$LaTeXwidth);