[LON-CAPA-cvs] cvs: loncom /interface lonprintout.pm

albertel lon-capa-cvs@mail.lon-capa.org
Fri, 16 Sep 2005 20:45:02 -0000


albertel		Fri Sep 16 16:45:02 2005 EDT

  Modified files:              
    /loncom/interface	lonprintout.pm 
  Log:
  - forward port 1.382.2.2
  
  
Index: loncom/interface/lonprintout.pm
diff -u loncom/interface/lonprintout.pm:1.391 loncom/interface/lonprintout.pm:1.392
--- loncom/interface/lonprintout.pm:1.391	Tue Sep  6 05:54:21 2005
+++ loncom/interface/lonprintout.pm	Fri Sep 16 16:45:00 2005
@@ -1,7 +1,7 @@
 # The LearningOnline Network
 # Printout
 #
-# $Id: lonprintout.pm,v 1.391 2005/09/06 09:54:21 foxr Exp $
+# $Id: lonprintout.pm,v 1.392 2005/09/16 20:45:00 albertel Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -42,8 +42,6 @@
 use POSIX qw(strftime);
 use Apache::lonlocal;
 
-my $resources_printed = '';
-
 #
 #   Convert a numeric code to letters
 #
@@ -927,6 +925,7 @@
 sub output_data {
     my ($r,$helper,$rparmhash) = @_;
     my %parmhash = %$rparmhash;
+    my $resources_printed = '';
     my $html=&Apache::lonxml::xmlbegin();
     my $bodytag=&Apache::loncommon::bodytag('Preparing Printout');
     $r->print(<<ENDPART);
@@ -1631,7 +1630,7 @@
     my $max='1'.'0'x$size;
     my $newcode;
     while(1) {
-	$newcode=sprintf("%06d",int(rand($max)));
+	$newcode=sprintf("%0".$size."d",int(rand($max)));
 	if (!exists($$all_codes{$newcode})) {
 	    $$all_codes{$newcode}=1;
 	    if ($type eq 'number' ) {