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

albertel lon-capa-cvs@mail.lon-capa.org
Thu, 22 Apr 2004 22:59:11 -0000


albertel		Thu Apr 22 18:59:11 2004 EDT

  Modified files:              
    /loncom/interface	lonprintout.pm 
  Log:
  - need to pad the number with leading zeros
  
  
Index: loncom/interface/lonprintout.pm
diff -u loncom/interface/lonprintout.pm:1.292 loncom/interface/lonprintout.pm:1.293
--- loncom/interface/lonprintout.pm:1.292	Tue Apr 20 02:11:49 2004
+++ loncom/interface/lonprintout.pm	Thu Apr 22 18:59:11 2004
@@ -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.293 2004/04/22 22:59:11 albertel Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -1222,7 +1222,7 @@
     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);