--- loncom/homework/caparesponse/caparesponse.pm 2005/01/10 18:42:21 1.160 +++ loncom/homework/caparesponse/caparesponse.pm 2005/01/26 22:43:43 1.161 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # caparesponse definition # -# $Id: caparesponse.pm,v 1.160 2005/01/10 18:42:21 albertel Exp $ +# $Id: caparesponse.pm,v 1.161 2005/01/26 22:43:43 albertel Exp $ # # Copyright Michigan State University Board of Trustees # @@ -160,6 +160,7 @@ sub end_numericalresponse { my (@formats)=&Apache::lonxml::get_param_var('format',$parstack,$safeeval); my (@answers)=&Apache::lonxml::get_param_var('answer',$parstack,$safeeval); my (@incorrect)=&Apache::lonxml::get_param_var('incorrect',$parstack,$safeeval); + if ($#incorrect eq 0) { @incorrect=(split(/,/,$incorrect[0])); } my ($values,$display)=&make_numerical_bubbles($number_of_bubbles,$target,$answers[0],$formats[0],\@incorrect,$safeeval); $response=$values->[$response]; } @@ -238,6 +239,7 @@ sub end_numericalresponse { my $unit=&Apache::lonxml::get_param_var('unit',$parstack, $safeeval); my (@incorrect)=&Apache::lonxml::get_param_var('incorrect',$parstack,$safeeval); + if ($#incorrect eq 0) { @incorrect=(split(/,/,$incorrect[0])); } my ($bubble_values,$bubble_display)= &make_numerical_bubbles($number_of_bubbles, $target,$answers[0], @@ -310,6 +312,7 @@ sub end_numericalresponse { push (@{ $Apache::lonhomework::analyze{"parts"} },$part_id); $Apache::lonhomework::analyze{"$part_id.type"} = $tag; my (@incorrect)=&Apache::lonxml::get_param_var('incorrect',$parstack,$safeeval); + if ($#incorrect eq 0) { @incorrect=(split(/,/,$incorrect[0])); } push (@{ $Apache::lonhomework::analyze{"$part_id.incorrect"} }, @incorrect); &Apache::response::check_if_computed($token,$parstack, $safeeval,'answer'); @@ -486,7 +489,7 @@ sub make_numerical_bubbles { } if (defined($$incorrect[0]) && scalar(@$incorrect)+1 < $number_of_bubbles) { - &Apache::lonxml::warning("Not enough incorrect answers were specified in the incorrect array, ignoring the specified incorrect answers and instead generating them."); + &Apache::lonxml::warning("Not enough incorrect answers were specified in the incorrect array, ignoring the specified incorrect answers and instead generating them (".join(',',@$incorrect).")."); } } my @factors = (1.13,1.17,1.25,1.33,1.45); #default values of factors