[LON-CAPA-cvs] cvs: loncom /homework response.pm /lonnet/perl lonnet.pm

www www@source.lon-capa.org
Mon, 06 Jun 2011 17:17:44 -0000


www		Mon Jun  6 17:17:44 2011 EDT

  Modified files:              
    /loncom/homework	response.pm 
    /loncom/lonnet/perl	lonnet.pm 
  Log:
  Bug #6476: reversing lonnet.pm 1.1109 to 1.1108
  Needed to catch post-processing of random seed.
  
  
Index: loncom/homework/response.pm
diff -u loncom/homework/response.pm:1.222 loncom/homework/response.pm:1.223
--- loncom/homework/response.pm:1.222	Mon Mar  7 19:42:21 2011
+++ loncom/homework/response.pm	Mon Jun  6 17:17:38 2011
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # various response type definitons response definition
 #
-# $Id: response.pm,v 1.222 2011/03/07 19:42:21 www Exp $
+# $Id: response.pm,v 1.223 2011/06/06 17:17:38 www Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -196,6 +196,7 @@
 	}
     }
     &Apache::lonxml::debug("randseed $rndmod $rndseed");
+    $Apache::lonhomework::results{'resource.'.$id1.'.rndseed'}=$rndseed;
     &Apache::lonnet::setup_random_from_rndseed($rndseed);
     return '';
 }
Index: loncom/lonnet/perl/lonnet.pm
diff -u loncom/lonnet/perl/lonnet.pm:1.1109 loncom/lonnet/perl/lonnet.pm:1.1110
--- loncom/lonnet/perl/lonnet.pm:1.1109	Mon Jun  6 16:48:44 2011
+++ loncom/lonnet/perl/lonnet.pm	Mon Jun  6 17:17:44 2011
@@ -1,7 +1,7 @@
 # The LearningOnline Network
 # TCP networking package
 #
-# $Id: lonnet.pm,v 1.1109 2011/06/06 16:48:44 www Exp $
+# $Id: lonnet.pm,v 1.1110 2011/06/06 17:17:44 www Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -9292,6 +9292,7 @@
     if (!$domain) { $domain=$wdomain; }
     if (!$username) { $username=$wusername }
     my $which=&get_rand_alg();
+
     if (defined(&getCODE())) {
 	if ($which eq '64bit5') {
 	    return &rndseed_CODE_64bit5($symb,$courseid,$domain,$username);
@@ -9328,7 +9329,6 @@
 	#&logthis("$symbseed:$nameseed;$domainseed|$courseseed;$namechck:$symbchck");
 	#&logthis("rndseed :$num:$symb");
 	if ($_64bit) { $num=(($num<<32)>>32); }
-        $Apache::lonhomework::results{'resource.0.rndseed'}=$num;
 	return $num;
     }
 }
@@ -9350,7 +9350,6 @@
 	#&logthis("$symbseed:$nameseed;$domainseed|$courseseed;$namechck:$symbchck");
 	#&logthis("rndseed :$num:$symb");
 	if ($_64bit) { $num1=(($num1<<32)>>32); $num2=(($num2<<32)>>32); }
-        $Apache::lonhomework::results{'resource.0.rndseed'}="$num1:$num2";
 	return "$num1,$num2";
     }
 }
@@ -9374,7 +9373,6 @@
 	#&logthis("$symbseed:$nameseed;$domainseed|$courseseed;$namechck:$symbchck");
 	#&logthis("rndseed :$num:$symb");
 	if ($_64bit) { $num1=(($num1<<32)>>32); $num2=(($num2<<32)>>32); }
-        $Apache::lonhomework::results{'resource.0.rndseed'}="$num1:$num2";
 	return "$num1,$num2";
     }
 }
@@ -9398,7 +9396,7 @@
 	#&logthis("$symbseed:$nameseed;$domainseed|$courseseed;$namechck:$symbchck");
 	#&logthis("rndseed :$num1:$num2:$_64bit");
 	if ($_64bit) { $num1=(($num1<<32)>>32); $num2=(($num2<<32)>>32); }
-	$Apache::lonhomework::results{'resource.0.rndseed'}="$num1:$num2";
+	
 	return "$num1:$num2";
     }
 }
@@ -9422,7 +9420,7 @@
 	#&logthis("$symbseed:$nameseed;$domainseed|$courseseed;$namechck:$symbchck");
 	#&logthis("rndseed :$num1:$num2:$_64bit");
 	if ($_64bit) { $num1=(($num1<<32)>>32); $num2=(($num2<<32)>>32); }
-	$Apache::lonhomework::results{'resource.0.rndseed'}="$num1:$num2";
+	
 	return "$num1:$num2";
     }
 }
@@ -9430,7 +9428,6 @@
 sub rndseed_64bit5 {
     my ($symb,$courseid,$domain,$username)=@_;
     my ($num1,$num2)=&digest("$symb,$courseid,$domain,$username");
-    $Apache::lonhomework::results{'resource.0.rndseed'}="$num1:$num2";
     return "$num1:$num2";
 }