--- loncom/interface/lonprintout.pm 2024/11/09 15:40:00 1.700 +++ loncom/interface/lonprintout.pm 2024/11/11 00:43:39 1.703 @@ -1,7 +1,7 @@ # The LearningOnline Network # Printout # -# $Id: lonprintout.pm,v 1.700 2024/11/09 15:40:00 raeburn Exp $ +# $Id: lonprintout.pm,v 1.703 2024/11/11 00:43:39 raeburn Exp $ # # Copyright Michigan State University Board of Trustees # @@ -1861,12 +1861,12 @@ sub old_character_chart { my %page_formats= ('letter' => { 'book' => { - '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'] + '1' => [ '7.1 in','9.7 in', '-0.57 in','-0.57 in','0.1 in'], + '2' => ['3.66 in','9.8 in', '-0.57 in','-0.57 in','0.1 in'] }, 'album' => { - '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'] + '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'] }, }, 'legal' => { @@ -1876,7 +1876,7 @@ my %page_formats= }, 'album' => { '1' => ['12 in','7.1 in',,'-0.57 in','-0.57 in','-0.5 in'], - '2' => ['6.0 in','7.1 in','-1 in','-1 in','5 in'] + '2' => ['5.7 in','7.1 in','-1 in','-1 in','5 in'] }, }, 'tabloid' => { @@ -1925,8 +1925,8 @@ my %page_formats= '2' => [ '9.1 cm','27.2 cm','-1.397 cm','-2.11 cm','-1.27 cm'] }, 'album' => { - '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'] + '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'] }, }, 'a5' => { @@ -1985,7 +1985,8 @@ sub get_course { } sub page_format_transformation { - my ($papersize,$layout,$numberofcolumns,$choice,$text,$assignment,$tableofcontents,$indexlist,$selectionmade) = @_; + my ($papersize,$layout,$numberofcolumns,$choice,$text,$assignment,$tableofcontents, + $indexlist,$selectionmade,$mostrecent) = @_; my ($textwidth,$textheight,$oddoffset,$evenoffset,$topmargin); if ($selectionmade eq '4') { @@ -1999,8 +2000,12 @@ sub page_format_transformation { } ($textwidth,$textheight,$oddoffset,$evenoffset,$topmargin) = &page_format($papersize,$layout,$numberofcolumns,$topmargin); - - my $name = &get_name(); + my $name; + if ($mostrecent ne '') { + $name = $mostrecent; + } else { + $name = &get_name(); + } my $courseidinfo = &get_course(); my $header_text = $parmhash{'print_header_format'}; $header_text = &format_page_header($textwidth, $header_text, $assignment, @@ -2768,6 +2773,7 @@ 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 @@ -2860,7 +2866,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 @@ -3388,6 +3394,9 @@ 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); @@ -3397,6 +3406,7 @@ 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'}; @@ -3510,6 +3520,9 @@ 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); @@ -3589,13 +3602,18 @@ 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); + $selectionmade,$mostrecent); $result = &latex_corrections($number_of_columns,$result,$selectionmade, $helper->{'VARS'}->{'ANSWER_TYPE'}); #if ($numberofcolumns == 1) {