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

albertel lon-capa-cvs@mail.lon-capa.org
Mon, 28 Jul 2003 22:44:56 -0000


albertel		Mon Jul 28 18:44:56 2003 EDT

  Modified files:              
    /loncom/homework	response.pm 
  Log:
  - Fixes BUG#1940, for new style rnd seeded problems with long textual part or response ids you could cgenerate a number larger than 2^32-1 which random_set_seed doesn't like. Now does a use integer in that section of code. Won't modify the results for normal problems.
  
  
Index: loncom/homework/response.pm
diff -u loncom/homework/response.pm:1.81 loncom/homework/response.pm:1.82
--- loncom/homework/response.pm:1.81	Mon Jul 14 14:41:40 2003
+++ loncom/homework/response.pm	Mon Jul 28 18:44:54 2003
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # various response type definitons response definition
 #
-# $Id: response.pm,v 1.81 2003/07/14 18:41:40 sakharuk Exp $
+# $Id: response.pm,v 1.82 2003/07/28 22:44:54 albertel Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -93,10 +93,13 @@
        $rndmod+=&Apache::lonnet::numval($Apache::inputtags::response[-1]);
     }
     if ($rndseed =~/,/) {
-	my ($num1,$num2)=split(/,/,$rndseed);
-	$num1+=$rndmod;
-	$num2+=$rndmod;
-	$rndseed="$num1,$num2";
+	{
+	    use integer;
+	    my ($num1,$num2)=split(/,/,$rndseed);
+	    $num1+=$rndmod;
+	    $num2+=$rndmod;
+	    $rndseed="$num1,$num2";
+	}
     } else {
 	$rndseed+=$rndmod;
     }