--- loncom/interface/lonprintout.pm 2006/01/27 00:06:52 1.417 +++ loncom/interface/lonprintout.pm 2006/02/14 20:34:34 1.422 @@ -1,7 +1,7 @@ # The LearningOnline Network # Printout # -# $Id: lonprintout.pm,v 1.417 2006/01/27 00:06:52 foxr Exp $ +# $Id: lonprintout.pm,v 1.422 2006/02/14 20:34:34 albertel Exp $ # # Copyright Michigan State University Board of Trustees # @@ -687,7 +687,6 @@ sub page_format_transformation { my $topmargintoinsert = ''; if ($topmargin ne '0') {$topmargintoinsert='\setlength{\topmargin}{'.$topmargin.'}';} my $fancypagestatement=''; - &Apache::lonnet::logthis("1: columns = $numberofcolumns"); if ($numberofcolumns eq '2') { $fancypagestatement="\\fancyhead{}\\fancyhead[LO]{\\textbf{$name} $courseidinfo \\hfill \\thepage \\\\ \\textit{$assignment}}"; } else { @@ -752,7 +751,6 @@ sub details_for_menu { sub latex_corrections { my ($number_of_columns,$result,$selectionmade,$answer_mode) = @_; - # $result =~ s/\\includegraphics{/\\includegraphics\[width=\\minipagewidth\]{/g; $result =~ s/\$number_of_columns/$number_of_columns/g; if ($selectionmade eq '1' || $answer_mode eq 'only') { @@ -782,7 +780,6 @@ sub latex_corrections { } $result =~ s/(\\end{tabular})\s*\\vskip 0 mm/$1/g; $result =~ s/(\\begin{enumerate})\s*\\noindent/$1/g; - return $result; } @@ -907,10 +904,7 @@ sub unsupported { } else { $result.=$currentURL; } - # TODO: /2 used to be /$number_of_columns which we don'thave - # access to and therefore now causes latex to fail. - # need to figure out exactly what we should divide by. - $result.= '\vskip 0.5mm\noindent\makebox[\textwidth/2][b]{\hrulefill} \end{document}'; + $result.= '\vskip 0.5mm\noindent\makebox[\textwidth/$number_of_columns][b]{\hrulefill} \end{document}'; return $result; } @@ -967,12 +961,12 @@ sub recently_generated { # A reference to a page break hash. # # -use Data::Dumper; -sub dump_helper_vars { - my ($helper) = @_; - my $helpervars = Dumper($helper->{'VARS'}); - &Apache::lonnet::logthis("Dump of helper vars:\n $helpervars"); -} +#use Data::Dumper; +#sub dump_helper_vars { +# my ($helper) = @_; +# my $helpervars = Dumper($helper->{'VARS'}); +# &Apache::lonnet::logthis("Dump of helper vars:\n $helpervars"); +#} sub get_page_breaks { my ($helper) = @_; @@ -1040,7 +1034,6 @@ ENDPART my %page_breaks = &get_page_breaks($helper); my $format_from_helper = $helper->{'VARS'}->{'FORMAT'}; - &dump_helper_vars($helper); my ($result,$selectionmade) = ('',''); my $number_of_columns = 1; #used only for pages to determine the width of the cell my @temporary_array=split /\|/,$format_from_helper; @@ -1333,7 +1326,6 @@ ENDPART my $courseidinfo = &get_course(); if (defined($courseidinfo)) { $courseidinfo=' - '.$courseidinfo } $prevassignment=$assignment; - &Apache::lonnet::logthis("2: Number of columns: $numberofcolumns"); if ($numberofcolumns eq '1') { $result .='\newpage \noindent\parbox{\minipagewidth}{\noindent\\lhead{\\textit{\\textbf{'.$name.'}}'.$courseidinfo.' \\hfill \\thepage \\\\ \\textit{'.$assignment.'}}} \vskip 5 mm '; } else { @@ -1426,8 +1418,7 @@ ENDPART $person,$type, \%moreenv,\@master_seq, $flag_latex_header_remove, - $LaTeXwidth, - $number_of_columns); + $LaTeXwidth); $resources_printed .= ":"; $print_array[$i].=$output; $student_names[$i].=$person.':'.$fullname.'_END_'; @@ -1459,6 +1450,7 @@ ENDPART } my %moreenv = ('textwidth' => &get_textwidth($helper,$LaTeXwidth)); $moreenv{'problem_split'} = $parmhash{'problem_stream_switch'}; + $moreenv{'instructor_comments'}='hide'; my $seed=time+($$<<16)+($$); my @allcodes; if ($old_name) { @@ -1732,7 +1724,7 @@ sub get_CODE { sub print_resources { my ($r,$helper,$person,$type,$moreenv,$master_seq,$remove_latex_header, - $LaTeXwidth,$number_of_columns)=@_; + $LaTeXwidth)=@_; my $current_output = ''; my $printed = ''; my ($username,$userdomain,$usersection) = split /:/,$person; @@ -1810,7 +1802,8 @@ sub print_resources { } else { $rendered =~ s/\\end{document}//; } - $current_output .= $rendered.'\vskip 0.5mm\noindent\makebox[\textwidth/'.$number_of_columns.'][b]{\hrulefill}\strut \vskip 0 mm \strut '; + $current_output .= $rendered.'\vskip 0.5mm\noindent\makebox[\textwidth/$number_of_columns][b]{\hrulefill}\strut \vskip 0 mm \strut '; + } else { my $rendered = &unsupported($res_url,$helper->{'VARS'}->{'LATEX_TYPE'},$curresline); if ($remove_latex_header ne 'NO') { @@ -1830,7 +1823,6 @@ sub print_resources { if ($usersection ne '') {$courseidinfo.=' - Sec. '.$usersection} my $currentassignment=&Apache::lonxml::latex_special_symbols($helper->{VARS}->{'assignment'},'header'); if ($current_output=~/\\documentclass/) { - &Apache::lonnet::logthis("3: Number of columns = $columns_in_format"); if ($columns_in_format == 1) { $current_output =~ s/\\begin{document}/\\setlength{\\topmargin}{1cm} \\begin{document}\\noindent\\parbox{\\minipagewidth}{\\noindent\\lhead{\\textit{\\textbf{$fullname}}$courseidinfo \\hfill \\thepage \\\\ \\textit{$currentassignment}$namepostfix}}\\vskip 5 mm /; } else { @@ -1840,7 +1832,6 @@ sub print_resources { } else { my $blankpages = ''; for (my $j=0;$j<$helper->{'VARS'}->{'EMPTY_PAGES'};$j++) {$blankpages.='\clearpage\strut\clearpage';} - &Apache::lonnet::logthis("4: Number of columns = $columns_in_format"); if ($columns_in_format == 1) { $current_output = '\strut\vspace*{-6 mm}\\newline\\noindent\\makebox[\\textwidth/$number_of_columns][b]{\\hrulefill}\vspace*{-2 mm}\\newline\\noindent{\\tiny Printed from LON-CAPA\\copyright MSU{\\hfill} Licensed under GNU General Public License }\\newpage '.$blankpages.'\setcounter{page}{1}\noindent\parbox{\minipagewidth}{\noindent\\lhead{\\textit{\\textbf{'.$fullname.'}}'.$courseidinfo.' \\hfill \\thepage \\\\ \\textit{'.$currentassignment.'}'.$namepostfix.'}} \vskip 5 mm '.$current_output; } else {