--- loncom/homework/hint.pm 2006/12/19 00:40:38 1.65 +++ loncom/homework/hint.pm 2006/12/19 14:53:17 1.67 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # implements the tags that control the hints # -# $Id: hint.pm,v 1.65 2006/12/19 00:40:38 albertel Exp $ +# $Id: hint.pm,v 1.67 2006/12/19 14:53:17 www Exp $ # # Copyright Michigan State University Board of Trustees # @@ -110,6 +110,7 @@ sub start_numericalhint { my ($target,$token,$tagstack,$parstack,$parser,$safeeval,$style)=@_; #do everything in end, so intervening work &Apache::response::start_hintresponse($parstack,$safeeval); + &Apache::caparesponse::push_answer(); my $result; if ($target eq 'edit') { $result.=&Apache::edit::tag_start($target,$token); @@ -177,7 +178,11 @@ sub end_numericalhint { if (lc($hideunit) eq "yes") { delete($$args_ref{'unit'}); } if ($$tagstack[-1] eq 'formulahint') { - $$args_ref{'type'}='fml'; + if ($$args_ref{'samples'}) { + $$args_ref{'type'}='fml'; + } else { + $$args_ref{'type'}='math'; + } } elsif ($$tagstack[-1] eq 'numericalhint') { $$args_ref{'type'}='float'; } @@ -215,6 +220,7 @@ sub end_numericalhint { } elsif ($target eq 'edit') { $result.=&Apache::edit::end_row().&Apache::edit::end_table(); } + &Apache::caparesponse::pop_answer(); &Apache::response::end_hintresponse(); return $result; }