File:
[LON-CAPA] /
loncom /
homework /
templates /
customunit.problem
Revision
1.1:
download - view:
text,
annotated -
select for diffs
Thu Jun 9 15:43:58 2011 UTC (13 years, 8 months ago) by
www
Branches:
MAIN
CVS tags:
version_2_12_X,
version_2_11_X,
version_2_11_6_msu,
version_2_11_6,
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,
version_2_10_X,
version_2_10_1,
loncapaMITrelate_1,
language_hyphenation_merge,
language_hyphenation,
HEAD,
BZ4492-merge,
BZ4492-feature_horizontal_radioresponse,
BZ4492-feature_Support_horizontal_radioresponse,
BZ4492-Support_horizontal_radioresponse
Bug #53: custom units now possible, new parameter "customunits"
Format: unita=unitb,unitc=4*unitb,...
1: <problem>
2:
3: <script type="loncapa/perl">
4: $pecks=&random(3,5,1);
5: $bushels=&random(2,6,1);
6: $total=4.4*(8*$bushels+2*$pecks);
7: </script>
8:
9: <startouttext />
10: You go to the market and buy $pecks peck of apples and $bushels bushel of potatoes. How much produce did you buy? Note that these are dry goods.
11: <endouttext />
12:
13: <numericalresponse answer="$total" unit="L" format="3s">
14: <responseparam type="tolerance" default="5%" name="tol" description="Numerical Tolerance" />
15: <responseparam name="customunits" type="string_any" description="Custom-defined Units" default="peck=2*gallon,bushel=8*gallon,gallon=4.4*L" />
16: <textline readonly="no" />
17: </numericalresponse>
18:
19: </problem>
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>