--- loncom/homework/default_homework.lcpm 2005/11/16 23:17:39 1.105 +++ loncom/homework/default_homework.lcpm 2006/06/13 14:57:54 1.107 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # used by lonxml::xmlparse() as input variable $safeinit to Apache::run::run() # -# $Id: default_homework.lcpm,v 1.105 2005/11/16 23:17:39 albertel Exp $ +# $Id: default_homework.lcpm,v 1.107 2006/06/13 14:57:54 albertel Exp $ # # Copyright Michigan State University Board of Trustees # @@ -117,10 +117,11 @@ sub caparesponse_check { if ( $answer eq ($answer *1.0)) { $type = 2; } else { $type = 3; } } else { - if ($type eq 'cs') { $type = 4; } + if ($type eq 'cs') { $type = 4; } elsif ($type eq 'ci') { $type = 3 } elsif ($type eq 'mc') { $type = 5; } elsif ($type eq 'fml') { $type = 8; } + elsif ($type eq 'math') { $type = 9; } elsif ($type eq 'subj') { $type = 7; } elsif ($type eq 'float') { $type = 2; } elsif ($type eq 'int') { $type = 1; } @@ -149,13 +150,17 @@ sub caparesponse_check { ($sig_ubound,$sig_lbound)=&LONCAPA_INTERNAL_get_sigrange($sig); my $reterror=""; - my $result = &caparesponse_capa_check_answer($response,$answer,$type, + my $result; + if ($type eq '9') { + $result = &maxima_check($response,$answer,\$reterror); + } else { + $result = &caparesponse_capa_check_answer($response,$answer,$type, $tol_type,$tol, $sig_lbound,$sig_ubound, $ans_fmt,$unit,$calc,$id_list, $points,$external::randomseed, \$reterror); - + } if ($result == '1') { $result='EXACT_ANS'; } elsif ($result == '2') { $result='APPROX_ANS'; } elsif ($result == '3') { $result='SIG_FAIL'; } @@ -210,7 +215,7 @@ sub caparesponse_check_list { $result.="Final final response :$responselist['-1']:$unit:\n"; $unit=~s/\s//; - my ($awards, @msgs); + my ($awards, @msgs, $i); foreach my $thisanswer (@LONCAPA::CAPAresponse_answer) { my ($msg,$aresult); $result.="trying answer :$thisanswer:\n"; @@ -231,6 +236,7 @@ sub caparesponse_check_list { $awards.="$temp,"; $result.=$aresult; push(@msgs,$msg); + $i++; } chop($awards); return ("$awards:\n$result",@msgs);