Blacklisted Maxima functions in STACK

Re: Blacklisted Maxima functions in STACK

by Tim Hunt -
Number of replies: 2
Picture of Core developers Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers

The lists are in the stack_cas_casstring class in question/type/stack/cas/casstring.class.php. https://github.com/maths/moodle-qtype_stack/blob/master/stack/cas/casstring.class.php#L68. Find that file in your Moodle site, and edit it.

If you tell us (well, mainly Chris) what you have done, we might make the same change in the standard STACK version.

In reply to Tim Hunt

Re: Blacklisted Maxima functions in STACK

by Mikko Vasko -

Hello,

I have a question related to this. I'm trying to generate a question, where the students need to enter a function that is strictly monotonically increasing.

I use in Feedback variables the following code

fd:diff(ans1,x);
flag: 1;
if is(fd>=0)=unknown then flag:0;
if is(fd>=0)=false then flag:0;

and in answer test I check if flag=1.

In Maxima this works fine, but in STACK I get the error "Unsupported keyword: unknown.", because "is" delivers either true, false or unknown.

Is there a way to fix this? Or do you have a better idea how to do the question?

Thanks,

Mikko


In reply to Mikko Vasko

Re: Blacklisted Maxima functions in STACK

by Christopher Sangwin -
Picture of Particularly helpful Moodlers Picture of Plugin developers

Hi Mikko,

Yes, the short fix is to remove "unknown" from the variable     

private static $teachernotallow 

in the casstring class:  https://github.com/maths/moodle-qtype_stack/blob/master/stack/cas/casstring.class.php

I'm conservative about what has been included, particularly with functions which have global scope within maxima. The "assume" database of functions does precisely this for example.  Unknown is both a maxima function, and a return value (confusingly!) But I see no reason to avoid using it, so I'll commit come changes which enable this to be available in future versions.

If you get this question working *reliably* please let me know!

Chris