--- loncom/homework/caparesponse/caparesponse.pm 2002/09/30 16:01:36 1.59 +++ loncom/homework/caparesponse/caparesponse.pm 2002/09/30 18:08:09 1.60 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # caparesponse definition # -# $Id: caparesponse.pm,v 1.59 2002/09/30 16:01:36 albertel Exp $ +# $Id: caparesponse.pm,v 1.60 2002/09/30 18:08:09 sakharuk Exp $ # # Copyright Michigan State University Board of Trustees # @@ -220,19 +220,26 @@ sub end_numericalresponse { for ($ind=0;$ind<$number_of_bubbles;$ind++) { $bubbles_values[$ind] = $answers[0]*$factor**($power-$powers[$powers_number-$ind-1]); } + my @alphabet = ('A','B','C','D','E','F','G','H','I','J','K','L','M','N','O','P', + 'Q','R','S','T','U','V','W','X','Y','Z'); if ($target eq 'web') { $result.= '
'.$ans.' | '; + if (undef @formats) { + my $ans = sprintf('%.'.$formats[0],$bubbles_values[$ind]); + $result.=''.$alphabet[$ind].': '.$ans.' | '; + } else { + my $ans = sprintf('%.'.'d',$bubbles_values[$ind]); + $result.=''.$alphabet[$ind].': '.$ans.' | '; } + } $result.='