--- loncom/homework/caparesponse/caparesponse.pm 2008/09/23 19:22:58 1.227.2.4 +++ loncom/homework/caparesponse/caparesponse.pm 2008/09/04 13:49:19 1.228 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # caparesponse definition # -# $Id: caparesponse.pm,v 1.227.2.4 2008/09/23 19:22:58 raeburn Exp $ +# $Id: caparesponse.pm,v 1.228 2008/09/04 13:49:19 riegler Exp $ # # Copyright Michigan State University Board of Trustees # @@ -310,6 +310,9 @@ sub start_numericalresponse { $safeeval); if ($unit =~ /\S/) { $result.=" (in $unit) "; } } + if (($token->[1] eq 'formularesponse') && + ($Apache::inputtags::status['-1'] eq 'CAN_ANSWER')) { + } if ( &Apache::response::show_answer() ) { &set_answertext($tag_internal_answer_name,$target,$token,$tagstack, $parstack,$parser,$safeeval,-1); @@ -427,12 +430,8 @@ sub check_submission { } } elsif ($tag eq 'numericalresponse') { $$args_ref{'type'}='float'; - } elsif ($tag eq 'stringresponse') { - if ($$args_ref{'type'} eq '') { - $$args_ref{'type'} = 'ci'; - } } - + &add_in_tag_answer($parstack,$safeeval); if (!%answer) { @@ -514,12 +513,12 @@ sub end_numericalresponse { &Apache::lonxml::debug($$parstack[-1] . "\n
"); if ( &Apache::response::submitted('scantron')) { - &add_in_tag_answer($parstack,$safeeval); - my ($values,$display)=&make_numerical_bubbles($partid,$id, - $target,$parstack,$safeeval); - $response=$values->[$response]; - } - $Apache::lonhomework::results{"resource.$partid.$id.submission"}=$response; + &add_in_tag_answer($parstack,$safeeval); + my ($values,$display)=&make_numerical_bubbles($partid,$id, + $target,$parstack,$safeeval); + $response=$values->[$response]; + } + $Apache::lonhomework::results{"resource.$partid.$id.submission"}=$response; my ($ad,$msg,$name)=&check_submission($response,$partid,$id, $tag,$parstack, $safeeval); @@ -607,11 +606,10 @@ sub end_numericalresponse { } } if (($target eq 'web') && ($tag eq 'formularesponse') - && ($Apache::lonhomework::type ne 'exam') && ($Apache::inputtags::status['-1'] eq 'CAN_ANSWER') - && (&Apache::lonnet::EXT('resource.'.$partid.'_'.$id.'.turnoffeditor') ne 'yes')) { - $result.=&Apache::response::edit_mathresponse_button($id,"HWVAL_$id"); + && ($Apache::lonhomework::type ne 'exam')) { + $result.=&Apache::response::edit_mathresponse_button($id,"HWVAL_$id"); } - + &Apache::response::setup_prior_tries_hash(\&format_prior_response_numerical); } elsif ($target eq 'edit') { $result.=''.&Apache::edit::end_table; @@ -1161,9 +1159,7 @@ sub end_stringresponse { my @args = ('type'); my $args_ref = &setup_capa_args($safeeval,$parstack, \@args,$response); - if ($$args_ref{'type'} eq '') { - $$args_ref{'type'} = 'ci'; - } + &add_in_tag_answer($parstack,$safeeval); my (@final_awards,@final_msgs,@names); foreach my $name (keys(%answer)) {