--- loncom/interface/lonprintout.pm 2004/11/13 09:18:52 1.335 +++ loncom/interface/lonprintout.pm 2004/11/13 09:27:47 1.336 @@ -1,7 +1,7 @@ # The LearningOnline Network # Printout # -# $Id: lonprintout.pm,v 1.335 2004/11/13 09:18:52 albertel Exp $ +# $Id: lonprintout.pm,v 1.336 2004/11/13 09:27:47 albertel Exp $ # # Copyright Michigan State University Board of Trustees # @@ -1096,20 +1096,13 @@ ENDPART my $num_todo=$helper->{'VARS'}->{'NUMBER_TO_PRINT_TOTAL'}; my $code_name=$helper->{'VARS'}->{'ANON_CODE_STORAGE_NAME'}; 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','75'); my $seed=time+($$<<16)+($$); my @allcodes; if ($old_name) { my %result=&Apache::lonnet::get('CODEs',[$old_name],$cdom,$cnum); @allcodes=split(',',$result{$old_name}); + $num_todo=scalar(@allcodes); } else { my %allcodes; srand($seed); @@ -1123,6 +1116,14 @@ ENDPART } @allcodes=keys(%allcodes); } + 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 %prog_state=&Apache::lonhtmlcommon::Create_PrgWin($r,'Print Status','Class Print Status',$num_todo,'inline','75'); my $count=0; foreach my $code (sort(@allcodes)) { my $file_num=int($count/$number_per_page);