[LON-CAPA-cvs] cvs: loncom /homework/templates SimpleMathResponse.problem SimpleMathResponse.problem.meta doc/loncapafiles loncapafiles.lpml
www
lon-capa-cvs-allow@mail.lon-capa.org
Mon, 19 May 2008 21:19:19 -0000
www Mon May 19 17:19:19 2008 EDT
Added files:
/loncom/homework/templates SimpleMathResponse.problem
SimpleMathResponse.problem.meta
Modified files:
/doc/loncapafiles loncapafiles.lpml
Log:
Bug #5369: simpler template for mathresponse
Index: doc/loncapafiles/loncapafiles.lpml
diff -u doc/loncapafiles/loncapafiles.lpml:1.584 doc/loncapafiles/loncapafiles.lpml:1.585
--- doc/loncapafiles/loncapafiles.lpml:1.584 Mon May 19 14:00:58 2008
+++ doc/loncapafiles/loncapafiles.lpml Mon May 19 17:19:16 2008
@@ -2,7 +2,7 @@
"http://lpml.sourceforge.net/DTD/lpml.dtd">
<!-- loncapafiles.lpml -->
-<!-- $Id: loncapafiles.lpml,v 1.584 2008/05/19 18:00:58 raeburn Exp $ -->
+<!-- $Id: loncapafiles.lpml,v 1.585 2008/05/19 21:19:16 www Exp $ -->
<!--
@@ -1227,6 +1227,8 @@
StringResponse.problem.meta;
SimpleMatching.problem;
SimpleMatching.problem.meta;
+SimpleMathResponse.problem;
+SimpleMathResponse.problem.meta;
SimpleRank.problem;
SimpleRank.problem.meta;
SimpleTrueFalse.problem;
Index: loncom/homework/templates/SimpleMathResponse.problem
+++ loncom/homework/templates/SimpleMathResponse.problem
<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>
Index: loncom/homework/templates/SimpleMathResponse.problem.meta
+++ loncom/homework/templates/SimpleMathResponse.problem.meta
<title>Math Response using Computer Algebra System</title>
<category>Algebraic Response Problems</category>
<help>Math_Response_Problems</help>