[LON-CAPA-users] Formula response

lon-capa-users@mail.lon-capa.org lon-capa-users@mail.lon-capa.org
Thu, 21 Aug 2008 20:40:30 -0400


<font size=3D"3">I am trying to code some formularesponse problems, and hav=
e run into a difficulty. I am hoping someone knows a trick to make this wor=
k.<br><br>I want the student to be able to input either of the following re=
sponses:<br><br>G*m*M/R^2&nbsp;&nbsp;&nbsp; or<br><br>6.67e-11*m*M/R^2<br><=
br>Normally, I have been making this work by something like<br><br>&lt;form=
ularesponse answer=3D"(G * m * M) / R^2" samples=3D"G,m,M,R@6.67e-11,1,1,1:=
</font><font size=3D"3">6.67e-11</font><font size=3D"3">,100,100,100#8"&gt;=
<br>&nbsp;&nbsp;&nbsp; &lt;textline readonly=3D"no" size=3D"25" /&gt;<br> &=
lt;/formularesponse&gt;<br><br><br>The problem: the LonCapa Samples logic d=
oesn't seem to recognize the exponential notation. I get an error that the =
computer's answer is wrong.<br><br>If I do the same problem, but coded 6.67=
 (instead of 6.67e-11), it works fine (other than being off by 11 orders of=
 magnitude!). So, how do I get this notation to work?<br><br>It also appear=
s that the input textline does not allow exponentials. Coding the following=
<br><br></font><font size=3D"3">&lt;formularesponse answer=3D"(G * m * M) /=
 R^2" samples=3D"G,m,M,R@0.0000000000667,1,1,1:0</font><font size=3D"3">.00=
00000000667</font><font size=3D"3">,100,100,100#8"&gt;<br>&nbsp;&nbsp;&nbsp=
; &lt;textline readonly=3D"no" size=3D"25" /&gt;<br> &lt;/formularesponse&g=
t;<br><br>avoids the "computer answer is wrong" error. But, </font>entering=
 <br><br>6.67e-11 *m*M/R^2 <br><br>does not work. I assume the problem is t=
hat it thinks the "e" is a variable...<br><br>A lot of these problems have =
things like Earth's mass, where the exponential notation is really necessar=
y.<br><br>Any thoughts?<br><br><br>Thanks,<br>brew<br><BR>