File:
[LON-CAPA] /
loncom /
homework /
simpleproblem.problem
Revision
1.11:
download - view:
text,
annotated -
select for diffs
Mon Aug 17 19:46:49 2009 UTC (15 years, 1 month ago) by
www
Branches:
MAIN
CVS tags:
version_2_9_99_0,
version_2_10_0_RC2,
version_2_10_0_RC1,
bz6209-base,
bz6209,
PRINT_INCOMPLETE_base,
PRINT_INCOMPLETE,
HEAD,
GCI_3
Bug #2579: Simple numerical problem
1: <problem>
2: <simpleeditbutton />
3: <script type="loncapa/perl">
4: $questiontype=&EXT('resource.0.hiddenparts');
5: $max=&EXT('resource.0.maxfoils');
6: unless ($max) { $max=10; }
7: $randomize=&EXT('resource.0.randomize');
8: unless ($randomize) { $randomize='yes'; }
9: $options=&EXT('resource.0.options');
10: unless ($options) { $options='("true","false")'; }
11: for ($i=1;$i<=10;$i++) {
12: $value[$i]=&EXT('resource.0.value'.$i);
13: unless ($value[$i]) { $value[$i]='unused'; }
14: $position[$i]=&EXT('resource.0.position'.$i);
15: unless ($position[$i]) { $position[$i]='random'; }
16: }
17: $stringanswer=&EXT('resource.0.stringanswer');
18: unless ($stringanswer) { $stringanswer=''; }
19: $stringtype=&EXT('resource.0.stringtype');
20: unless ($stringtype) { $stringtype='cs'; }
21: $numericalanswer=&EXT('resource.0.numericalanswer');
22: unless ($numericalanswer) { $numericalanswer=''; }
23: $numericaltolerance=&EXT('resource.0.numericaltolerance');
24: unless ($numericaltolerance) { $numericaltolerance='5%'; }
25: $numericalsigfigs=&EXT('resource.0.numericalsigfigs');
26: unless ($numericalsigfigs) { $numericalsigfigs='1,15'; }
27: $numericalunit=&EXT('resource.0.numericalunit');
28: unless ($numericalunit) { $numericalunit=''; }
29: $numericalformat=&EXT('resource.0.numericalformat');
30: unless ($numericalformat) { $numericalformat=''; }
31: $numericalscript=&EXT('resource.0.numericalscript');
32: unless ($numericalscript) { $numericalscript=''; }
33: </script>
34:
35: <block condition="!$questiontype">
36:
37: <startouttext />
38: <h1>Simple Problem Placeholder</h1>
39: <endouttext />
40: </block>
41:
42: <block condition="$questiontype">
43:
44: <part id="radio">
45: <startouttext /><parse>&EXT('resource.0.questiontext')</parse><br /><endouttext />
46:
47: <radiobuttonresponse max="$max" id="radiosegment" randomize="$randomize">
48: <foilgroup>
49: <foil location="$position[1]" value="$value[1]" name="radiofoil1">
50: <startouttext /><parse>&EXT('resource.0.text1')</parse><endouttext />
51: </foil>
52: <foil location="$position[2]" value="$value[2]" name="radiofoil2">
53: <startouttext /><parse>&EXT('resource.0.text2')</parse><endouttext />
54: </foil>
55: <foil location="$position[3]" value="$value[3]" name="radiofoil3">
56: <startouttext /><parse>&EXT('resource.0.text3')</parse><endouttext />
57: </foil>
58: <foil location="$position[4]" value="$value[4]" name="radiofoil4">
59: <startouttext /><parse>&EXT('resource.0.text4')</parse><endouttext />
60: </foil>
61: <foil location="$position[5]" value="$value[5]" name="radiofoil5">
62: <startouttext /><parse>&EXT('resource.0.text5')</parse><endouttext />
63: </foil>
64: <foil location="$position[6]" value="$value[6]" name="radiofoil6">
65: <startouttext /><parse>&EXT('resource.0.text6')</parse><endouttext />
66: </foil>
67: <foil location="$position[7]" value="$value[7]" name="radiofoil7">
68: <startouttext /><parse>&EXT('resource.0.text7')</parse><endouttext />
69: </foil>
70: <foil location="$position[8]" value="$value[8]" name="radiofoil8">
71: <startouttext /><parse>&EXT('resource.0.text8')</parse><endouttext />
72: </foil>
73: <foil location="$position[9]" value="$value[9]" name="radiofoil9">
74: <startouttext /><parse>&EXT('resource.0.text9')</parse><endouttext />
75: </foil>
76: <foil location="$position[10]" value="$value[10]" name="radiofoil10">
77: <startouttext /><parse>&EXT('resource.0.text10')</parse><endouttext />
78: </foil>
79: </foilgroup>
80: <hintgroup>
81: <startouttext /><parse>&EXT('resource.0.hinttext')</parse><endouttext />
82: </hintgroup>
83: </radiobuttonresponse>
84: </part>
85:
86: <part id="option">
87: <startouttext /><parse>&EXT('resource.0.questiontext')</parse><br /><endouttext />
88: <optionresponse max="$max" id="optionsegment" randomize="$randomize">
89: <foilgroup options="$options">
90: <foil location="$position[1]" value="$value[1]" name="optionfoil1">
91: <startouttext /><parse>&EXT('resource.0.text1')</parse><endouttext />
92: </foil>
93: <foil location="$position[2]" value="$value[2]" name="optionfoil2">
94: <startouttext /><parse>&EXT('resource.0.text2')</parse><endouttext />
95: </foil>
96: <foil location="$position[3]" value="$value[3]" name="optionfoil3">
97: <startouttext /><parse>&EXT('resource.0.text3')</parse><endouttext />
98: </foil>
99: <foil location="$position[4]" value="$value[4]" name="optionfoil4">
100: <startouttext /><parse>&EXT('resource.0.text4')</parse><endouttext />
101: </foil>
102: <foil location="$position[5]" value="$value[5]" name="optionfoil5">
103: <startouttext /><parse>&EXT('resource.0.text5')</parse><endouttext />
104: </foil>
105: <foil location="$position[6]" value="$value[6]" name="optionfoil6">
106: <startouttext /><parse>&EXT('resource.0.text6')</parse><endouttext />
107: </foil>
108: <foil location="$position[7]" value="$value[7]" name="optionfoil7">
109: <startouttext /><parse>&EXT('resource.0.text7')</parse><endouttext />
110: </foil>
111: <foil location="$position[8]" value="$value[8]" name="optionfoil8">
112: <startouttext /><parse>&EXT('resource.0.text8')</parse><endouttext />
113: </foil>
114: <foil location="$position[9]" value="$value[9]" name="optionfoil9">
115: <startouttext /><parse>&EXT('resource.0.text9')</parse><endouttext />
116: </foil>
117: <foil location="$position[10]" value="$value[10]" name="optionfoil10">
118: <startouttext /><parse>&EXT('resource.0.text10')</parse><endouttext />
119: </foil>
120: </foilgroup>
121: <hintgroup>
122: <startouttext /><parse>&EXT('resource.0.hinttext')</parse><endouttext />
123: </hintgroup>
124: </optionresponse>
125: </part>
126:
127: <part id="essay">
128: <startouttext /><parse>&EXT('resource.0.questiontext')</parse><br /><endouttext />
129: <essayresponse id="essaysegment">
130: <textfield></textfield>
131: </essayresponse>
132: </part>
133:
134: <part id="string">
135: <startouttext /><parse>&EXT('resource.0.questiontext')</parse><br /><endouttext />
136: <stringresponse id="stringsegment" answer="$stringanswer" type="$stringtype">
137: <textline>
138: </textline>
139: <hintgroup>
140: <startouttext /><parse>&EXT('resource.0.hinttext')</parse><endouttext />
141: </hintgroup>
142: </stringresponse>
143: </part>
144:
145: <part id="numerical">
146: <script type="loncapa/perl">
147: $tag='script';
148: &xmlparse("<$tag type='loncapa/perl'>$numericalscript</$tag>");
149: </script>
150: <startouttext /><parse>&EXT('resource.0.questiontext')</parse><br /><endouttext />
151: <numericalresponse id="numericalsegment" answer="$numericalanswer" unit="$numericalunit" format="$numericalformat">
152: <responseparam type="tolerance" default="$numericaltolerance" name="tol" description="Numerical Tolerance" />
153: <responseparam name="sig" type="int_range,0-16" default="$numericalsigfigs" description="Significant Figures" />
154: <textline>
155: </textline>
156: <hintgroup>
157: <startouttext /><parse>&EXT('resource.0.hinttext')</parse><endouttext />
158: </hintgroup>
159: </numericalresponse>
160: </part>
161:
162: </block>
163:
164: </problem>
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>