File:
[LON-CAPA] /
loncom /
homework /
templates /
functionplotback.problem
Revision
1.2:
download - view:
text,
annotated -
select for diffs
Wed Nov 24 02:53:18 2010 UTC (14 years, 1 month 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,
loncapaMITrelate_1,
loncapaMITrelate,
language_hyphenation_merge,
language_hyphenation,
HEAD,
BZ4492-merge,
BZ4492-feature_horizontal_radioresponse,
BZ4492-feature_Support_horizontal_radioresponse,
BZ4492-Support_horizontal_radioresponse
Show answer functionality
<problem>
<script type="loncapa/perl">$x=&random(-5,5,2);
$y=&random(-3,3,2);
$a=&random(0.5,0.9,0.1);
if (&random(0,1,1)) {
$function="$a*(x-($x))^2+($y)";
$answer="2*$a*(x-($x))";
$relation='gt';
} else {
$function="-$a*(x-($x))^2+($y)";
$answer="-2*$a*(x-($x))";
$relation='lt';
}</script>
<startouttext />
Provide a sketch of the derivative of the indicated function<br /> <endouttext />
<functionplotresponse xaxisvisible="yes" xlabel="x" gridvisible="yes" ylabel="y(x)" id="11" xmax="10" yaxisvisible="yes" xmin="-10" ymin="-10" ymax="10" answerdisplay="$answer">
<functionplotelements>
<spline initx="-4" inity="0" index="A" order="3" scalex="8" />
<backgroundplot function="$function" fixed="yes" />
</functionplotelements>
<functionplotruleset>
<functionplotrule relationship="eq" xinitial="$x" value="0" derivativeorder="0" percenterror="2" index="extreme" />
<functionplotrule relationship="$relation" xinitiallabel="start" xfinallabel="end" value="0" derivativeorder="1" percenterror="10" index="slope" />
<functionplotrule relationship="eq" xinitiallabel="start" xfinallabel="end" value="0" derivativeorder="2" percenterror="50" index="linear" />
</functionplotruleset>
</functionplotresponse>
</problem>
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>