--- loncom/interface/lonprintout.pm 2022/02/10 07:42:45 1.627.2.32 +++ loncom/interface/lonprintout.pm 2024/07/03 12:59:50 1.627.2.36 @@ -1,7 +1,7 @@ # The LearningOnline Network # Printout # -# $Id: lonprintout.pm,v 1.627.2.32 2022/02/10 07:42:45 raeburn Exp $ +# $Id: lonprintout.pm,v 1.627.2.36 2024/07/03 12:59:50 raeburn Exp $ # # Copyright Michigan State University Board of Trustees # @@ -1344,8 +1344,8 @@ sub latex_header_footer_remove { # necessity is determined by the problem_split param. # sub encapsulate_minipage { - my ($text) = @_; - if (!($env{'form.problem.split'} =~ /yes/i)) { + my ($text,$problem_split) = @_; + if (!($problem_split =~ /yes/i)) { $text = '\begin{minipage}{\textwidth}'.$text.'\end{minipage}'; } return $text; @@ -2553,7 +2553,7 @@ sub print_construction_sequence { my $body ='\vskip 0 mm \noindent\textbf{'.$title.'}\vskip 0 mm '; $body.=&path_to_problem($urlp,$LaTeXwidth); $body.='\vskip 1 mm '.$answer.'\end{document}'; - $body = &encapsulate_minipage($body); + $body = &encapsulate_minipage($body,$answerform{'problem_split'}); $texversion.=$body; } } @@ -3017,7 +3017,7 @@ ENDPART my $body ='\vskip 0 mm \noindent\textbf{'.$title.'}\vskip 0 mm '; $body .= &path_to_problem ($urlp,$LaTeXwidth); $body .='\vskip 1 mm '.$answer; - $body = &encapsulate_minipage($body); + $body = &encapsulate_minipage($body,$answerform{'problem_split'}); $texversion .= $body; } else { $texversion=''; @@ -3170,8 +3170,12 @@ ENDPART my $map; if ($helper->{VARS}->{'symb'}) { - ($map, my $id, my $resource) = - &Apache::lonnet::decode_symb($helper->{VARS}->{'symb'}); + unless ((($print_type eq 'all_problems_students') || + ($print_type eq 'incomplete_problems_selpeople_course')) && + $perm{'pfo'}) { + ($map, my $id, my $resource) = + &Apache::lonnet::decode_symb($helper->{VARS}->{'symb'}); + } } #loop over students @@ -3243,7 +3247,7 @@ ENDPART my @lines = &Apache::lonnet::get_scantronformat_file(); my ($code_type,$code_length,$bubbles_per_row)=('letter',6,10); foreach my $line (@lines) { - chomp($line); + next if (($line =~ /^\#/) || ($line eq '')); my ($name,$type,$length,$bubbles_per_item) = (split(/:/,$line))[0,2,4,17]; if ($name eq $code_option) { @@ -3732,7 +3736,7 @@ sub print_resources { my $body ='\vskip 0 mm \noindent\textbf{'.$title.'}\vskip 0 mm '; $body .=&path_to_problem($res_url,$LaTeXwidth); $body .='\vskip 1 mm '.$ansrendered; - $body = &encapsulate_minipage($body); + $body = &encapsulate_minipage($body,$answerenv{'problem_split'}); $rendered = $header.$body; } } @@ -3765,7 +3769,7 @@ sub print_resources { $rendered =~ s/\\end\{document}//; } $current_output .= $rendered.'\vskip 0.5mm\noindent\makebox[\textwidth/$number_of_columns][b]{\hrulefill}\strut \vskip 0 mm \strut '; - } elsif($res_url = ~/\.pdf$/) { + } elsif($res_url =~ /\.pdf$/) { my $url = &Apache::lonnet::clutter($res_url); my $rendered = &include_pdf($url); if ($remove_latex_header ne 'NO') { @@ -3822,7 +3826,7 @@ sub print_resources { $message = &mt('No incomplete resources'); } if ($message) { - $current_output = &encapsulate_minipage("\\vskip -10mm \n$message\n \\vskip 100 mm { }\n"); + $current_output = &encapsulate_minipage("\\vskip -10mm \n$message\n \\vskip 100 mm { }\n",$moreenv->{'problem_split'}); } if ($remove_latex_header eq "NO") { $current_output = &print_latex_header() . $current_output; @@ -4261,7 +4265,7 @@ sub printHelper { $helperFragment .= &generate_resource_chooser('CHOOSE_RESOURCES_PAGE', 'Select Resource(s) to print', - 'multichoice="1" toponly="1" addstatus="1" closeallpages="1" modallink="1"', + 'multichoice="1" toponly="1" addstatus="1" closeallpages="1" modallink="1" suppressNavmap="1"', 'RESOURCES', 'PAGESIZE', $url, @@ -4335,7 +4339,7 @@ sub printHelper { $start_new_option); $helperFragment .= &generate_resource_chooser('CHOOSE_PROBLEMS_HTML', 'Select Resource(s) to print', - 'multichoice="1" toponly="1" addstatus="1" closeallpages="1" modallink="1"', + 'multichoice="1" toponly="1" addstatus="1" closeallpages="1" modallink="1" suppressNavmap="1"', 'RESOURCES', 'PAGESIZE', $map, @@ -4392,7 +4396,7 @@ ALL_PROBLEMS $start_new_option) . &generate_resource_chooser('ALL_RESOURCES', 'Select Resource(s) to print', - " toponly='0' multichoice='1' suppressEmptySequences='0' addstatus='1' closeallpages='1' modallink='1'", + 'toponly="0" multichoice="1" suppressEmptySequences="0" addstatus="1" closeallpages="1" modallink="1" suppressNavmap="1"', 'RESOURCES', 'PAGESIZE', '', @@ -4444,7 +4448,7 @@ ALL_PROBLEMS # my $resource_selector= &generate_resource_chooser('SELECT_PROBLEMS', 'Select resources to print', - 'multichoice="1" addstatus="1" closeallpages="1" modallink="1"', + 'multichoice="1" addstatus="1" closeallpages="1" modallink="1" suppressNavmap="1"', 'RESOURCES', 'PRINT_FORMATTING', $map, @@ -4525,6 +4529,7 @@ ALL_PROBLEMS my @lines = &Apache::lonnet::get_scantronformat_file(); my $codechoice=''; foreach my $line (@lines) { + next if (($line =~ /^\#/) || ($line eq '')); my ($name,$description,$code_type,$code_length)= (split(/:/,$line))[0,1,2,4]; if ($code_length > 0 && @@ -4722,7 +4727,7 @@ CHOOSE_FROM_SUBDIR (mark desired resources then click "next" button)
+ closeallpages="1" modallink="1" suppressNavmap="1"> PAGESIZE return $isNotMap return '$escapedSequenceName';