[LON-CAPA-users] formula response with more complex variable labels

Jay Sullivan lon-capa-users@mail.lon-capa.org
Thu, 21 Jun 2007 12:54:23 -0400


------=_Part_14194_31714423.1182444863967
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: quoted-printable
Content-Disposition: inline

Ok, then this should work for us when the VCU server gets updated.

Thanks
Jay

On 6/21/07, Peter Riegler <p.riegler@fh-wolfenbuettel.de> wrote:
>
> Hi Jay,
>
> both flavors of formula response seem to work on my machine (running
> 2.4.1), see below. The problems by themselves are meaningless. I have
> used the templates and made T1-T2 the correct answer.
>
> Hope that helps
>
> Peter
>
> <problem>
>      <script type=3D"loncapa/perl">
> $k=3D&random(3,6,1);
> $formula=3D"a*x^$k";
> $m=3D$k-1;
> $derivative=3D"T1-T2";
>      </script>
>
>      <startouttext />
> What is the derivative of <tt>$formula</tt> with respect to x?
>      <endouttext />
>
>      <formularesponse samples=3D"T1,T2@-3,-3:3,3#4" answer=3D"$derivative=
">
>          <responseparam description=3D"Numerical Tolerance"
> type=3D"tolerance" default=3D"0.00001" name=3D"tol" />
>          <textline size=3D"25" />
>      </formularesponse>
>
> </problem>
>
> <problem>
>      <script type=3D"loncapa/perl">
> $k=3D&random(3,6,1);
> $formula=3D"a*x^$k";
> $m=3D$k-1;
> $derivative=3D"T1-T2";
>      </script>
>
>      <startouttext />
> What is the derivative of <tt>$formula</tt> with respect to x?
>      <endouttext />
>
>      <formularesponse answer=3D"$derivative">
>          <textline size=3D"25" />
>      </formularesponse>
>
> </problem>
>
>
> Jay Sullivan wrote:
>
> > Is is possible to do formula response with more complicated variables?
> >
> > For example, let's suppose the students should enter "T1 - T2" for thei=
r
> > answer.
> > It seems for now that formula response can't handle variable names that
> > contain numbers.
> >
> > Jay
> >
> >
>
> --
> Peter Riegler
> Fachhochschule Braunschweig/Wolfenb=FCttel
> Salzdahlumer Str. 46/48, 38302 Wolfenb=FCttel
> Tel. +49 5331 939 6314, Fax. +49 5331 939 6002
> email: p.riegler@fh-wolfenbuettel.de
> http://public.rz.fh-wolfenbuettel.de/~riegler
> _______________________________________________
> LON-CAPA-users mailing list
> LON-CAPA-users@mail.lon-capa.org
> http://mail.lon-capa.org/mailman/listinfo/lon-capa-users
>

------=_Part_14194_31714423.1182444863967
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable
Content-Disposition: inline

Ok, then this should work for us when the VCU server gets updated.<br><br>T=
hanks<br>Jay<br><br><div><span class=3D"gmail_quote">On 6/21/07, <b class=
=3D"gmail_sendername">Peter Riegler</b> &lt;<a href=3D"mailto:p.riegler@fh-=
wolfenbuettel.de">
p.riegler@fh-wolfenbuettel.de</a>&gt; wrote:</span><blockquote class=3D"gma=
il_quote" style=3D"border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0=
pt 0pt 0.8ex; padding-left: 1ex;">Hi Jay,<br><br>both flavors of formula re=
sponse seem to work on my machine (running
<br>2.4.1), see below. The problems by themselves are meaningless. I have<b=
r>used the templates and made T1-T2 the correct answer.<br><br>Hope that he=
lps<br><br>Peter<br><br>&lt;problem&gt;<br>&nbsp;&nbsp;&nbsp;&nbsp; &lt;scr=
ipt type=3D&quot;loncapa/perl&quot;&gt;
<br>$k=3D&amp;random(3,6,1);<br>$formula=3D&quot;a*x^$k&quot;;<br>$m=3D$k-1=
;<br>$derivative=3D&quot;T1-T2&quot;;<br>&nbsp;&nbsp;&nbsp;&nbsp; &lt;/scri=
pt&gt;<br><br>&nbsp;&nbsp;&nbsp;&nbsp; &lt;startouttext /&gt;<br>What is th=
e derivative of &lt;tt&gt;$formula&lt;/tt&gt; with respect to x?
<br>&nbsp;&nbsp;&nbsp;&nbsp; &lt;endouttext /&gt;<br><br>&nbsp;&nbsp;&nbsp;=
&nbsp; &lt;formularesponse samples=3D&quot;T1,T2@-3,-3:3,3#4&quot; answer=
=3D&quot;$derivative&quot;&gt;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp=
;&nbsp; &lt;responseparam description=3D&quot;Numerical Tolerance&quot;<br>=
type=3D&quot;tolerance&quot; default=3D&quot;
0.00001&quot; name=3D&quot;tol&quot; /&gt;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp=
;&nbsp;&nbsp;&nbsp; &lt;textline size=3D&quot;25&quot; /&gt;<br>&nbsp;&nbsp=
;&nbsp;&nbsp; &lt;/formularesponse&gt;<br><br>&lt;/problem&gt;<br><br>&lt;p=
roblem&gt;<br>&nbsp;&nbsp;&nbsp;&nbsp; &lt;script type=3D&quot;loncapa/perl=
&quot;&gt;
<br>$k=3D&amp;random(3,6,1);<br>$formula=3D&quot;a*x^$k&quot;;<br>$m=3D$k-1=
;<br>$derivative=3D&quot;T1-T2&quot;;<br>&nbsp;&nbsp;&nbsp;&nbsp; &lt;/scri=
pt&gt;<br><br>&nbsp;&nbsp;&nbsp;&nbsp; &lt;startouttext /&gt;<br>What is th=
e derivative of &lt;tt&gt;$formula&lt;/tt&gt; with respect to x?
<br>&nbsp;&nbsp;&nbsp;&nbsp; &lt;endouttext /&gt;<br><br>&nbsp;&nbsp;&nbsp;=
&nbsp; &lt;formularesponse answer=3D&quot;$derivative&quot;&gt;<br>&nbsp;&n=
bsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;textline size=3D&quot;25&quot;=
 /&gt;<br>&nbsp;&nbsp;&nbsp;&nbsp; &lt;/formularesponse&gt;<br><br>&lt;/pro=
blem&gt;<br><br><br>Jay Sullivan wrote:
<br><br>&gt; Is is possible to do formula response with more complicated va=
riables?<br>&gt;<br>&gt; For example, let&#39;s suppose the students should=
 enter &quot;T1 - T2&quot; for their<br>&gt; answer.<br>&gt; It seems for n=
ow that formula response can&#39;t handle variable names that
<br>&gt; contain numbers.<br>&gt;<br>&gt; Jay<br>&gt;<br>&gt;<br><br>--<br>=
Peter Riegler<br>Fachhochschule Braunschweig/Wolfenb=FCttel<br>Salzdahlumer=
 Str. 46/48, 38302 Wolfenb=FCttel<br>Tel. +49 5331 939 6314, Fax. +49 5331 =
939 6002
<br>email: <a href=3D"mailto:p.riegler@fh-wolfenbuettel.de">p.riegler@fh-wo=
lfenbuettel.de</a><br><a href=3D"http://public.rz.fh-wolfenbuettel.de/~rieg=
ler">http://public.rz.fh-wolfenbuettel.de/~riegler</a><br>_________________=
______________________________
<br>LON-CAPA-users mailing list<br><a href=3D"mailto:LON-CAPA-users@mail.lo=
n-capa.org">LON-CAPA-users@mail.lon-capa.org</a><br><a href=3D"http://mail.=
lon-capa.org/mailman/listinfo/lon-capa-users">http://mail.lon-capa.org/mail=
man/listinfo/lon-capa-users
</a><br></blockquote></div><br>

------=_Part_14194_31714423.1182444863967--