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

albertel lon-capa-cvs@mail.lon-capa.org
Fri, 16 Sep 2005 21:59:57 -0000


albertel		Fri Sep 16 17:59:57 2005 EDT

  Modified files:              (Branch: version_2_0_X)
    /loncom/interface	lonprintout.pm 
  Log:
  - gah, need to format the CODE to the correct number of digits.
  
  
Index: loncom/interface/lonprintout.pm
diff -u loncom/interface/lonprintout.pm:1.381.2.2 loncom/interface/lonprintout.pm:1.381.2.3
--- loncom/interface/lonprintout.pm:1.381.2.2	Fri Sep 16 16:39:56 2005
+++ loncom/interface/lonprintout.pm	Fri Sep 16 17:59:56 2005
@@ -1,7 +1,7 @@
 #  The LearningOnline Network
 # Printout
 #
-# $Id: lonprintout.pm,v 1.381.2.2 2005/09/16 20:39:56 albertel Exp $
+# $Id: lonprintout.pm,v 1.381.2.3 2005/09/16 21:59:56 albertel Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -1505,7 +1505,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' ) {