[LON-CAPA-cvs] cvs: loncom /homework structuretags.pm

albertel lon-capa-cvs@mail.lon-capa.org
Mon, 16 Feb 2004 18:40:18 -0000


albertel		Mon Feb 16 13:40:18 2004 EDT

  Modified files:              
    /loncom/homework	structuretags.pm 
  Log:
  - BUG#1682, use problem type setting
  - also set form.rndseed if ewe find the rndseed in the history hash
  
  
Index: loncom/homework/structuretags.pm
diff -u loncom/homework/structuretags.pm:1.236 loncom/homework/structuretags.pm:1.237
--- loncom/homework/structuretags.pm:1.236	Mon Feb 16 12:19:36 2004
+++ loncom/homework/structuretags.pm	Mon Feb 16 13:40:18 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.236 2004/02/16 17:19:36 albertel Exp $
+# $Id: structuretags.pm,v 1.237 2004/02/16 18:40:18 albertel Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -158,8 +158,8 @@
 	    $rndseed=$Apache::lonhomework::history{'rndseed'};
 	    if (!$rndseed) {
 		$rndseed=time;
-		$ENV{'form.rndseed'}=$rndseed;
 	    }
+	    $ENV{'form.rndseed'}=$rndseed;
 	}
 	if ($ENV{'form.resetdata'} eq &mt('New Problem Variation') ||
 	    $ENV{'form.newrandomization'} eq &mt('New Randomization')) {
@@ -396,6 +396,10 @@
 	    &Apache::lonhomework::showhash(%Apache::lonhomework::history);
 	}
 	$Apache::lonhomework::type=&Apache::lonnet::EXT('resource.0.type');
+	if (($ENV{'request.state'} eq 'construct') &&
+	    defined($ENV{'form.problemtype'})) {
+	    $Apache::lonhomework::type=$ENV{'form.problemtype'};
+	}
 	&Apache::lonxml::debug("Found this to be of type :$Apache::lonhomework::type:");
     }
     if ($Apache::lonhomework::type eq '' ) {