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

raeburn raeburn at source.lon-capa.org
Fri Aug 26 18:40:17 EDT 2011


raeburn		Fri Aug 26 22:40:17 2011 EDT

  Modified files:              
    /loncom/homework	radiobuttonresponse.pm 
  Log:
  - Bug 6489.
    - radiobuttonresponse containing foil with location="bottom" and value="false"
      can now include "true" foil in next to bottom position.
    - legacy behavior (that position inaccessible to "true" foil) retained for 
      questiontype of "exam", in case bubblesheet exam is printed on a server running
      pre-rev 1.150 version of radiobuttonresponse, and graded on a server 
      running rev 1.150 or later.
  
  
Index: loncom/homework/radiobuttonresponse.pm
diff -u loncom/homework/radiobuttonresponse.pm:1.149 loncom/homework/radiobuttonresponse.pm:1.150
--- loncom/homework/radiobuttonresponse.pm:1.149	Tue Jun  7 17:27:37 2011
+++ loncom/homework/radiobuttonresponse.pm	Fri Aug 26 22:40:17 2011
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # mutliple choice style responses
 #
-# $Id: radiobuttonresponse.pm,v 1.149 2011/06/07 17:27:37 www Exp $
+# $Id: radiobuttonresponse.pm,v 1.150 2011/08/26 22:40:17 raeburn Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -555,8 +555,12 @@
 	    $dosplice=0;
 	} else {
 	    if ($topcount>0 || $bottomcount>0) {
-		$answer = int(&Math::Random::random_uniform() * ($#whichfalse+1))
-		    + $topcount;
+                my $inc = 1;
+                if (($bottomcount > 0) && ($Apache::lonhomework::type ne 'exam')) {
+                    $inc = 2;
+                }
+                $answer=int(&Math::Random::random_uniform() * ($#whichfalse+$inc))
+                        + $topcount;
 	    }
 	}
 	&Apache::lonxml::debug("Answer now wants $answer");




More information about the LON-CAPA-cvs mailing list