--- loncom/interface/lonprintout.pm 2004/04/26 18:21:26 1.294 +++ loncom/interface/lonprintout.pm 2004/04/26 19:00:29 1.295 @@ -1,7 +1,7 @@ # The LearningOnline Network # Printout # -# $Id: lonprintout.pm,v 1.294 2004/04/26 18:21:26 albertel Exp $ +# $Id: lonprintout.pm,v 1.295 2004/04/26 19:00:29 albertel Exp $ # # Copyright Michigan State University Board of Trustees # @@ -1009,6 +1009,10 @@ ENDPART my $old_name=$helper->{'VARS'}->{'REUSE_OLD_CODES'}; my @master_seq=split /\|\|\|/, $helper->{'VARS'}->{'RESOURCES'}; my ($type) = split(/_/,$helper->{'VARS'}->{'PRINT_TYPE'}); + my $number_per_page=$helper->{'VARS'}->{'NUMBER_TO_PRINT'}; + if ($number_per_page eq '0' || $number_per_page eq 'all') { + $number_per_page=$num_todo; + } my $flag_latex_header_remove = 'NO'; my %moreenv = ('textwidth' => &get_textwidth($helper,$LaTeXwidth)); my %prog_state=&Apache::lonhtmlcommon::Create_PrgWin($r,'Print Status','Class Print Status',$num_todo,'inline'); @@ -1029,17 +1033,18 @@ ENDPART } @allcodes=keys(%allcodes); } - my $i=0; + my $count=0; foreach my $code (sort(@allcodes)) { + my $file_num=int($count/$number_per_page); $moreenv{'CODE'}=&num_to_letters($code); my ($output,$fullname)= &print_resources($r,$helper,'anonymous',$type,\%moreenv, \@master_seq,$flag_latex_header_remove); - $print_array[$i].=$output; + $print_array[$file_num].=$output; &Apache::lonhtmlcommon::Increment_PrgWin($r,\%prog_state, &mt('last assignment').' '.$fullname); $flag_latex_header_remove = 'YES'; - $i++; + $count++; } &Apache::lonhtmlcommon::Close_PrgWin($r,\%prog_state); $result .= $print_array[0].' \end{document}';