--- loncom/homework/lonmaxima.pm 2007/05/26 15:51:08 1.14 +++ loncom/homework/lonmaxima.pm 2007/06/15 21:49:50 1.16 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # Interface routines to MAXIMA CAS # -# $Id: lonmaxima.pm,v 1.14 2007/05/26 15:51:08 www Exp $ +# $Id: lonmaxima.pm,v 1.16 2007/06/15 21:49:50 albertel Exp $ # # Copyright Michigan State University Board of Trustees # @@ -60,7 +60,9 @@ sub maximareply { sub blacklisted { my ($cmd)=@_; - foreach my $forbidden ('save','load','plot','lisp','includ','compil','file','batch','stringout','translat','stout','stin','block','system') { + foreach my $forbidden ('save','load','plot','lisp','includ','compil', + 'file','batch','stringout','translat','stout', + 'stin','block','system','concat') { if ($cmd=~/$forbidden/s) { return 1; } } return 0; @@ -77,6 +79,7 @@ sub runscript { } $reply=~s/^\s*//gs; $reply=~s/\s*$//gs; + &Apache::lonxml::debug("maxima $fullscript \n reply $reply"); return $reply; } @@ -118,7 +121,7 @@ sub maxima_eval { sub compareterms { my ($socket,$terma,$termb)=@_; - my $difference=$terma.'-'.$termb; + my $difference=$terma.'-('.$termb.')'; if (&blacklisted($difference)) { return 'Error: blacklisted'; } my $reply=&maximareply($socket,'trigsimp(trigreduce('.$difference.'));'); if ($reply=~/^\s*0\s*$/) { return 'true'; }