--- loncom/interface/lonprintout.pm 2005/02/02 11:13:34 1.355 +++ loncom/interface/lonprintout.pm 2005/02/07 12:00:13 1.356 @@ -1,7 +1,7 @@ # The LearningOnline Network # Printout # -# $Id: lonprintout.pm,v 1.355 2005/02/02 11:13:34 foxr Exp $ +# $Id: lonprintout.pm,v 1.356 2005/02/07 12:00:13 foxr Exp $ # # Copyright Michigan State University Board of Trustees # @@ -825,8 +825,13 @@ Please stand by while processing your pr ENDPART # Common settings for the %form has: - + # In some cases these settings get overriddent by specific cases, but the + # settings are common enough to make it worthwhile factoring them out + # here. + # my %form; + my $form{'grade_target'} = 'tex'; + my $form{'textwidth'} = &tget_textwidth($helper, $LaTeXwidth); my $format_from_helper = $helper->{'VARS'}->{'FORMAT'}; my ($result,$selectionmade) = ('',''); @@ -871,8 +876,6 @@ ENDPART my $put_result = &Apache::lonnet::put('environment',{'construct.style'=>$helper->{'VARS'}->{'style_file'}},$dom,$user); } if ($helper->{'VARS'}->{'probstatus'} eq 'exam') {$form{'problemtype'}='exam';} - $form{'grade_target'}='tex'; - $form{'textwidth'}=&get_textwidth($helper,$LaTeXwidth); $form{'problem_split'}=$parmhash{'problem_stream_switch'}; $form{'suppress_tries'}=$parmhash{'suppress_tries'}; $form{'latex_type'}=$helper->{'VARS'}->{'LATEX_TYPE'}; @@ -938,8 +941,6 @@ ENDPART if ($urlp=~/\.(problem|exam|quiz|assess|survey|form|library|xml|html|htm|xhtml|xhtm)$/) { my $texversion=''; if ($helper->{'VARS'}->{'ANSWER_TYPE'} ne 'only') { - $form{'grade_target'}='tex'; - $form{'textwidth'}=&get_textwidth($helper,$LaTeXwidth); $form{'problem_split'}=$parmhash{'problem_stream_switch'}; $form{'suppress_tries'}=$parmhash{'suppress_tries'}; $form{'latex_type'}=$helper->{'VARS'}->{'LATEX_TYPE'}; @@ -984,8 +985,6 @@ ENDPART if ($helper->{VARS}->{'construction'} eq '1') {$result=~s/(\\begin{document})/$1 \\fbox\{RANDOM SEED IS $rndseed\} /;} $result .= '\end{document}'; } elsif ($cleanURL=~/\/(smppg|syllabus|aboutme|bulletinboard)$/) { - $form{'grade_target'}='tex'; - $form{'textwidth'}=&get_textwidth($helper,$LaTeXwidth); $form{'latex_type'}=$helper->{'VARS'}->{'LATEX_TYPE'}; if ($currentURL=~/\/syllabus$/) {$currentURL=~s/\/res//;} my $texversion=&Apache::lonnet::ssi($currentURL,%form); @@ -1010,8 +1009,6 @@ ENDPART } elsif ($helper->{'VARS'}->{'PRINT_TYPE'} eq 'select_sequences') { $selectionmade = 7; } - $form{'grade_target'}='tex'; - $form{'textwidth'}=&get_textwidth($helper,$LaTeXwidth); $form{'problem_split'}=$parmhash{'problem_stream_switch'}; $form{'suppress_tries'}=$parmhash{'suppress_tries'}; $form{'latex_type'}=$helper->{'VARS'}->{'LATEX_TYPE'}; @@ -1096,8 +1093,6 @@ ENDPART $result .= $texversion; $flag_latex_header_remove = 'YES'; } elsif ($urlp=~/\/(smppg|syllabus|aboutme|bulletinboard)$/) { - $form{'grade_target'}='tex'; - $form{'textwidth'}=&get_textwidth($helper,$LaTeXwidth); $form{'latex_type'}=$helper->{'VARS'}->{'LATEX_TYPE'}; if ($urlp=~/\/syllabus$/) {$urlp=~s/\/res//;} my $texversion=&Apache::lonnet::ssi($urlp,%form); @@ -1253,8 +1248,6 @@ ENDPART $urlp=~s|//|/|; if ($urlp=~/\//) { $form{'problem_split'}=$parmhash{'problem_stream_switch'}; - $form{'grade_target'}='tex'; - $form{'textwidth'}=&get_textwidth($helper,$LaTeXwidth); $form{'rndseed'}=$rndseed; if ($urlp =~ m|/home/([^/]+)/public_html|) { $urlp =~ s|/home/([^/]*)/public_html|/~$1|;