Annotation of loncom/homework/templates/functionplotback.problem, revision 1.2
1.1 www 1: <problem>
2: <script type="loncapa/perl">$x=&random(-5,5,2);
3: $y=&random(-3,3,2);
4: $a=&random(0.5,0.9,0.1);
5: if (&random(0,1,1)) {
6: $function="$a*(x-($x))^2+($y)";
1.2 ! www 7: $answer="2*$a*(x-($x))";
1.1 www 8: $relation='gt';
9: } else {
10: $function="-$a*(x-($x))^2+($y)";
1.2 ! www 11: $answer="-2*$a*(x-($x))";
1.1 www 12: $relation='lt';
13: }</script>
14: <startouttext />
15: Provide a sketch of the derivative of the indicated function<br /> <endouttext />
1.2 ! www 16: <functionplotresponse xaxisvisible="yes" xlabel="x" gridvisible="yes" ylabel="y(x)" id="11" xmax="10" yaxisvisible="yes" xmin="-10" ymin="-10" ymax="10" answerdisplay="$answer">
1.1 www 17: <functionplotelements>
18: <spline initx="-4" inity="0" index="A" order="3" scalex="8" />
19: <backgroundplot function="$function" fixed="yes" />
20: </functionplotelements>
21: <functionplotruleset>
22: <functionplotrule relationship="eq" xinitial="$x" value="0" derivativeorder="0" percenterror="2" index="extreme" />
23: <functionplotrule relationship="$relation" xinitiallabel="start" xfinallabel="end" value="0" derivativeorder="1" percenterror="10" index="slope" />
24: <functionplotrule relationship="eq" xinitiallabel="start" xfinallabel="end" value="0" derivativeorder="2" percenterror="50" index="linear" />
25: </functionplotruleset>
26: </functionplotresponse>
27: </problem>
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>