[LON-CAPA-cvs] cvs: loncom /homework default_homework.lcpm
albertel
lon-capa-cvs@mail.lon-capa.org
Fri, 15 Nov 2002 17:06:08 -0000
albertel Fri Nov 15 12:06:08 2002 EDT
Modified files:
/loncom/homework default_homework.lcpm
Log:
- should make sure that the seed is always in the proper range
- fixes BUG#966
Index: loncom/homework/default_homework.lcpm
diff -u loncom/homework/default_homework.lcpm:1.54 loncom/homework/default_homework.lcpm:1.55
--- loncom/homework/default_homework.lcpm:1.54 Wed Nov 13 18:05:46 2002
+++ loncom/homework/default_homework.lcpm Fri Nov 15 12:06:08 2002
@@ -1,7 +1,7 @@
# The LearningOnline Network with CAPA
# used by lonxml::xmlparse() as input variable $safeinit to Apache::run::run()
#
-# $Id: default_homework.lcpm,v 1.54 2002/11/13 23:05:46 albertel Exp $
+# $Id: default_homework.lcpm,v 1.55 2002/11/15 17:06:08 albertel Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -240,7 +240,8 @@
sub random {
my ($start,$end,$step)=@_;
if ( ! $hidden::RANDOMINIT ) {
- &random_set_seed(1,$external::randomseed);
+ if ($external::randomseed == 0) { $external::randomseed=1; }
+ &random_set_seed(1,int(abs($external::randomseed)));
&math_random_uniform();
$hidden::RANDOMINIT=1;
}