--- loncom/interface/lonprintout.pm 2004/04/20 06:11:49 1.292
+++ 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.292 2004/04/20 06:11:49 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}';
@@ -1222,7 +1227,7 @@ sub get_CODE {
srand($seed);
my $newcode;
while(1) {
- $newcode=int(rand($max));
+ $newcode=sprintf("%06d",int(rand($max)));
if (!exists($$all_codes{$newcode})) {
$$all_codes{$newcode}=1;
return &num_to_letters($newcode);
@@ -1583,6 +1588,7 @@ CHOOSE_STUDENTS
my @names=&Apache::lonnet::getkeys('CODEs',$cdom,$cnum);
my $namechoice='';
foreach my $name (@names) {
+ if ($name =~ /^error: 2 /) { next; }
$namechoice.=''.$name.'';
}
&Apache::lonxml::xmlparse($r, 'helper', <
-
How many Anonymous exams to print?
+ PAGESIZE
+
Number of anonymous assignments to print?
+
Names to store the CODEs under for later:
+
+
+ Reprint a set of saved CODEs:
+
+ $namechoice
+
$resource_selector