--- loncom/homework/hint.pm 2011/06/08 20:38:47 1.78 +++ loncom/homework/hint.pm 2024/09/29 01:58:43 1.79 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # implements the tags that control the hints # -# $Id: hint.pm,v 1.78 2011/06/08 20:38:47 www Exp $ +# $Id: hint.pm,v 1.79 2024/09/29 01:58:43 raeburn Exp $ # # Copyright Michigan State University Board of Trustees # @@ -185,16 +185,19 @@ sub end_numericalhint { my $hideunit=&Apache::response::get_response_param($partid.'_'.$submitid,'turnoffunit'); if (lc($hideunit) eq "yes") { delete($$args_ref{'unit'}); } + my $stringify; if ($$tagstack[-1] eq 'formulahint') { if ($$args_ref{'samples'}) { $$args_ref{'type'}='fml'; + $stringify = 1; } else { $$args_ref{'type'}='math'; } } elsif ($$tagstack[-1] eq 'numericalhint') { $$args_ref{'type'}='float'; + $stringify = 1; } - &Apache::caparesponse::add_in_tag_answer($parstack,$safeeval); + &Apache::caparesponse::add_in_tag_answer($parstack,$safeeval,$stringify); my %answer = &Apache::caparesponse::get_answer(); my (@final_awards,@final_msgs,@ans_names); foreach my $ans_name (keys(%answer)) { @@ -441,7 +444,11 @@ sub end_stringhint { if ($$args_ref{'type'} eq '') { $$args_ref{'type'} = 'ci'; } - &Apache::caparesponse::add_in_tag_answer($parstack,$safeeval); + my $stringify; + if ($$args_ref{'type'} ne 're') { + $stringify = 1; + } + &Apache::caparesponse::add_in_tag_answer($parstack,$safeeval,$stringify); my (@final_awards,@final_msgs,@ans_names); my %answer = &Apache::caparesponse::get_answer(); foreach my $ans_name (keys(%answer)) {