--- loncom/homework/caparesponse/caparesponse.pm 2012/02/10 00:25:53 1.251 +++ loncom/homework/caparesponse/caparesponse.pm 2014/12/30 20:03:15 1.255 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # caparesponse definition # -# caparesponse.pm,v 1.249.8.2 2012/02/04 20:40:15 foxr +# $Id: caparesponse.pm,v 1.255 2014/12/30 20:03:15 raeburn Exp $ # # Copyright Michigan State University Board of Trustees # @@ -456,7 +456,6 @@ sub check_submission { my ($result,@msgs) = &Apache::run::run("&caparesponse_check_list()",$safeeval); &Apache::lonxml::debug("checking $name $result with $response took ".&Time::HiRes::tv_interval($t0)); - &Apache::lonxml::debug('msgs are '.join(':',@msgs)); my ($awards)=split(/:/,$result); my @awards= split(/,/,$awards); @@ -646,7 +645,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($id,"HWVAL_$id"); + $result.=&Apache::response::edit_mathresponse_button($partid,$id); } &Apache::response::setup_prior_tries_hash(\&format_prior_response_numerical); @@ -970,6 +969,15 @@ sub make_numerical_bubbles { my $number_of_bubbles = &Apache::response::get_response_param($part.'_'.$id,'numbubbles',8); + # + # Fixes for BZ 6519 - number of bubbles <= 0 or non-integer. + # + $number_of_bubbles = int($number_of_bubbles + 0.5); + if ($number_of_bubbles <= 0) { + $number_of_bubbles = 8; + } + + my ($format)=&Apache::lonxml::get_param_var('format',$parstack,$safeeval); my $name = (exists($answer{$tag_internal_answer_name}) ? $tag_internal_answer_name