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

albertel lon-capa-cvs@mail.lon-capa.org
Thu, 15 May 2003 21:44:23 -0000


albertel		Thu May 15 17:44:23 2003 EDT

  Modified files:              
    /loncom/homework	structuretags.pm 
  Log:
  -integrates interface updates requested in BUG#1264
  
  
  
Index: loncom/homework/structuretags.pm
diff -u loncom/homework/structuretags.pm:1.174 loncom/homework/structuretags.pm:1.175
--- loncom/homework/structuretags.pm:1.174	Wed May 14 14:02:56 2003
+++ loncom/homework/structuretags.pm	Thu May 15 17:44:23 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.174 2003/05/14 18:02:56 sakharuk Exp $
+# $Id: structuretags.pm,v 1.175 2003/05/15 21:44:23 albertel Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -146,8 +146,13 @@
 		$ENV{'form.rndseed'}=$rndseed;
 	    }
 	}
-	if ($ENV{'form.resetdata'} eq 'New Problem Variation') {
+	if ($ENV{'form.resetdata'} eq 'New Problem Variation' ||
+	    $ENV{'form.newrandomization'} eq 'New Randomization') {
 	    $rndseed=time;
+	    if ($rndseed eq $ENV{'form.rndseed'}) {
+		srand($rndseed);
+		$rndseed=int(rand(1000000000));
+	    }
 	    $ENV{'form.rndseed'}=$rndseed;
 	}
 	&Apache::lonxml::debug("Setting rndseed to $rndseed");
@@ -177,10 +182,12 @@
     my $result.='<input type="hidden" name="problemmode" value="View" />
              <input type="submit" name="problemmode" value="Edit" />
              <input type="submit" name="problemmode" value="EditXML" />
-             Random Seed:<input type="text" name="rndseed" width="10" value="'.
-	       $rndseed.'" />
-             <input type="submit" name="changerandseed" value="Change" />
+             <input type="submit" name="newrandomization" value="New Randomization" />
              <input type="submit" name="resetdata" value="Reset Submissions" />
+             <nobr><input type="submit" name="changerandseed" value="Change Random Seed To:" />
+              <input type="text" name="rndseed" width="10" value="'.
+	       $rndseed.'"
+           onChange="javascript:document.lonhomework.changerandseed.click()" /></nobr>
              <input type="checkbox" name="showallfoils" ';
     if (defined($ENV{'form.showallfoils'})) { $result.='checked="on"'; }
     $result.= ' />&nbsp;Show&nbsp;All&nbsp;Foils