--- loncom/homework/caparesponse/caparesponse.pm 2006/12/19 00:53:57 1.198.2.2 +++ loncom/homework/caparesponse/caparesponse.pm 2006/12/19 14:53:18 1.205 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # caparesponse definition # -# $Id: caparesponse.pm,v 1.198.2.2 2006/12/19 00:53:57 albertel Exp $ +# $Id: caparesponse.pm,v 1.205 2006/12/19 14:53:18 www Exp $ # # Copyright Michigan State University Board of Trustees # @@ -33,6 +33,7 @@ use Safe::Hole; use Apache::lonmaxima(); use Apache::lonlocal; use Apache::lonnet; +use Apache::response(); use Storable qw(dclone); BEGIN { @@ -329,11 +330,11 @@ sub check_submission { } if ($tag eq 'formularesponse') { -# if ($$args_ref{'samples'}) { + if ($$args_ref{'samples'}) { $$args_ref{'type'}='fml'; -# } else { -# $$args_ref{'type'}='math'; -# } + } else { + $$args_ref{'type'}='math'; + } } elsif ($tag eq 'numericalresponse') { $$args_ref{'type'}='float'; } @@ -377,6 +378,11 @@ sub add_in_tag_answer { } } +sub capa_formula_fix { + my ($expression)=@_; + return &Apache::response::implicit_multiplication($expression); +} + sub end_numericalresponse { my ($target,$token,$tagstack,$parstack,$parser,$safeeval,$style)=@_; my $increment=1; @@ -389,7 +395,6 @@ sub end_numericalresponse { my $tag; my $safehole = new Safe::Hole; $safeeval->share_from('capa',['&caparesponse_capa_check_answer']); - $safehole->wrap(\&Apache::lonmaxima::maxima_check,$safeeval,'&maxima_check'); if (scalar(@$tagstack)) { $tag=$$tagstack[-1]; } if ( $target eq 'grade' && &Apache::response::submitted() ) {