--- loncom/homework/simpleproblem.problem 2003/11/04 16:44:50 1.6 +++ loncom/homework/simpleproblem.problem 2012/11/08 22:04:43 1.13 @@ -1,7 +1,7 @@ <problem> -<simpleeditbutton /> <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'); @@ -18,115 +18,153 @@ $stringanswer=&EXT('resource.0.stringans 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> -<block condition="!$questiontype"> +<parameter name="hiddenparts" id="11" type="string" default="!placeholder" description="List of hidden parts" /> +<block condition="!$questiontype"> <startouttext /> -<h1>Simple Problem Placeholder</h1> +<h1>Problem Placeholder</h1> <endouttext /> +<part id="placeholder"> +<stringresponse id="placeholdersegment"> +</stringresponse> +</part> </block> <block condition="$questiontype"> -<startouttext />&EXT('resource.0.questiontext')<br /><endouttext /> - <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 />&EXT('resource.0.text1')<endouttext /> +<startouttext /><parse>&EXT('resource.0.text1')</parse><endouttext /> </foil> <foil location="$position[2]" value="$value[2]" name="radiofoil2"> -<startouttext />&EXT('resource.0.text2')<endouttext /> +<startouttext /><parse>&EXT('resource.0.text2')</parse><endouttext /> </foil> <foil location="$position[3]" value="$value[3]" name="radiofoil3"> -<startouttext />&EXT('resource.0.text3')<endouttext /> +<startouttext /><parse>&EXT('resource.0.text3')</parse><endouttext /> </foil> <foil location="$position[4]" value="$value[4]" name="radiofoil4"> -<startouttext />&EXT('resource.0.text4')<endouttext /> +<startouttext /><parse>&EXT('resource.0.text4')</parse><endouttext /> </foil> <foil location="$position[5]" value="$value[5]" name="radiofoil5"> -<startouttext />&EXT('resource.0.text5')<endouttext /> +<startouttext /><parse>&EXT('resource.0.text5')</parse><endouttext /> </foil> <foil location="$position[6]" value="$value[6]" name="radiofoil6"> -<startouttext />&EXT('resource.0.text6')<endouttext /> +<startouttext /><parse>&EXT('resource.0.text6')</parse><endouttext /> </foil> <foil location="$position[7]" value="$value[7]" name="radiofoil7"> -<startouttext />&EXT('resource.0.text7')<endouttext /> +<startouttext /><parse>&EXT('resource.0.text7')</parse><endouttext /> </foil> <foil location="$position[8]" value="$value[8]" name="radiofoil8"> -<startouttext />&EXT('resource.0.text8')<endouttext /> +<startouttext /><parse>&EXT('resource.0.text8')</parse><endouttext /> </foil> <foil location="$position[9]" value="$value[9]" name="radiofoil9"> -<startouttext />&EXT('resource.0.text9')<endouttext /> +<startouttext /><parse>&EXT('resource.0.text9')</parse><endouttext /> </foil> <foil location="$position[10]" value="$value[10]" name="radiofoil10"> -<startouttext />&EXT('resource.0.text10')<endouttext /> +<startouttext /><parse>&EXT('resource.0.text10')</parse><endouttext /> </foil> </foilgroup> <hintgroup> -<startouttext />&EXT('resource.0.hinttext')<endouttext /> +<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 />&EXT('resource.0.text1')<endouttext /> +<startouttext /><parse>&EXT('resource.0.text1')</parse><endouttext /> </foil> <foil location="$position[2]" value="$value[2]" name="optionfoil2"> -<startouttext />&EXT('resource.0.text2')<endouttext /> +<startouttext /><parse>&EXT('resource.0.text2')</parse><endouttext /> </foil> <foil location="$position[3]" value="$value[3]" name="optionfoil3"> -<startouttext />&EXT('resource.0.text3')<endouttext /> +<startouttext /><parse>&EXT('resource.0.text3')</parse><endouttext /> </foil> <foil location="$position[4]" value="$value[4]" name="optionfoil4"> -<startouttext />&EXT('resource.0.text4')<endouttext /> +<startouttext /><parse>&EXT('resource.0.text4')</parse><endouttext /> </foil> <foil location="$position[5]" value="$value[5]" name="optionfoil5"> -<startouttext />&EXT('resource.0.text5')<endouttext /> +<startouttext /><parse>&EXT('resource.0.text5')</parse><endouttext /> </foil> <foil location="$position[6]" value="$value[6]" name="optionfoil6"> -<startouttext />&EXT('resource.0.text6')<endouttext /> +<startouttext /><parse>&EXT('resource.0.text6')</parse><endouttext /> </foil> <foil location="$position[7]" value="$value[7]" name="optionfoil7"> -<startouttext />&EXT('resource.0.text7')<endouttext /> +<startouttext /><parse>&EXT('resource.0.text7')</parse><endouttext /> </foil> <foil location="$position[8]" value="$value[8]" name="optionfoil8"> -<startouttext />&EXT('resource.0.text8')<endouttext /> +<startouttext /><parse>&EXT('resource.0.text8')</parse><endouttext /> </foil> <foil location="$position[9]" value="$value[9]" name="optionfoil9"> -<startouttext />&EXT('resource.0.text9')<endouttext /> +<startouttext /><parse>&EXT('resource.0.text9')</parse><endouttext /> </foil> <foil location="$position[10]" value="$value[10]" name="optionfoil10"> -<startouttext />&EXT('resource.0.text10')<endouttext /> +<startouttext /><parse>&EXT('resource.0.text10')</parse><endouttext /> </foil> </foilgroup> <hintgroup> -<startouttext />&EXT('resource.0.hinttext')<endouttext /> +<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"> -<stringresponse id="stringsegment" answer="$stringanswer" type="$stringtype"> +<startouttext /><parse>&EXT('resource.0.questiontext')</parse><br /><endouttext /> +<stringresponse answer="$stringanswer" id="stringsegment" type="$stringtype"> <textline> </textline> <hintgroup> -<startouttext />&EXT('resource.0.hinttext')<endouttext /> +<startouttext /><parse>&EXT('resource.0.hinttext')</parse><endouttext /> </hintgroup> </stringresponse> </part> -</block> +<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> + +