[LON-CAPA-users] tables, matching problems
Guy Albertelli II
lon-capa-users@mail.lon-capa.org
Fri, 11 Feb 2005 17:02:14 -0500 (EST)
Hi Sally,
This will work:
<problem>
<script type="loncapa/perl">
$graph[0]=
&xmlparse('<gnuplot><curve><function>sin(x)</function></curve></gnuplot>');
$graph[1]=
&xmlparse('<gnuplot><curve><function>cos(x)</function></curve></gnuplot>');
$graph[2]=
&xmlparse('<gnuplot><curve><function>tan(x)</function></curve></gnuplot>');
$graph[3]=
&xmlparse('<gnuplot><curve><function>asin(x)</function></curve></gnuplot>');
@foils=('Sin(x)','Cos(x)','Tan(x)','Asin(x)');
$seed=&random(1,1000000,1);
@foils=&random_permutation($seed,@foils);
@graph=&random_permutation($seed,@graph);
</script>
<startouttext />
<table>
<tr>
<td>A</td><td><display>$graph[0]</display></td>
<td>B</td><td><display>$graph[1]</display></td>
<td>C</td><td><display>$graph[2]</display></td>
<td>D</td><td><display>$graph[3]</display></td>
</tr>
</table>
<endouttext />
<optionresponse max="10" randomize="yes" TeXlayout="horizontal">
<foilgroup options="('A','B','C','D')">
<foil location="random" value="A" name="foil1">$foils[0]</foil>
<foil location="random" value="B" name="foil2">$foils[1]</foil>
<foil location="random" value="C" name="foil3">$foils[2]</foil>
<foil location="random" value="D" name="foil4">$foils[3]</foil>
</foilgroup>
</optionresponse>
</problem>
--
guy@albertelli.com LON-CAPA Developer 0-7-3-2-