[LON-CAPA-users] formula response with more complex variable labels
Guy Albertelli II
lon-capa-users@mail.lon-capa.org
Fri, 22 Jun 2007 15:38:04 -0400 (EDT)
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