File:  [LON-CAPA] / loncom / homework / templates / SimpleMathResponse.problem
Revision 1.1: download - view: text, annotated - select for diffs
Mon May 19 21:19:19 2008 UTC (16 years ago) by www
Branches: MAIN
CVS tags: version_2_7_0, version_2_6_99_1, version_2_6_99_0, HEAD
Bug #5369: simpler template for mathresponse

<problem>
<script type="loncapa/perl">
$x = &random(-1,1,2) * &random(1,5,1);
$y = &random(-1,1,2) * &random(1,3,1);
@args = ($x, $y);
$yaa = $y-3*$x;
if ($yaa > 0) {
  $yaa = "+" . $yaa;
} elsif ($yaa == 0) {
  $yaa = "";
}
$example = "3x$yaa is an example for a function having constant slope which passes through the point ($x | $y). The slope is not given explicitely, so there are different possibilities for this function.";
</script>

<startouttext />
State a function y(x) with constant slope which passes through the point ($x | $y).<br />
<br />
y(x) =
<endouttext />

<mathresponse answerdisplay="$example" cas="maxima" args="@args">

<answer>
y(x):=RESPONSE[1];
hitspoint:is(abs(y(LONCAPALIST[1]) - LONCAPALIST[2]) <= 0.000000001);
islinear:is(diff(y(x),x,2) = 0);
hitspoint and islinear;
</answer>

<textline readonly="no" size="50" />
</mathresponse>

</problem>


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