[LON-CAPA-cvs] cvs: loncom /homework structuretags.pm
albertel
lon-capa-cvs@mail.lon-capa.org
Tue, 04 May 2004 19:32:28 -0000
albertel Tue May 4 15:32:28 2004 EDT
Modified files:
/loncom/homework structuretags.pm
Log:
- shoot missed a rndseed setter that need to set to take care of the CODE mode
Index: loncom/homework/structuretags.pm
diff -u loncom/homework/structuretags.pm:1.246 loncom/homework/structuretags.pm:1.247
--- loncom/homework/structuretags.pm:1.246 Thu Apr 29 03:57:47 2004
+++ loncom/homework/structuretags.pm Tue May 4 15:32:28 2004
@@ -1,7 +1,7 @@
# The LearningOnline Network with CAPA
# definition of tags that give a structure to a document
#
-# $Id: structuretags.pm,v 1.246 2004/04/29 07:57:47 albertel Exp $
+# $Id: structuretags.pm,v 1.247 2004/05/04 19:32:28 albertel Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -153,7 +153,8 @@
my ($safeeval)=@_;
my $rndseed;
my ($symb)=&Apache::lonxml::whichuser();
- if ($ENV{'request.state'} eq "construct" || $symb eq '') {
+ if ($ENV{'request.state'} eq "construct" || $symb eq '' ||
+ $Apache::lonhomework::history{'resource.CODE'}) {
$rndseed=$ENV{'form.rndseed'};
if (!$rndseed) {
$rndseed=$Apache::lonhomework::history{'rndseed'};
@@ -173,6 +174,9 @@
if (defined($rndseed) && $rndseed ne int($rndseed)) {
$rndseed=join(',',&Math::Random::random_seed_from_phrase($rndseed));
}
+ if ($Apache::lonhomework::history{'resource.CODE'}) {
+ $rndseed=&Apache::lonnet::rndseed();
+ }
if ($safeeval) {
&Apache::lonxml::debug("Setting rndseed to $rndseed");
&Apache::run::run('$external::randomseed='.$rndseed.';',$safeeval);