--- loncom/homework/caparesponse/caparesponse.pm 2014/12/30 20:03:15 1.255 +++ loncom/homework/caparesponse/caparesponse.pm 2016/02/18 18:40:05 1.257 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # caparesponse definition # -# $Id: caparesponse.pm,v 1.255 2014/12/30 20:03:15 raeburn Exp $ +# $Id: caparesponse.pm,v 1.257 2016/02/18 18:40:05 raeburn Exp $ # # Copyright Michigan State University Board of Trustees # @@ -642,12 +642,7 @@ 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($partid,$id); - } - + &Apache::response::setup_prior_tries_hash(\&format_prior_response_numerical); } elsif ($target eq 'edit') { $result.=''.&Apache::edit::end_table; @@ -795,7 +790,10 @@ sub end_numericalresponse { $tag,$parstack, $safeeval,1); $error=&mt("Computer's answer is incorrect ([_1]).",'"'.join(', ',@$response).'"').' '; - if ($sigline ne '') { + if ($ad eq 'UNIT_INVALID_STUDENT') { + $error.=&mt('Unable to interpret units. Computer reads units as "[_1]".',$msg).' '. + &mt('The unit attribute in the numericalresponse item needs to be a supported physical unit.'); + } elsif ($sigline ne '') { $error.=&mt('It is likely that the tolerance range [_1] or significant figures [_2] need to be adjusted.',$tolline,$sigline); } else { $error.=&mt('It is likely that the tolerance range [_1] needs to be adjusted.',$tolline);