[LON-CAPA-users] alternate notation

Peter Riegler lon-capa-users@mail.lon-capa.org
Mon, 19 Oct 2009 06:57:57 +0200

Hi Justin,

we solve this kind of problems by telling maxima how to handle ln. This 
requires the use of mathresponse (formularesponse uses maxima, but does 
not allow you to write maxima code for grading).

You could for instance define ln

<mathresponse answerdisplay="$F" cas="maxima" args="@args" id="11">
   ln(x):= log(x);

or substitute

<mathresponse answerdisplay="$F" cas="maxima" args="@args" id="11">
   is ( subst(log,ln,RESPONSE[1]=LONCAPALIST[1]) );

In both examples $args[0]=LONCAPALIST[1] contains the correct answer.

I hope this will help


Justin Gray wrote:
> I seem to recall that there is a way to specify an alternate notation 
> within the <script> tags of a problem, but cannot recall how to do this. 
> If a student submits an answer using natural logs with the notation ln, 
> how can I replace ln with log in their answer so that Maxima will 
> understand it?
> Thanks,
> Justin
> P.S. I know that I can specify a collection of answers in formula 
> response problems, but I want ln to be treated as log so that equivalent 
> answers will be recognized, such as ln(x^n) and n*ln(x).
> Justin Gray | Senior Lecturer
> Department of Mathematics | Simon Fraser University
> 8888 University Drive, Burnaby | V5A 1S6 | Canada
> Tel: +1 778.782.4237 | Fax: +1 778.782.4947 | Email: jgray@math.sfu.ca 
> <mailto:jgray@math.sfu.ca>

Peter Riegler
Fakultät Informatik
Ostfalia Hochschule für angewandte Wissenschaften
Fachhochschule Braunschweig/Wolfenbüttel
Salzdahlumer Str. 46/48
38302 Wolfenbüttel
Fon: ++49 5331 939 31540