File:
[LON-CAPA] /
loncom /
homework /
templates /
randomvalueradio.problem
Revision
1.1:
download - view:
text,
annotated -
select for diffs
Thu Sep 2 15:32:30 2010 UTC (14 years, 3 months ago) by
www
Branches:
MAIN
CVS tags:
version_2_12_X,
version_2_11_X,
version_2_11_5_msu,
version_2_11_5,
version_2_11_4_uiuc,
version_2_11_4_msu,
version_2_11_4,
version_2_11_3_uiuc,
version_2_11_3_msu,
version_2_11_3,
version_2_11_2_uiuc,
version_2_11_2_msu,
version_2_11_2_educog,
version_2_11_2,
version_2_11_1,
version_2_11_0_RC3,
version_2_11_0_RC2,
version_2_11_0_RC1,
version_2_11_0,
version_2_10_X,
version_2_10_1,
version_2_10_0_RC2,
version_2_10_0,
loncapaMITrelate_1,
language_hyphenation_merge,
language_hyphenation,
HEAD,
BZ4492-merge,
BZ4492-feature_horizontal_radioresponse,
BZ4492-feature_Support_horizontal_radioresponse,
BZ4492-Support_horizontal_radioresponse
After being asked often enough: randomizing the question stem for a radio
button response.
<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>
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>