File:  [LON-CAPA] / loncom / homework / simpleproblem.problem
Revision 1.13: download - view: text, annotated - select for diffs
Thu Nov 8 22:04:43 2012 UTC (12 years ago) by raeburn
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, HEAD
- Consistent interface for templated pages (bug 6128).
  - simpleeditbutton tag no longer required.

<problem>
<script type="loncapa/perl">
$questiontype=&EXT('resource.0.hiddenparts');
if ($questiontype eq '!placeholder') { $questiontype=''; }
$max=&EXT('resource.0.maxfoils');
unless ($max) { $max=10; }
$randomize=&EXT('resource.0.randomize');
unless ($randomize) { $randomize='yes'; }
$options=&EXT('resource.0.options');
unless ($options) { $options='("true","false")'; }
for ($i=1;$i<=10;$i++) {
    $value[$i]=&EXT('resource.0.value'.$i);
    unless ($value[$i]) { $value[$i]='unused'; }
    $position[$i]=&EXT('resource.0.position'.$i);
    unless ($position[$i]) { $position[$i]='random'; }
}
$stringanswer=&EXT('resource.0.stringanswer');
unless ($stringanswer) { $stringanswer=''; }
$stringtype=&EXT('resource.0.stringtype');
unless ($stringtype) { $stringtype='cs'; }
$numericalanswer=&EXT('resource.0.numericalanswer');
unless ($numericalanswer) { $numericalanswer=''; }
$numericaltolerance=&EXT('resource.0.numericaltolerance');
unless ($numericaltolerance) { $numericaltolerance='5%'; }
$numericalsigfigs=&EXT('resource.0.numericalsigfigs');
unless ($numericalsigfigs) { $numericalsigfigs='1,15'; }
$numericalunit=&EXT('resource.0.numericalunit');
unless ($numericalunit) { $numericalunit=''; }
$numericalformat=&EXT('resource.0.numericalformat');
unless ($numericalformat) { $numericalformat=''; }
$numericalscript=&EXT('resource.0.numericalscript');
unless ($numericalscript) { $numericalscript=''; }
</script>

<parameter name="hiddenparts" id="11" type="string" default="!placeholder" description="List of hidden parts" />

<block condition="!$questiontype"> 
<startouttext />
<h1>Problem Placeholder</h1>
<endouttext />
<part id="placeholder">
<stringresponse id="placeholdersegment">
</stringresponse>
</part>
</block>

<block condition="$questiontype"> 

<part id="radio">
<startouttext /><parse>&EXT('resource.0.questiontext')</parse><br /><endouttext />

<radiobuttonresponse max="$max" id="radiosegment" randomize="$randomize">
<foilgroup>
<foil location="$position[1]" value="$value[1]" name="radiofoil1">
<startouttext /><parse>&EXT('resource.0.text1')</parse><endouttext />
</foil>
<foil location="$position[2]" value="$value[2]" name="radiofoil2">
<startouttext /><parse>&EXT('resource.0.text2')</parse><endouttext />
</foil>
<foil location="$position[3]" value="$value[3]" name="radiofoil3">
<startouttext /><parse>&EXT('resource.0.text3')</parse><endouttext />
</foil>
<foil location="$position[4]" value="$value[4]" name="radiofoil4">
<startouttext /><parse>&EXT('resource.0.text4')</parse><endouttext />
</foil>
<foil location="$position[5]" value="$value[5]" name="radiofoil5">
<startouttext /><parse>&EXT('resource.0.text5')</parse><endouttext />
</foil>
<foil location="$position[6]" value="$value[6]" name="radiofoil6">
<startouttext /><parse>&EXT('resource.0.text6')</parse><endouttext />
</foil>
<foil location="$position[7]" value="$value[7]" name="radiofoil7">
<startouttext /><parse>&EXT('resource.0.text7')</parse><endouttext />
</foil>
<foil location="$position[8]" value="$value[8]" name="radiofoil8">
<startouttext /><parse>&EXT('resource.0.text8')</parse><endouttext />
</foil>
<foil location="$position[9]" value="$value[9]" name="radiofoil9">
<startouttext /><parse>&EXT('resource.0.text9')</parse><endouttext />
</foil>
<foil location="$position[10]" value="$value[10]" name="radiofoil10">
<startouttext /><parse>&EXT('resource.0.text10')</parse><endouttext />
</foil>
</foilgroup>
<hintgroup>
<startouttext /><parse>&EXT('resource.0.hinttext')</parse><endouttext />
</hintgroup>
</radiobuttonresponse>
</part>

<part id="option"> 
<startouttext /><parse>&EXT('resource.0.questiontext')</parse><br /><endouttext />
<optionresponse max="$max" id="optionsegment" randomize="$randomize">
<foilgroup options="$options">
<foil location="$position[1]" value="$value[1]" name="optionfoil1">
<startouttext /><parse>&EXT('resource.0.text1')</parse><endouttext />
</foil>
<foil location="$position[2]" value="$value[2]" name="optionfoil2">
<startouttext /><parse>&EXT('resource.0.text2')</parse><endouttext />
</foil>
<foil location="$position[3]" value="$value[3]" name="optionfoil3">
<startouttext /><parse>&EXT('resource.0.text3')</parse><endouttext />
</foil>
<foil location="$position[4]" value="$value[4]" name="optionfoil4">
<startouttext /><parse>&EXT('resource.0.text4')</parse><endouttext />
</foil>
<foil location="$position[5]" value="$value[5]" name="optionfoil5">
<startouttext /><parse>&EXT('resource.0.text5')</parse><endouttext />
</foil>
<foil location="$position[6]" value="$value[6]" name="optionfoil6">
<startouttext /><parse>&EXT('resource.0.text6')</parse><endouttext />
</foil>
<foil location="$position[7]" value="$value[7]" name="optionfoil7">
<startouttext /><parse>&EXT('resource.0.text7')</parse><endouttext />
</foil>
<foil location="$position[8]" value="$value[8]" name="optionfoil8">
<startouttext /><parse>&EXT('resource.0.text8')</parse><endouttext />
</foil>
<foil location="$position[9]" value="$value[9]" name="optionfoil9">
<startouttext /><parse>&EXT('resource.0.text9')</parse><endouttext />
</foil>
<foil location="$position[10]" value="$value[10]" name="optionfoil10">
<startouttext /><parse>&EXT('resource.0.text10')</parse><endouttext />
</foil>
</foilgroup>
<hintgroup>
<startouttext /><parse>&EXT('resource.0.hinttext')</parse><endouttext />
</hintgroup>
</optionresponse>
</part>

<part id="essay"> 
<startouttext /><parse>&EXT('resource.0.questiontext')</parse><br /><endouttext />
<essayresponse id="essaysegment">
<textfield></textfield>
</essayresponse>
</part>

<part id="string"> 
<startouttext /><parse>&EXT('resource.0.questiontext')</parse><br /><endouttext />
<stringresponse answer="$stringanswer" id="stringsegment" type="$stringtype">
<textline>
</textline>
<hintgroup>
<startouttext /><parse>&EXT('resource.0.hinttext')</parse><endouttext />
</hintgroup>
</stringresponse>
</part>

<part id="numerical">
<script type="loncapa/perl">
$tag='script';
&xmlparse("<$tag type='loncapa/perl'>$numericalscript</$tag>");
</script>
<startouttext /><parse>&EXT('resource.0.questiontext')</parse><br /><endouttext />
<numericalresponse unit="$numericalunit" format="$numericalformat" answer="$numericalanswer" id="numericalsegment">
<responseparam name="tol" type="tolerance" default="$numericaltolerance" description="Numerical Tolerance" />
<responseparam name="sig" type="int_range,0-16" default="$numericalsigfigs" description="Significant Figures" />
<textline>
</textline>
<hintgroup>
<startouttext /><parse>&EXT('resource.0.hinttext')</parse><endouttext />
</hintgroup>
</numericalresponse>
</part>

</block>
</problem>



FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>