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, 6 months ago) by www
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, 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,...

<problem>

<script type="loncapa/perl">
$pecks=&random(3,5,1);
$bushels=&random(2,6,1);
$total=4.4*(8*$bushels+2*$pecks);
</script>

<startouttext />
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.
<endouttext />

<numericalresponse answer="$total" unit="L" format="3s">
    <responseparam type="tolerance" default="5%" name="tol" description="Numerical Tolerance" />
    <responseparam name="customunits" type="string_any" description="Custom-defined Units" default="peck=2*gallon,bushel=8*gallon,gallon=4.4*L" />
    <textline readonly="no" />
</numericalresponse>

</problem>

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