--- loncom/homework/response.pm 2006/10/17 19:35:37 1.149 +++ loncom/homework/response.pm 2006/12/04 20:35:06 1.150 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # various response type definitons response definition # -# $Id: response.pm,v 1.149 2006/10/17 19:35:37 albertel Exp $ +# $Id: response.pm,v 1.150 2006/12/04 20:35:06 www Exp $ # # Copyright Michigan State University Board of Trustees # @@ -470,6 +470,14 @@ sub start_mathresponse { $result.=&Apache::edit::tag_start($target,$token); $result.=&Apache::edit::text_arg('String to display for answer:', 'answerdisplay',$token); + $result.=&Apache::edit::select_arg('Algebra System:', + 'cas', + ['maxima'], + $token); + $result.=&Apache::edit::text_arg('Algebra System:', + 'cas',$token); + $result.=&Apache::edit::text_arg('Argument Array:', + 'args',$token); $result.=&Apache::edit::end_row().&Apache::edit::start_spanning_row(); } elsif ($target eq 'modified') { my $constructtag; @@ -494,8 +502,7 @@ sub end_mathresponse { my $id=$Apache::inputtags::response[-1]; if ( $target eq 'grade' && &Apache::response::submitted() ) { my $response = &Apache::response::getresponse(); - if ( $response =~ /[^\s]/ && - $Apache::response::custom_answer_type eq 'loncapa/perl') { + if ( $response =~ /[^\s]/ ) { if (!$Apache::lonxml::default_homework_loaded) { &Apache::lonxml::default_homework_load($safeeval); } @@ -509,8 +516,14 @@ sub end_mathresponse { my $award = &Apache::run::run('{ my $submission=$LONCAPA::mathresponse_submission;'.$Apache::response::custom_answer.'}',$safeeval); if (!&Apache::inputtags::valid_award($award)) { - $error = $award; - $award = 'ERROR'; + if ($award==1) { + $award='EXACT_ANS'; + } elsif ($award==0) { + $award='INCORRECT'; + } else { + $error = $award; + $award = 'ERROR'; + } } &Apache::response::handle_previous(\%previous,$award); $Apache::lonhomework::results{"resource.$part.$id.awarddetail"}=