[LON-CAPA-users] maxima variable %
Peter Dencker
dencker at math.uni-luebeck.de
Wed Jun 4 08:20:39 EDT 2014
Hi.
The evaluation of
1+2;storeA:%;1-2;storeB:%;[storeA,storeB];
with maxima (running in a shell on the LON-CAPA server)
gives, as expected, [3,-1]
But using
cas( 'maxima', "1+2;storeA:%;1-2;storeB:%;[storeA,storeB];" );
in LON-CAPA does not work properly.
(I would like to use such structures in a library project.)
In principle the maxima variable % works.
my @CHECK_IN = qw(
1+2;
1+2;%;
1+2;%;%;
1+2;store:%;%;
1+2;store:%;store;
);
my @CHECK_OUT = map { cas( 'maxima', $_ ) } @CHECK_IN;
Alle five entries of @CHECK_OUT should be 3. The first three examples
work properly in LON-CAPA, but the other two don't; both evaluations
seem to yield random integer numbers.
I have a workaround, but using % would be the much better solution.
Any idea?
- Peter
<problem>
<script type="loncapa/perl">
my @CHECK_IN = qw(
1+2;
1+2;%;
1+2;%;%;
1+2;store:%;%;
1+2;store:%;store;
);
my @CHECK_OUT = map { cas( 'maxima', $_ ) } @CHECK_IN;
our $out_str = join '<br />', @CHECK_OUT;
$out_str .= '<br />'
. cas( 'maxima', "1+2;storeA:%;1-2;storeB:%;[storeA,storeB];" );
</script>
$out_str
<customresponse id="0r0">
<answer type="loncapa/perl">
return 'SUBMITTED';
</answer>
</customresponse>
</problem>
--
Dr. Peter Dencker
wissenschaftl. Mitarbeiter
UNIVERSITÄT ZU LÜBECK
INSTITUT FÜR MATHEMATIK
Ratzeburger Allee 160
23562 Lübeck
Tel +49 451 500 4254
Fax +49 451 500 3373
dencker at math.uni-luebeck.de
www.math.uni-luebeck.de
More information about the LON-CAPA-users
mailing list