[LON-CAPA-cvs] cvs: loncom /homework/caparesponse caparesponse.pm
albertel
lon-capa-cvs-allow@mail.lon-capa.org
Tue, 05 Jun 2007 22:30:06 -0000
albertel Tue Jun 5 18:30:06 2007 EDT
Modified files:
/loncom/homework/caparesponse caparesponse.pm
Log:
- remove some debug code
- fix bomb when display exam mode on a problem that has no answer defined
Index: loncom/homework/caparesponse/caparesponse.pm
diff -u loncom/homework/caparesponse/caparesponse.pm:1.214 loncom/homework/caparesponse/caparesponse.pm:1.215
--- loncom/homework/caparesponse/caparesponse.pm:1.214 Mon May 21 20:45:43 2007
+++ loncom/homework/caparesponse/caparesponse.pm Tue Jun 5 18:30:05 2007
@@ -1,7 +1,7 @@
# The LearningOnline Network with CAPA
# caparesponse definition
#
-# $Id: caparesponse.pm,v 1.214 2007/05/22 00:45:43 albertel Exp $
+# $Id: caparesponse.pm,v 1.215 2007/06/05 22:30:05 albertel Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -392,9 +392,6 @@
sub setup_capa_response {
my ($args_ref,$response) = @_;
- use Data::Dumper;
- &Apache::lonxml::debug("response dump is ".&Dumper($response));
-
if (ref($response)) {
$$args_ref{'response'}=dclone($response);
} else {
@@ -824,8 +821,6 @@
} (sort(keys(%counts))));
&Apache::lonxml::error(&mt("All answers must have the same number of components. Varying numbers of answers were seen. ").$counts);
}
- use Data::Dumper;
- &Apache::lonxml::debug("count dump is ".&Dumper(\%counts));
my $expected_number_of_inputs = (keys(%counts))[0];
if ( $expected_number_of_inputs > 0
&& $expected_number_of_inputs != scalar(@Apache::inputtags::inputlist)) {
@@ -899,6 +894,11 @@
sub make_numerical_bubbles {
my ($part,$id,$target,$parstack,$safeeval) =@_;
+
+ if (!%answer) {
+ &Apache::lonxml::error(&mt("No answers defined for response [_1] in part [_2] to make bubbles for.",$id,$part));
+ return ([],[],undef);
+ }
my $number_of_bubbles =
&Apache::response::get_response_param($part.'_'.$id,'numbubbles',8);