# [LON-CAPA-users] formula response or maxima response example requested

Peter Riegler lon-capa-users@mail.lon-capa.org
Thu, 29 Nov 2007 21:15:31 +0100

```Hi,

if \$function contains the correct answer the following shall do it:

<mathresponse answerdisplay="\$function" cas="maxima" args="\$function">

resp(x):=RESPONSE;
ans(x):=LONCAPALIST;
is_expanded : is(resp(x)=expand(resp(x)));
is_y_intersect_correct : is(resp(0)=ans(0));
is_correct : is(resp(x)=expand(ans(x)));
is_expanded and is_y_intersect_correct and is_correct;

If \$function is in expanded form then is_expanded is redundant.

Peter

Jay Sullivan wrote:

> Hi Folks,
>
> I'm looking for an example of a specific type of formula response (or
> maxima graded response).
>
> What I would like a student to do is to enter a polynomial function.
> However, I want to be sure that they have entered it in expanded form (
> i.e. _not_ as a product of factors). I know that formula response will
> accept either as correct since the test function matches the input
> function in either case.
>
> Here is a specific example, to clarify:
>
> Find a polynomial of least degree having only real coefficients, with
> *zeros -3,-2,-1,1,2,3* and with *f(0) = -36*.
>
> Using a loncapa formula response either of the answers below are graded
> as correct:
>
> (x+3)(x+2)(x-1)(x-2)(x-3)   OR   x^6 -14*x^4 +49*x^2 -36
>
> I would like to be able to require that students explicitly enter the
> second version. I'm guessing there is a way to
> do this with maxima? I'd rather not use a string response.
>
> Thanks for any tips or related examples......
> 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

```