File:  [LON-CAPA] / loncom / homework / templates / SimpleFormula.problem
Revision 1.2: download - view: text, annotated - select for diffs
Tue Jul 29 00:51:17 2003 UTC (20 years, 11 months ago) by albertel
Branches: MAIN
CVS tags: version_1_1_X, version_1_1_99_0, version_1_1_3, version_1_1_2, version_1_1_1, version_1_1_0, version_1_0_99_3, version_1_0_99_2, version_1_0_99_1, version_1_0_99, version_1_0_3, version_1_0_2, version_1_0_1, version_1_0_0, version_0_99_5, version_0_99_4, HEAD
- updates to the templates from felicia

    1: <problem>
    2: <script type="loncapa/perl">$z=&random(1,10,1);
    3: $constant=&random(1,10,1);
    4: # y=x+z-constant, solving for x, x=y-z+constant, prettyconstant is for simplifying
    5: $prettyconstant=$constant-$z;
    6: $x="y+$prettyconstant";
    7: # code below substitutes '+-' and '-+' for '-'.  This is used in display of answer
    8: $x=~s/\+-/-/g;
    9: $x=~s/-\+/-/g;</script>
   10: 
   11: <startouttext />If z=$z and y=x+z-$constant, what does x equal?  
   12: <endouttext />
   13: 
   14: <formularesponse id="11" samples="y@-5:5#10" answer="$x">
   15:     <responseparam decription="Numerical Tolerance" type="tolerance" default="0.00001" name="tol" />
   16:     <textline size="25" />    
   17: </formularesponse>
   18: 
   19: </problem>
   20: 

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