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

albertel lon-capa-cvs@mail.lon-capa.org
Thu, 19 Jun 2003 20:04:16 -0000


albertel		Thu Jun 19 16:04:16 2003 EDT

  Modified files:              
    /loncom/homework	structuretags.pm 
  Log:
  - you put anything you want into the randomseed now. BUG#1352
  
  
Index: loncom/homework/structuretags.pm
diff -u loncom/homework/structuretags.pm:1.186 loncom/homework/structuretags.pm:1.187
--- loncom/homework/structuretags.pm:1.186	Wed Jun 18 18:12:34 2003
+++ loncom/homework/structuretags.pm	Thu Jun 19 16:04:16 2003
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA 
 # definition of tags that give a structure to a document
 #
-# $Id: structuretags.pm,v 1.186 2003/06/18 22:12:34 albertel Exp $
+# $Id: structuretags.pm,v 1.187 2003/06/19 20:04:16 albertel Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -158,6 +158,9 @@
 	    delete($ENV{'form.resetdata'});
 	    delete($ENV{'form.newrandomization'});
 	}
+	if (defined($rndseed) && $rndseed ne int($rndseed)) {
+	   $rndseed=join(',',&Math::Random::random_seed_from_phrase($rndseed));
+        }
 	&Apache::lonxml::debug("Setting rndseed to $rndseed");
 	&Apache::run::run('$external::randomseed='.$rndseed.';',$safeeval);
     }
@@ -390,7 +393,7 @@
               $body_tag_start \n $form_tag_start".	
 		  '<input type="hidden" name="submitted" value="yes" />';
 		if ($ENV{'request.state'} eq "construct") {
-		    $result.= &problem_web_to_edit_header($rndseed);
+		    $result.= &problem_web_to_edit_header($ENV{'form.rndseed'});
 		}
 		# if we are viewing someone else preserve that info
 		if (defined $ENV{'form.grade_symb'}) {