[LON-CAPA-cvs] cvs: loncom /homework/caparesponse caparesponse.pm
foxr
foxr at source.lon-capa.org
Mon Mar 5 06:50:40 EST 2012
foxr Mon Mar 5 11:50:40 2012 EDT
Modified files:
/loncom/homework/caparesponse caparesponse.pm
Log:
BZ 6519 - Protect against invalid bubble counts:
- Round bubble count to nearest integer.
- Replace bubble counts <= 0 with the default value (8).
Index: loncom/homework/caparesponse/caparesponse.pm
diff -u loncom/homework/caparesponse/caparesponse.pm:1.251 loncom/homework/caparesponse/caparesponse.pm:1.252
--- loncom/homework/caparesponse/caparesponse.pm:1.251 Fri Feb 10 00:25:53 2012
+++ loncom/homework/caparesponse/caparesponse.pm Mon Mar 5 11:50:39 2012
@@ -970,6 +970,15 @@
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
More information about the LON-CAPA-cvs
mailing list