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

Jay Sullivan lon-capa-users@mail.lon-capa.org
Fri, 22 Jun 2007 16:55:24 -0400


------=_Part_15902_26165747.1182545724226
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

Hi Guy,

No, the first example does _not_ work (nor does the 2nd one obviously). I
get the tell-tell "Computer's answer is incorrect ("T1-T2")"
Also, entering T1 - T2 in the submission box returns a "Unable to understand
formula"

VCU is running 2.3.0



Both versions work as expected on the educog server.

Best,
Jay


On 6/22/07, Guy Albertelli II <guy@albertelli.com> wrote:
>
> Hi Jay,
>
> > Ok, then this should work for us when the VCU server gets updated.
>
> The first example below should work on any lon-capa server, does it
> not on yours?
>
>
> >
> > 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="loncapa/perl">
> > > $k=&random(3,6,1);
> > > $formula="a*x^$k";
> > > $m=$k-1;
> > > $derivative="T1-T2";
> > >      </script>
> > >
> > >      <startouttext />
> > > What is the derivative of <tt>$formula</tt> with respect to x?
> > >      <endouttext />
> > >
> > >      <formularesponse samples="T1,T2@-3,-3:3,3#4"
> answer="$derivative">
> > >          <responseparam description="Numerical Tolerance"
> > > type="tolerance" default="0.00001" name="tol" />
> > >          <textline size="25" />
> > >      </formularesponse>
> > >
> > > </problem>
> > >
> > > <problem>
> > >      <script type="loncapa/perl">
> > > $k=&random(3,6,1);
> > > $formula="a*x^$k";
> > > $m=$k-1;
> > > $derivative="T1-T2";
> > >      </script>
> > >
> > >      <startouttext />
> > > What is the derivative of <tt>$formula</tt> with respect to x?
> > >      <endouttext />
> > >
> > >      <formularesponse answer="$derivative">
> > >          <textline size="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
> their
> > > > answer.
> > > > It seems for now that formula response can't handle variable names
> that
> > > > contain numbers.
> > > >
> > > > Jay
> > > >
> > > >
> > >
> > > --
> > > Peter Riegler
> > > Fachhochschule Braunschweig/Wolfenb?ttel
> > > Salzdahlumer Str. 46/48, 38302 Wolfenb?ttel
> > > 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
> > >
>
> --
> guy@albertelli.com   0-7-0-9-27,137
> _______________________________________________
> LON-CAPA-users mailing list
> LON-CAPA-users@mail.lon-capa.org
> http://mail.lon-capa.org/mailman/listinfo/lon-capa-users
>

------=_Part_15902_26165747.1182545724226
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

Hi Guy,<br><br>No, the first example does _not_ work (nor does the 2nd one obviously). I get the tell-tell &quot;Computer&#39;s answer is incorrect (&quot;T1-T2&quot;)&quot;<br>Also, entering T1 - T2 in the submission box returns a &quot;Unable to understand formula&quot;
<br><br>VCU is running 2.3.0<br><br><br><br>Both versions work as expected on the educog server.<br><br>Best,<br>Jay<br><br><br><div><span class="gmail_quote">On 6/22/07, <b class="gmail_sendername">Guy Albertelli II</b> &lt;
<a href="mailto:guy@albertelli.com">guy@albertelli.com</a>&gt; wrote:</span><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">Hi Jay,<br><br>&gt; Ok, then this should work for us when the VCU server gets updated.
<br><br>The first example below should work on any lon-capa server, does it<br>not on yours?<br><br><br>&gt;<br>&gt; Thanks<br>&gt; Jay<br>&gt;<br>&gt; On 6/21/07, Peter Riegler &lt;<a href="mailto:p.riegler@fh-wolfenbuettel.de">
p.riegler@fh-wolfenbuettel.de</a>&gt; wrote:<br>&gt; &gt;<br>&gt; &gt; Hi Jay,<br>&gt; &gt;<br>&gt; &gt; both flavors of formula response seem to work on my machine (running<br>&gt; &gt; 2.4.1), see below. The problems by themselves are meaningless. I have
<br>&gt; &gt; used the templates and made T1-T2 the correct answer.<br>&gt; &gt;<br>&gt; &gt; Hope that helps<br>&gt; &gt;<br>&gt; &gt; Peter<br>&gt; &gt;<br>&gt; &gt; &lt;problem&gt;<br>&gt; &gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;script type=&quot;loncapa/perl&quot;&gt;
<br>&gt; &gt; $k=&amp;random(3,6,1);<br>&gt; &gt; $formula=&quot;a*x^$k&quot;;<br>&gt; &gt; $m=$k-1;<br>&gt; &gt; $derivative=&quot;T1-T2&quot;;<br>&gt; &gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;/script&gt;<br>&gt; &gt;<br>&gt; &gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;startouttext /&gt;
<br>&gt; &gt; What is the derivative of &lt;tt&gt;$formula&lt;/tt&gt; with respect to x?<br>&gt; &gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;endouttext /&gt;<br>&gt; &gt;<br>&gt; &gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;formularesponse samples=&quot;T1,T2@-3,-3:3,3#4&quot; answer=&quot;$derivative&quot;&gt;
<br>&gt; &gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;responseparam description=&quot;Numerical Tolerance&quot;<br>&gt; &gt; type=&quot;tolerance&quot; default=&quot;0.00001&quot; name=&quot;tol&quot; /&gt;<br>&gt; &gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;textline size=&quot;25&quot; /&gt;
<br>&gt; &gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;/formularesponse&gt;<br>&gt; &gt;<br>&gt; &gt; &lt;/problem&gt;<br>&gt; &gt;<br>&gt; &gt; &lt;problem&gt;<br>&gt; &gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;script type=&quot;loncapa/perl&quot;&gt;<br>&gt; &gt; $k=&amp;random(3,6,1);
<br>&gt; &gt; $formula=&quot;a*x^$k&quot;;<br>&gt; &gt; $m=$k-1;<br>&gt; &gt; $derivative=&quot;T1-T2&quot;;<br>&gt; &gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;/script&gt;<br>&gt; &gt;<br>&gt; &gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;startouttext /&gt;<br>&gt; &gt; What is the derivative of &lt;tt&gt;$formula&lt;/tt&gt; with respect to x?
<br>&gt; &gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;endouttext /&gt;<br>&gt; &gt;<br>&gt; &gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;formularesponse answer=&quot;$derivative&quot;&gt;<br>&gt; &gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;textline size=&quot;25&quot; /&gt;<br>&gt; &gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;/formularesponse&gt;
<br>&gt; &gt;<br>&gt; &gt; &lt;/problem&gt;<br>&gt; &gt;<br>&gt; &gt;<br>&gt; &gt; Jay Sullivan wrote:<br>&gt; &gt;<br>&gt; &gt; &gt; Is is possible to do formula response with more complicated variables?<br>&gt; &gt; &gt;
<br>&gt; &gt; &gt; For example, let&#39;s suppose the students should enter &quot;T1 - T2&quot; for their<br>&gt; &gt; &gt; answer.<br>&gt; &gt; &gt; It seems for now that formula response can&#39;t handle variable names that
<br>&gt; &gt; &gt; contain numbers.<br>&gt; &gt; &gt;<br>&gt; &gt; &gt; Jay<br>&gt; &gt; &gt;<br>&gt; &gt; &gt;<br>&gt; &gt;<br>&gt; &gt; --<br>&gt; &gt; Peter Riegler<br>&gt; &gt; Fachhochschule Braunschweig/Wolfenb?ttel
<br>&gt; &gt; Salzdahlumer Str. 46/48, 38302 Wolfenb?ttel<br>&gt; &gt; Tel. +49 5331 939 6314, Fax. +49 5331 939 6002<br>&gt; &gt; email: <a href="mailto:p.riegler@fh-wolfenbuettel.de">p.riegler@fh-wolfenbuettel.de</a><br>
&gt; &gt; <a href="http://public.rz.fh-wolfenbuettel.de/~riegler">http://public.rz.fh-wolfenbuettel.de/~riegler</a><br>&gt; &gt; _______________________________________________<br>&gt; &gt; LON-CAPA-users mailing list<br>
&gt; &gt; <a href="mailto:LON-CAPA-users@mail.lon-capa.org">LON-CAPA-users@mail.lon-capa.org</a><br>&gt; &gt; <a href="http://mail.lon-capa.org/mailman/listinfo/lon-capa-users">http://mail.lon-capa.org/mailman/listinfo/lon-capa-users
</a><br>&gt; &gt;<br><br>--<br><a href="mailto:guy@albertelli.com">guy@albertelli.com</a>&nbsp;&nbsp; 0-7-0-9-27,137<br>_______________________________________________<br>LON-CAPA-users mailing list<br><a href="mailto:LON-CAPA-users@mail.lon-capa.org">
LON-CAPA-users@mail.lon-capa.org</a><br><a href="http://mail.lon-capa.org/mailman/listinfo/lon-capa-users">http://mail.lon-capa.org/mailman/listinfo/lon-capa-users</a><br></blockquote></div><br>

------=_Part_15902_26165747.1182545724226--