[LON-CAPA-users] multiple random-label images?
Guy Albertelli II
lon-capa-users@mail.lon-capa.org
Thu, 20 Mar 2003 13:22:18 -0500 (EST)
>
> Using <script> to do everything,
Forgot the allow lines,
<problem>
<script type="loncapa/perl">
$whichimage=&random(0,1,1);
$location=([1,50,1,100],[100,100,100,50])[$whichimage];
$image=('ADP_P_symb.gif','ATP_symbol.gif')[$whichimage];
$labels=(['A','B'],['!A','!B'])[$whichimage];
</script>
<randomlabel bgimg="/res/msu/bio/EnzymeEnergy/graphics/$image">
<labelgroup type="text" name="rlimage">
<label>$$labels[0]</label>
<label>$$labels[1]</label>
<location x="$$location[0]" y="$$location[1]"></location>
<location x="$$location[2]" y="$$location[3]"></location>
</labelgroup>
</randomlabel>
<allow src="/res/msu/bio/EnzymeEnergy/graphics/ADP_P_symb.gif" />
<allow src="/res/msu/bio/EnzymeEnergy/graphics/ATP_symbol.gif" />
</problem>
--
guy@albertelli.com LON-CAPA Developer 0-7-7-1-