--- loncom/interface/lonprintout.pm 2025/01/16 06:01:09 1.627.2.32.2.8 +++ loncom/interface/lonprintout.pm 2024/11/09 15:40:00 1.700 @@ -1,7 +1,7 @@ # The LearningOnline Network # Printout # -# $Id: lonprintout.pm,v 1.627.2.32.2.8 2025/01/16 06:01:09 raeburn Exp $ +# $Id: lonprintout.pm,v 1.700 2024/11/09 15:40:00 raeburn Exp $ # # Copyright Michigan State University Board of Trustees # @@ -812,17 +812,16 @@ sub map_print_dates { # Parameters: # $username - Name of user for whom we are checking. # $domain - Domain of user we are checking. -# $section - Section for user for whom we are checking. # $map - map name. # Returns: # 0 - map is not incomplete. # 1 - map is incomplete. # sub incomplete { - my ($username, $domain, $section, $map) = @_; + my ($username, $domain, $map) = @_; - my $navmap = Apache::lonnavmaps::navmap->new($username, $domain, $section); + my $navmap = Apache::lonnavmaps::navmap->new($username, $domain); if (defined($navmap)) { @@ -879,7 +878,7 @@ sub master_seq_to_person_seq { } my $navmap = Apache::lonnavmaps::navmap->new($username, $userdomain, - $usersection, $code, $unhidden); + $code, $unhidden); my ($start,$finish); if ($map) { @@ -906,7 +905,6 @@ sub master_seq_to_person_seq { # Only process resources..that are not removed by randomout... # and are selected for printint as well. # - if (ref($curres) && ! $curres->randomout()) { my $currsymb = $curres->symb(); if (exists($seq_hash{$currsymb})) { @@ -981,7 +979,8 @@ sub set_font_size { if ($font_size ne '') { $text =~ s/\\begin\{document}/\\begin{document}{\\$font_size/; - $text =~ s/\\end\{document}/}\\end{document}/; + $text =~ s/\\end\{document}/}\\end{document}/; + } return $text; @@ -1198,7 +1197,7 @@ sub format_page_header { $width = &recalcto_mm($width); # Get width in mm. - my $chars_per_line = int($width/2); # Character/textline. + my $chars_per_line = int($width/1.6); # Character/textline. # Default format? @@ -1214,35 +1213,35 @@ sub format_page_header { # - Allow the assignment to be 2 lines (wrapped). # - my $firstline = "$student $course"; - if (length($firstline) > $chars_per_line) { - my $lastchar = $chars_per_line - length($student) - 1; - if ($lastchar > 0) { - $course = substr($course, 0, $lastchar); - } else { # Nothing left of course: - $course = ''; - } - } - if (length($assignment) > $chars_per_line) { - $assignment = substr($assignment, 0, $chars_per_line); - } + - $format = "\\textbf{$student} $course \\hfill \\thepage \\\\ \\textit{$assignment}"; + my $name_length = int($chars_per_line *3 /4); + my $sec_length = int($chars_per_line / 5); + + $format = "%$name_length".'n'; + + if ($section) { + $format .= ' - Sec: '."%$sec_length".'s'; + } + $format .= '\\hfill\\thepage'; + + $format .= '\\\\%c \\\\ %a'; - } else { - # An open question is how to handle long user formatted page headers... - # A possible future is to support e.g. %na so that the user can control - # the truncation of the elements that can appear in the header. - # - $format = &printf_style_subst("a", $format, $assignment); - $format = &printf_style_subst("c", $format, $course); - $format = &printf_style_subst("n", $format, $student); - - # If the user put %'s in the format string, they must be escaped - # to \% else LaTeX will think they are comments and terminate - # the line.. which is bad!!! } + # An open question is how to handle long user formatted page headers... + # A possible future is to support e.g. %na so that the user can control + # the truncation of the elements that can appear in the header. + # + $format = &printf_style_subst("a", $format, $assignment); + $format = &printf_style_subst("c", $format, $course); + $format = &printf_style_subst("n", $format, $student); + $format = &printf_style_subst("s", $format, $section); + + + # If the user put %'s in the format string, they must be escaped + # to \% else LaTeX will think they are comments and terminate + # the line.. which is bad!!! # If the user has role author, $course and $assignment are empty so # there is '\\ \\ ' in the page header. That's cause a error in LaTeX @@ -1251,9 +1250,6 @@ sub format_page_header { my $testPrintout = '\\\\'.&mt('Authoring Space').' \\\\'.&mt('Test-Printout '); $format =~ s/\\\\\s\\\\\s/$testPrintout/; } - - return $format; - # # We're going to trust LaTeX to break lines appropriately, but # we'll truncate anything that's more than 3 lines worth of @@ -1865,12 +1861,12 @@ sub old_character_chart { my %page_formats= ('letter' => { 'book' => { - '1' => [ '7.1 in','9.7 in', '-0.57 in','-0.57 in','-0.5 in'], - '2' => ['3.66 in','9.8 in', '-0.57 in','-0.57 in','-0.5 in'] + '1' => [ '7.1 in','9.8 in', '-0.57 in','-0.57 in','0.275 in'], + '2' => ['3.66 in','9.8 in', '-0.57 in','-0.57 in','0.275 in'] }, 'album' => { - '1' => [ '8.8 in', '6.8 in','-0.55 in', '-0.55 in','-0.5 in'], - '2' => [ '4.8 in', '6.7 in','-0.5 in', '-1.0 in','3.0 in'] + '1' => [ '8.8 in', '6.8 in','-0.55 in', '-0.55 in','0.394 in'], + '2' => [ '4.8 in', '6.8 in','-0.5 in', '-1.0 in','3.0 in'] }, }, 'legal' => { @@ -1880,7 +1876,7 @@ my %page_formats= }, 'album' => { '1' => ['12 in','7.1 in',,'-0.57 in','-0.57 in','-0.5 in'], - '2' => ['5.7 in','7.1 in','-1 in','-1 in','5 in'] + '2' => ['6.0 in','7.1 in','-1 in','-1 in','5 in'] }, }, 'tabloid' => { @@ -1929,8 +1925,8 @@ my %page_formats= '2' => [ '9.1 cm','27.2 cm','-1.397 cm','-2.11 cm','-1.27 cm'] }, 'album' => { - '1' => ['24.0 cm','18.0 cm','-1.0 cm','-1.0 cm','-1.25 cm'], - '2' => ['11.5 cm','18.0 cm','-0.7 cm','-1.7 cm','-1.25 cm'] + '1' => ['21.59 cm','19.558 cm','-1.397cm','-2.11 cm','0 cm'], + '2' => ['9.91 cm','19.558 cm','-1.397 cm','-2.11 cm','-1 cm'] }, }, 'a5' => { @@ -1982,13 +1978,14 @@ sub get_course { my $courseidinfo; if (defined($env{'request.course.id'})) { $courseidinfo = &Apache::lonxml::latex_special_symbols(&unescape($env{'course.'.$env{'request.course.id'}.'.description'}),'header'); + my $sec = $env{'request.course.sec'}; + } return $courseidinfo; } sub page_format_transformation { - my ($papersize,$layout,$numberofcolumns,$choice,$text,$assignment,$tableofcontents, - $indexlist,$selectionmade,$mostrecent) = @_; + my ($papersize,$layout,$numberofcolumns,$choice,$text,$assignment,$tableofcontents,$indexlist,$selectionmade) = @_; my ($textwidth,$textheight,$oddoffset,$evenoffset,$topmargin); if ($selectionmade eq '4') { @@ -2003,14 +2000,8 @@ sub page_format_transformation { ($textwidth,$textheight,$oddoffset,$evenoffset,$topmargin) = &page_format($papersize,$layout,$numberofcolumns,$topmargin); - my $name; - if ($mostrecent ne '') { - $name = $mostrecent; - } else { - $name = &get_name(); - } + my $name = &get_name(); my $courseidinfo = &get_course(); - if (defined($courseidinfo)) { $courseidinfo=' - '.$courseidinfo } my $header_text = $parmhash{'print_header_format'}; $header_text = &format_page_header($textwidth, $header_text, $assignment, $courseidinfo, $name); @@ -2019,9 +2010,9 @@ sub page_format_transformation { my $fancypagestatement=''; if ($numberofcolumns eq '2') { $fancypagestatement="\\fancyhead{}\\fancyhead[LO]{$header_text}"; - if ($parmhash{'print_header_format'} eq '') { - $fancypagestatement .= "\\fancyhead[RE]{\\thepage \\\\}"; - } + if ($parmhash{'print_header_format'} eq '') { + $fancypagestatement .= "\\fancyhead[RE]{\\thepage \\\\[\\baselineskip]}"; + } } else { $fancypagestatement="\\rhead{}\\chead{}\\lhead{$header_text}"; } @@ -2031,13 +2022,13 @@ sub page_format_transformation { $text =~ s/\\begin\{document}/\\setlength{\\oddsidemargin}{$oddoffset}\\setlength{\\evensidemargin}{$evenoffset}$topmargintoinsert\n\\setlength{\\textwidth}{$textwidth}\\setlength{\\textheight}{$textheight}\\setlength{\\textfloatsep}{8pt plus 2\.0pt minus 4\.0pt}\n\\newlength{\\minipagewidth}\\setlength{\\minipagewidth}{\\textwidth\/\$number_of_columns-0\.2cm}\\usepackage{fancyhdr}\\addtolength{\\headheight}{\\baselineskip}\n\\pagestyle{fancy}$fancypagestatement\\usepackage{booktabs}\\begin{document}\\voffset=-0\.8 cm\\setcounter{page}{1}\n /; if ($papersize eq 'a4') { $paperwidth = '29.7cm'; - $paperheight = '21.0cm'; + $paperheight = '21cm'; } elsif ($numberofcolumns eq '1') { if ($papersize eq 'letter') { - $paperwidth = '11.0in'; + $paperwidth = '11in'; $paperheight = '8.5in'; } elsif ($papersize eq 'legal') { - $paperwidth = '14.0in'; + $paperwidth = '14in'; $paperheight = '8.5in'; } } @@ -2048,11 +2039,11 @@ sub page_format_transformation { $text =~ s/\\pagestyle\{fancy}\\rhead\{}\\chead\{}\s*\\begin\{document}/\\textheight = $textheight\\oddsidemargin = $evenoffset\n\\evensidemargin = $evenoffset $topmargintoinsert\\textwidth= $textwidth\\newlength{\\minipagewidth}\n\\setlength{\\minipagewidth}{\\textwidth\/\$number_of_columns-0\.2cm}\\renewcommand{\\ref}{\\keephidden\}\\pagestyle{fancy}\\rhead{}\\chead{}\\usepackage{booktabs}\\begin{document}\\voffset=-0\.8cm\n\\setcounter{page}{1} \\vskip 5 mm\n /; } if ($papersize eq 'a4') { - $paperwidth = '21.0cm'; + $paperwidth = '21cm'; $paperheight = '29.7cm'; } elsif ($papersize eq 'letter') { $paperwidth = '8.5in'; - $paperheight = '11.0in'; + $paperheight = '11.5in'; } elsif ($papersize eq 'legal') { $paperwidth = '8.5in'; $paperheight = '14.0in'; @@ -2348,7 +2339,7 @@ sub print_page_in_course { $form{'grade_target'} = 'tex'; $form{'textwidth'} = &get_textwidth($helper, $LaTeXwidth); - $form{'pdfFormFields'} = 'no'; # + $form{'pdfFormFields'} = $pdfFormFields; # $form{'showallfoils'} = $helper->{'VARS'}->{'showallfoils'}; $form{'problem_split'}=$parmhash{'problem_stream_switch'}; @@ -2405,8 +2396,8 @@ sub print_page_in_course { $texversion.=&path_to_problem($urlp,$LaTeXwidth); } $texversion.='\vskip 1 mm '.$answer.'\end{document}'; - } - } + } + } # Print annotations. @@ -2777,7 +2768,6 @@ sub print_construction_sequence { # 6 Print selected problems from a folder. # 7 Print print selected resources from some scope. # 8 Print resources for selected students. -# 9 Print for anonymous CODEs # #BZ 5209 # 2 map_incomplete_problems_seq Print incomplete problems from the current @@ -2870,7 +2860,7 @@ ENDPART my $LaTeXwidth=&recalcto_mm($textwidth); my @print_array=(); my @student_names=(); - my $lastprinted; + # Common settings for the %form hash: # In some cases these settings get overridden by specific cases, but the @@ -2880,7 +2870,7 @@ ENDPART my %form; $form{'grade_target'} = 'tex'; $form{'textwidth'} = &get_textwidth($helper, $LaTeXwidth); - $form{'pdfFormFields'} = 'no'; + $form{'pdfFormFields'} = $pdfFormFields; # If form.showallfoils is set, then request all foils be shown: # privilege will be enforced both by not allowing the @@ -2986,7 +2976,7 @@ ENDPART } - + } @@ -3204,7 +3194,6 @@ ENDPART if (($selectionmade == 4) and ($assignment ne $prevassignment)) { my $name = &get_name(); my $courseidinfo = &get_course(); - if (defined($courseidinfo)) { $courseidinfo=' - '.$courseidinfo } $prevassignment=$assignment; my $header_text = $parmhash{'print_header_format'}; $header_text = &format_page_header($textwidth, $header_text, @@ -3399,9 +3388,6 @@ ENDPART # &Apache::lonhtmlcommon::Increment_PrgWin($r,\%prog_state,&mt('last student').' '.$fullname); &Apache::lonhtmlcommon::Increment_PrgWin($r,\%prog_state,'last student'); $flag_latex_header_remove = 'YES'; - if ($printed) { - $lastprinted = $fullname; - } if (&Apache::loncommon::connection_aborted($r)) { last; } } &Apache::lonhtmlcommon::Close_PrgWin($r,\%prog_state); @@ -3411,7 +3397,6 @@ ENDPART ($print_type eq 'resources_for_anon') || ($print_type eq 'select_sequences_problems_for_anon') || ($print_type eq 'select_sequences_resources_for_anon')) { - $selectionmade = 9; my $cdom =$env{'course.'.$env{'request.course.id'}.'.domain'}; my $cnum =$env{'course.'.$env{'request.course.id'}.'.num'}; my $num_todo=$helper->{'VARS'}->{'NUMBER_TO_PRINT_TOTAL'}; @@ -3525,9 +3510,6 @@ ENDPART &mt('last assignment').' '.$fullname); $flag_latex_header_remove = 'YES'; $count++; - if ($printed) { - $lastprinted = $fullname; - } if (&Apache::loncommon::connection_aborted($r)) { last; } } &Apache::lonhtmlcommon::Close_PrgWin($r,\%prog_state); @@ -3607,18 +3589,13 @@ ENDPART # Only post process if that has not been turned off e.g. by a raw latex resource. if ($do_postprocessing) { - my $mostrecent; - if ((($selectionmade == 5) || ($selectionmade == 8) || ($selectionmade == 9)) && - (($numberofcolumns == 1) || ($laystyle eq 'album' && $papersize eq 'a4'))) { - $mostrecent = $lastprinted; - } $result = &page_format_transformation($papersize, $laystyle,$numberofcolumns, $print_type,$result, $helper->{VARS}->{'assignment'}, $helper->{'VARS'}->{'TABLE_CONTENTS'}, $helper->{'VARS'}->{'TABLE_INDEX'}, - $selectionmade,$mostrecent); + $selectionmade); $result = &latex_corrections($number_of_columns,$result,$selectionmade, $helper->{'VARS'}->{'ANSWER_TYPE'}); #if ($numberofcolumns == 1) { @@ -3857,8 +3834,6 @@ sub print_resources { my $assignment; my $courseidinfo = &get_course(); my $possprint = scalar(@{$master_seq}); - if (defined($courseidinfo)) { $courseidinfo=' - '.$courseidinfo } - if ($usersection ne '') {$courseidinfo.=' - Sec. '.$usersection} foreach my $curresline (@{$master_seq}) { if (defined $page_breaks{$curresline}) { @@ -3874,7 +3849,7 @@ sub print_resources { if ( !($type eq 'problems' && ($curresline!~ m/$LONCAPA::assess_page_re/)) ) { - if ($print_incomplete && !&incomplete($username, $userdomain, $usersection, $res_url)) { + if ($print_incomplete && !&incomplete($username, $userdomain, $res_url)) { next; } $actually_printed++; # we're going to print one. @@ -3892,6 +3867,7 @@ sub print_resources { $rendered = &print_latex_header().$rendered; } } +; if ($remove_latex_header eq 'YES') { $rendered = &latex_header_footer_remove($rendered); } else { @@ -3906,7 +3882,7 @@ sub print_resources { $answerenv{'latex_type'}=$helper->{'VARS'}->{'LATEX_TYPE'}; - + &Apache::lonxml::restore_problem_counter(); my $ansrendered = &Apache::loncommon::get_student_answers($curresline,$username,$userdomain,$env{'request.course.id'},%answerenv); @@ -4013,7 +3989,7 @@ sub print_resources { $message = &mt('No incomplete resources'); } if ($message) { - $current_output = &encapsulate_minipage("\\vskip -10mm \n$message\n \\vskip 100 mm { }\n",$moreenv->{'problem_split'}); + $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; @@ -4027,13 +4003,13 @@ sub print_resources { } my $currentassignment=&Apache::lonxml::latex_special_symbols($helper->{VARS}->{'assignment'},'header'); my $header_line = - &format_page_header($LaTeXwidth, $parmhash{'print_header_format'}, - $currentassignment, $courseidinfo, $fullname, $usersection); + &format_page_header($LaTeXwidth, $parmhash{'print_header_format'}, + $currentassignment, $courseidinfo, $fullname, $usersection); my $header_start = ($columns_in_format == 1) ? '\lhead' : '\fancyhead[LO]'; my $newheader = $header_start.'{'.$header_line.'}'; - if ($current_output=~/\\documentclass/) { $current_output =~ s/\\begin\{document}/\\setlength{\\topmargin}{1cm} \\begin{document}\\noindent\\parbox{\\minipagewidth}{\\noindent$newheader$namepostfix}\\vskip 5 mm /; + } else { my $blankpages = '\clearpage\strut\clearpage'x$helper->{'VARS'}->{'EMPTY_PAGES'}; @@ -4042,6 +4018,7 @@ sub print_resources { ©right_line().' \newpage '.$blankpages.$end_of_student. '\setcounter{page}{1}\noindent\parbox{\minipagewidth}{\noindent'. $newheader.$namepostfix. '} \vskip 5 mm '.$current_output; + } # # Close the student bracketing. @@ -4108,7 +4085,6 @@ sub handler { unlink $conversion_queuefile; } - &output_data($r,$helper,\%parmhash); return OK; } @@ -4242,6 +4218,7 @@ sub printHelper { } } + } # Detect whether we're coming from construction space @@ -4299,7 +4276,6 @@ sub printHelper { } if ($sequenceTitle ne '') {$helper->{VARS}->{'assignment'}=$sequenceTitle;} - # Extract map my $symb = $helper->{VARS}->{'symb'}; my ($map, $id, $url); @@ -4342,7 +4318,7 @@ sub printHelper { if (ref($navmap)) { my $res; if ($symb ne '') { - $res = $navmap->getBySymb($symb); + $res = $navmap->getBySymb($symb); } elsif ($map ne '') { $res = $navmap->getResourceByUrl($map); } @@ -4410,7 +4386,7 @@ sub printHelper { # Give that as a choice. if ($resourceTitle && $res_printable) { - push(@{$printChoices}, ["$resourceTitle (".&mt('the resource you just saw on the screen').")", 'current_document', 'PAGESIZE']); + push @{$printChoices}, ["$resourceTitle (".&mt('the resource you just saw on the screen').")", 'current_document', 'PAGESIZE']; } # Useful filter strings @@ -4464,14 +4440,14 @@ sub printHelper { my $resourcesymb = $page_resources[0]->symb(); my ($pagemap, $pageid, $pageurl) = &Apache::lonnet::decode_symb($symb); if ($page_ispage) { - push(@{$printChoices}, + push @{$printChoices}, [&mt('Selected [_1]Problems[_2] from page [_3]', '', '', ''.$page_title.''), 'map_problems_in_page', - 'CHOOSE_PROBLEMS_PAGE']); - push(@{$printChoices}, + 'CHOOSE_PROBLEMS_PAGE']; + push @{$printChoices}, [&mt('Selected [_1]Resources[_2] from page [_3]', '', '', ''.$page_title.''), 'map_resources_in_page', - 'CHOOSE_RESOURCES_PAGE']); + 'CHOOSE_RESOURCES_PAGE']; } my $helperFragment = &generate_resource_chooser('CHOOSE_PROBLEMS_PAGE', 'Select Problem(s) to print', @@ -4555,19 +4531,19 @@ sub printHelper { } else { $optionText = &mt('Selected [_1]Problems[_2] from folder [_3]','','',''.$sequenceTitle.''); } - push(@{$printChoices}, + push @{$printChoices}, [$optionText, 'map_problems', - 'CHOOSE_PROBLEMS']); + 'CHOOSE_PROBLEMS']; # Allow all resources from sequence if ($helper->{VARS}->{'postdata'} eq '/adm/navmaps') { $optionText = &mt('Selected [_1]Resources[_2] [_3]not in a folder[_4]','','','',''); } else { $optionText = &mt('Selected [_1]Resources[_2] from folder [_3]','','',''.$sequenceTitle.''); } - push(@{$printChoices}, [$optionText, + push @{$printChoices}, [$optionText, 'map_problems_pages', - 'CHOOSE_PROBLEMS_HTML']); + 'CHOOSE_PROBLEMS_HTML']; my $helperFragment = &generate_resource_chooser('CHOOSE_PROBLEMS', 'Select Problem(s) to print', 'multichoice="1" toponly="1" addstatus="1" closeallpages="1" modallink="1" nocurrloc="'.$nocurrloc.'"', @@ -4611,9 +4587,9 @@ sub printHelper { # Selected problems/resources from entire course: - push(@{$printChoices}, [&mt('Selected [_1]Problems[_2] from [_3]entire course[_4]','','','',''), 'all_problems', 'ALL_PROBLEMS']); - push(@{$printChoices}, [&mt('Selected [_1]Resources[_2] from [_3]entire course[_4]','','','',''), 'all_resources', 'ALL_RESOURCES']); - push(@{$printChoices}, [&mt('Selected [_1]Problems[_2] from [_3]entire course[_4] for [_5]selected people[_6]','','','','','',''), 'all_problems_students', 'ALL_PROBLEMS_STUDENTS']); + push @{$printChoices}, [&mt('Selected [_1]Problems[_2] from [_3]entire course[_4]','','','',''), 'all_problems', 'ALL_PROBLEMS']; + push @{$printChoices}, [&mt('Selected [_1]Resources[_2] from [_3]entire course[_4]','','','',''), 'all_resources', 'ALL_RESOURCES']; + push @{$printChoices}, [&mt('Selected [_1]Problems[_2] from [_3]entire course[_4] for [_5]selected people[_6]','','','','','',''), 'all_problems_students', 'ALL_PROBLEMS_STUDENTS']; my $suffixXml = < Select sorting order of printout @@ -4660,19 +4636,19 @@ ALL_PROBLEMS # either for selected students or for coded assignments. if ($page_ispage) { - push(@{$printChoices}, [&mt('Selected [_1]Problems[_2] from page [_3] for [_4]selected people[_5]', + push @{$printChoices}, [&mt('Selected [_1]Problems[_2] from page [_3] for [_4]selected people[_5]', '', '', ''.$page_title.'', '', ''), - 'problems_for_students_from_page', 'CHOOSE_TGT_STUDENTS_PAGE']); - push(@{$printChoices}, [&mt('Selected [_1]Problems[_2] from page [_3] for [_4]CODEd assignments[_5]', + 'problems_for_students_from_page', 'CHOOSE_TGT_STUDENTS_PAGE']; + push @{$printChoices}, [&mt('Selected [_1]Problems[_2] from page [_3] for [_4]CODEd assignments[_5]', '', '', ''.$page_title.'', '', ''), - 'problems_for_anon_page', 'CHOOSE_ANON1_PAGE']); + 'problems_for_anon_page', 'CHOOSE_ANON1_PAGE']; } - push(@{$printChoices}, [&mt('Selected [_1]Problems[_2] from folder [_3] for [_4]selected people[_5]', + push @{$printChoices}, [&mt('Selected [_1]Problems[_2] from folder [_3] for [_4]selected people[_5]', '','',''.$sequenceTitle.'','',''), - 'problems_for_students', 'CHOOSE_STUDENTS']); - push(@{$printChoices}, [&mt('Selected [_1]Problems[_2] from folder [_3] for [_4]CODEd assignments[_5]', + 'problems_for_students', 'CHOOSE_STUDENTS']; + push @{$printChoices}, [&mt('Selected [_1]Problems[_2] from folder [_3] for [_4]CODEd assignments[_5]', '','',''.$sequenceTitle.'','',''), - 'problems_for_anon', 'CHOOSE_ANON1']); + 'problems_for_anon', 'CHOOSE_ANON1']; } my ($randomly_ordered_warning,$codechoice,$code_selection,$namechoice) = @@ -4682,8 +4658,8 @@ ALL_PROBLEMS # Assignment printing: - push(@{$printChoices}, [&mt('Selected [_1]Resources[_2] from folder [_3] for [_4]selected people[_5]','','',''.$sequenceTitle.'','',''), 'resources_for_students', 'CHOOSE_STUDENTS1']); - push(@{$printChoices}, [&mt('Selected [_1]Resources[_2] from folder [_3] for [_4]CODEd assignments[_5]','','',''.$sequenceTitle.'','',''), 'resources_for_anon', 'CHOOSE_ANON2']); + push @{$printChoices}, [&mt('Selected [_1]Resources[_2] from folder [_3] for [_4]selected people[_5]','','',''.$sequenceTitle.'','',''), 'resources_for_students', 'CHOOSE_STUDENTS1']; + push @{$printChoices}, [&mt('Selected [_1]Resources[_2] from folder [_3] for [_4]CODEd assignments[_5]','','',''.$sequenceTitle.'','',''), 'resources_for_anon', 'CHOOSE_ANON2']; } # resource_selector will hold a few states that: @@ -4792,19 +4768,19 @@ CHOOSE_ANON2 } # FIXME: That RE should come from a library somewhere. - if (($perm{'pav'} - && ($subdir ne '') + if (($perm{'pav'} + && ($subdir ne '') && $subdir ne $Apache::lonnet::perlvar{'lonDocRoot'}.'/res/' && (defined($helper->{'VARS'}->{'construction'}) || (&Apache::lonnet::allowed('bre',$subdir) eq 'F' - && + && $helper->{VARS}->{'postdata'}=~/\.(problem|exam|quiz|assess|survey|form|library|page|xml|html|htm|xhtml|xhtm)/) - )) + )) && $helper->{VARS}->{'assignment'} eq "" ) { my $pretty_dir = &Apache::lonnet::hreflocation($subdir); - push(@{$printChoices}, [&mt('Selected [_1]Problems[_2] from current subdirectory [_3]','','',''.$pretty_dir.'','',''), 'problems_from_directory', 'CHOOSE_FROM_SUBDIR']); + push @{$printChoices}, [&mt('Selected [_1]Problems[_2] from current subdirectory [_3]','','',''.$pretty_dir.'','',''), 'problems_from_directory', 'CHOOSE_FROM_SUBDIR']; my $xmlfrag = < @@ -5038,9 +5014,9 @@ CHOOSE_FROM_ANY_SEQUENCE if ($noprintmsg) { $paramHash = Apache::lonhelper::getParamHash(); - $paramHash->{MESSAGE_TEXT} = + $paramHash->{MESSAGE_TEXT} = '

'.$noprintmsg.'

'; - Apache::lonhelper::message->new(); + Apache::lonhelper::message->new(); } } $paramHash = Apache::lonhelper::getParamHash(); @@ -5055,7 +5031,7 @@ CHOOSE_FROM_ANY_SEQUENCE my $startedTable = 0; # have we started an HTML table yet? (need # to close it later) - if (($perm{'pav'} and $perm{'vgr'}) or + if (($perm{'pav'} and $perm{'vgr'}) or ($helper->{VARS}->{'construction'} eq '1')) { &addMessage('
' .'

'.&mt('Print Options').'

' @@ -5265,7 +5241,7 @@ FONT_SELECTION return "$helper->{VARS}->{'probstatus'}"; Homework Problem - Exam Problem + Bubblesheet Exam Problem Survey question ,choice computer="anonsurvey"Anonymous survey question @@ -5383,6 +5359,9 @@ sub render { my $PaperType=&mt('Paper type'); my $landscape=&mt('Landscape'); my $portrait=&mt('Portrait'); + my $pdfFormLabel=&mt('PDF Form Fields'); + my $with=&mt('with Form Fields'); + my $without=&mt('without Form Fields'); $result.='

'.&mt('Layout Options').'

' @@ -5391,6 +5370,7 @@ sub render { .''.$PageLayout.'' .''.$NumberOfColumns.'' .''.$PaperType.'' + .''.$pdfFormLabel.'' .&Apache::loncommon::end_data_table_header_row() .&Apache::loncommon::start_data_table_row() .'' @@ -5431,6 +5411,12 @@ sub render { $result .= < + + + HTML $result.=&Apache::loncommon::end_data_table_row() .&Apache::loncommon::end_data_table();