Annotation of loncom/homework/templates/SimpleMathResponse.problem, revision 1.3

1.1       www         1: <problem>
1.3     ! bisitz      2: 
1.1       www         3: <script type="loncapa/perl">
                      4: $x = &random(-1,1,2) * &random(1,5,1);
                      5: $y = &random(-1,1,2) * &random(1,3,1);
                      6: @args = ($x, $y);
                      7: $yaa = $y-3*$x;
                      8: if ($yaa > 0) {
                      9:   $yaa = "+" . $yaa;
                     10: } elsif ($yaa == 0) {
                     11:   $yaa = "";
                     12: }
1.2       raeburn    13: $example = "3x$yaa is an example for a function having constant slope which passes through the point ($x | $y). The slope is not given explicitly, so there are different possibilities for this function.";
1.1       www        14: </script>
                     15: 
                     16: <startouttext />
                     17: State a function y(x) with constant slope which passes through the point ($x | $y).<br />
                     18: <br />
                     19: y(x) =
                     20: <endouttext />
                     21: 
                     22: <mathresponse answerdisplay="$example" cas="maxima" args="@args">
1.3     ! bisitz     23:     <answer>
1.1       www        24: y(x):=RESPONSE[1];
                     25: hitspoint:is(abs(y(LONCAPALIST[1]) - LONCAPALIST[2]) <= 0.000000001);
                     26: islinear:is(diff(y(x),x,2) = 0);
                     27: hitspoint and islinear;
1.3     ! bisitz     28:     </answer>
        !            29:     <textline readonly="no" size="50" />
1.1       www        30: </mathresponse>
                     31: 
                     32: </problem>

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