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

raeburn raeburn at source.lon-capa.org
Mon Nov 4 13:01:04 EST 2019


raeburn		Mon Nov  4 18:01:04 2019 EDT

  Modified files:              (Branch: version_2_11_X)
    /loncom/homework	structuretags.pm 
  Log:
  - For 2.11
    Backport 1.565.
  
  
Index: loncom/homework/structuretags.pm
diff -u loncom/homework/structuretags.pm:1.512.2.19 loncom/homework/structuretags.pm:1.512.2.20
--- loncom/homework/structuretags.pm:1.512.2.19	Thu Oct 31 16:14:09 2019
+++ loncom/homework/structuretags.pm	Mon Nov  4 18:01:04 2019
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA 
 # definition of tags that give a structure to a document
 #
-# $Id: structuretags.pm,v 1.512.2.19 2019/10/31 16:14:09 raeburn Exp $
+# $Id: structuretags.pm,v 1.512.2.20 2019/11/04 18:01:04 raeburn Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -677,7 +677,7 @@
                 $env{'form.rndseed'}=$rndseed;
             }
 	}
-        if (($env{'request.state'} eq "construct") && 
+        if ((($env{'request.state'} eq "construct") || ($symb eq '')) &&
             ($Apache::lonhomework::type eq 'randomizetry')) {
             if ($numtries) {
                 if (($reqtries =~ /^\d+$/) && ($reqtries > 1)) {
@@ -1591,8 +1591,12 @@
 
 	if ($env{'request.state'} ne "construct" && 
 	    ($symb eq '' || $Apache::lonhomework::type eq 'practice')) {
+            my $rndseedval = $rndseed;
+            if (($symb eq '') && ($Apache::lonhomework::type eq 'randomizetry')) {
+                $rndseedval = $env{'form.rndseed'};
+            }
 	    $form_tag_start.='<input type="hidden" name="rndseed" value="'.
-		$rndseed.'" />'.
+		$rndseedval.'" />'.
 		    '<input type="submit" name="resetdata"
                              value="'.&mt('New Problem Variation').'" />';
 	    if (exists($env{'form.username'})) {
@@ -1614,9 +1618,10 @@
                 $form_tag_start.=&practice_problem_header();
             }
 	    $form_tag_start.='<hr />';
-        } elsif (($env{'request.state'} ne "construct") &&
-                 ($Apache::lonhomework::type eq 'randomizetry') &&
-                 ($status eq 'CAN_ANSWER')) {
+        }
+        if (($env{'request.state'} ne "construct") &&
+            ($Apache::lonhomework::type eq 'randomizetry') &&
+            ($status eq 'CAN_ANSWER')) {
             my $reqtries = &Apache::lonnet::EXT("resource.$Apache::inputtags::part.randomizeontries");
             my $problemstatus = &get_problem_status($Apache::inputtags::part);
             $form_tag_start.=&randomizetry_problem_header($problemstatus,$reqtries);




More information about the LON-CAPA-cvs mailing list