[LON-CAPA-cvs] cvs: loncom /homework/templates randomvalueradio.problem randomvalueradio.problem.meta doc/loncapafiles loncapafiles.lpml
www
www@source.lon-capa.org
Thu, 02 Sep 2010 15:32:30 -0000
www Thu Sep 2 15:32:30 2010 EDT
Added files:
/loncom/homework/templates randomvalueradio.problem
randomvalueradio.problem.meta
Modified files:
/doc/loncapafiles loncapafiles.lpml
Log:
After being asked often enough: randomizing the question stem for a radio
button response.
Index: doc/loncapafiles/loncapafiles.lpml
diff -u doc/loncapafiles/loncapafiles.lpml:1.705 doc/loncapafiles/loncapafiles.lpml:1.706
--- doc/loncapafiles/loncapafiles.lpml:1.705 Mon Aug 30 09:47:29 2010
+++ doc/loncapafiles/loncapafiles.lpml Thu Sep 2 15:32:27 2010
@@ -2,7 +2,7 @@
"http://lpml.sourceforge.net/DTD/lpml.dtd">
<!-- loncapafiles.lpml -->
-<!-- $Id: loncapafiles.lpml,v 1.705 2010/08/30 09:47:29 wenzelju Exp $ -->
+<!-- $Id: loncapafiles.lpml,v 1.706 2010/09/02 15:32:27 www Exp $ -->
<!--
@@ -1324,6 +1324,8 @@
RadioResponse.problem.meta;
RandomLabelExample.problem;
RandomLabelExample.problem.meta;
+randomvalueradio.problem;
+randomvalueradio.problem.meta;
SelectFromOptions-4ConceptGoups.problem;
SelectFromOptions-4ConceptGoups.problem.meta;
SelectFromOptions-5ConceptGoups.problem;
Index: loncom/homework/templates/randomvalueradio.problem
+++ loncom/homework/templates/randomvalueradio.problem
<problem>
<parameter name="maxtries" id="11" type="int_pos" default="2" description="Maximum Number of Tries" />
<script type="loncapa/perl">$idx=&random(0,3,1);
$city=('Berlin','New York','Sao Paulo','Canberra')[$idx];
$southern=('false','false','true','true')[$idx];
$northern=('true','true','false','false')[$idx];
$europe=('true','false','false','false')[$idx];
$australia=('false','false','false','true')[$idx];
if ($idx==2) { $anothercontinent='Asia'; } else { $anothercontinent='South America'; }</script>
<startouttext />
Which one of the following statements is true for $city?
<endouttext />
<radiobuttonresponse direction="vertical" max="3" id="12" randomize="yes">
<foilgroup>
<foil location="random" value="$europe" name="foil1">
<startouttext />In Europe<endouttext />
</foil>
<foil location="random" value="$australia" name="foil2">
<startouttext />In Australia<endouttext />
</foil>
<foil location="random" value="false" name="foil3">
<startouttext />In $anothercontinent<endouttext />
</foil>
<foil location="random" value="$southern" name="foil4">
<startouttext />In the Southern Hemisphere<endouttext />
</foil>
<foil location="random" value="$northern" name="foil5">
<startouttext />In the Northern Hemisphere<endouttext />
</foil>
<foil location="bottom" value="true" name="foil6">
<startouttext />None of the above<endouttext />
</foil>
</foilgroup>
</radiobuttonresponse>
</problem>
Index: loncom/homework/templates/randomvalueradio.problem.meta
+++ loncom/homework/templates/randomvalueradio.problem.meta
<title>Randomized Question Stem Radio Button Response</title>
<category>Multiple Choice Problems</category>
<help>Radio_Response_Problems</help>