Diff for /loncom/homework/templates/SimpleFormula.problem between versions 1.4 and 1.7

version 1.4, 2004/08/19 20:29:22 version 1.7, 2009/07/06 17:12:47
Line 1 Line 1
 <problem>  <problem>
 <script type="loncapa/perl">$z=&random(1,10,1);  
 $constant=&random(1,10,1);  <script type="loncapa/perl">
 # y=x+z-constant, solving for x, x=y-z+constant, prettyconstant is for simplifying  $k=&random(3,6,1);
 $prettyconstant=$constant-$z;  $formula="a*x^$k";
 $x="y+$prettyconstant";  $m=$k-1;
 # code below substitutes '+-' and '-+' for '-'.  This is used in display of answer  $derivative="$k*a*x^$m";
 $x=~s/\+-/-/g;  </script>
 $x=~s/-\+/-/g;</script>  
   <startouttext />
 <startouttext />If z=$z and y=x+z-$constant, what does x equal?    What is the derivative of <tt>$formula</tt> with respect to x?
 <endouttext />  <endouttext />
   
 <formularesponse samples="y@-5:5#10" answer="$x">  <formularesponse samples="a,x@-3,-3:3,3#4" answer="$derivative">
     <responseparam description="Numerical Tolerance" type="tolerance" default="0.00001" name="tol" />      <responseparam description="Numerical Tolerance" type="tolerance" default="0.00001" name="tol" />
     <textline size="25" />          <textline size="25" />    
 </formularesponse>  </formularesponse>
   
 </problem>  </problem>
   

Removed from v.1.4  
changed lines
  Added in v.1.7


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