--- loncom/homework/caparesponse/caparesponse.pm 2007/06/05 22:30:05 1.215 +++ loncom/homework/caparesponse/caparesponse.pm 2007/08/29 10:09:56 1.217 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # caparesponse definition # -# $Id: caparesponse.pm,v 1.215 2007/06/05 22:30:05 albertel Exp $ +# $Id: caparesponse.pm,v 1.217 2007/08/29 10:09:56 foxr Exp $ # # Copyright Michigan State University Board of Trustees # @@ -605,6 +605,7 @@ sub end_numericalresponse { my $part_id="$partid.$id"; if ($target eq 'analyze') { push (@{ $Apache::lonhomework::analyze{"parts"} },$part_id); + push (@{ $Apache::lonhomework::analyze{"$part_id.bubble_lines"} }, 1); $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])); } @@ -859,7 +860,13 @@ sub get_table_sizes { my $bubbles_per_line=int($textwidth/$cell_width); if ($bubbles_per_line > $number_of_bubbles) { $bubbles_per_line=$number_of_bubbles; - }elsif (($bubbles_per_line > $number_of_bubbles/2) && ($number_of_bubbles % 2==0)) {$bubbles_per_line=$number_of_bubbles/2;} + } elsif (($bubbles_per_line > $number_of_bubbles/2) + && ($number_of_bubbles % 2==0)) { + $bubbles_per_line=$number_of_bubbles/2; + } + if ($bubbles_per_line < 1) { + $bubbles_per_line=1; + } my $number_of_tables = int($number_of_bubbles/$bubbles_per_line); my @table_range = (); for (my $i=0;$i<$number_of_tables;$i++) {push @table_range,$bubbles_per_line;}