--- loncom/interface/lonprintout.pm 2005/09/16 20:39:56 1.381.2.2 +++ loncom/interface/lonprintout.pm 2005/09/16 21:59:56 1.381.2.3 @@ -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 @@ sub get_CODE { 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' ) {