--- loncom/homework/caparesponse/caparesponse.pm 2007/08/29 10:09:56 1.217 +++ loncom/homework/caparesponse/caparesponse.pm 2007/11/16 08:44:37 1.220 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # caparesponse definition # -# $Id: caparesponse.pm,v 1.217 2007/08/29 10:09:56 foxr Exp $ +# $Id: caparesponse.pm,v 1.220 2007/11/16 08:44:37 albertel Exp $ # # Copyright Michigan State University Board of Trustees # @@ -431,6 +431,10 @@ sub check_submission { &add_in_tag_answer($parstack,$safeeval); + if (!%answer) { + &Apache::lonxml::error("No answers are defined"); + } + my (@final_awards,@final_msgs,@names); foreach my $name (keys(%answer)) { &Apache::lonxml::debug(" doing $name with ".join(':',@{ $answer{$name}{'answers'} })); @@ -605,7 +609,6 @@ 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])); } @@ -784,7 +787,10 @@ sub end_numericalresponse { } if ($target eq 'grade' || $target eq 'web' || $target eq 'answer' || $target eq 'tex' || $target eq 'analyze') { - &Apache::lonxml::increment_counter($increment); + &Apache::lonxml::increment_counter($increment,"$partid.$id"); + if ($target eq 'analyze') { + &Apache::lonhomework::set_bubble_lines(); + } } &Apache::response::end_response(); return $result; @@ -1006,7 +1012,8 @@ sub get_sigrange { my ($sig)=@_; #&Apache::lonxml::debug("Got a sig of :$sig:"); my $courseid=$env{'request.course.id'}; - if (lc($env{"course.$courseid.disablesigfigs"}) eq 'yes') { + if ($env{'request.state'} ne 'construct' + && lc($env{"course.$courseid.disablesigfigs"}) eq 'yes') { return (15,0); } my $sig_lbound; @@ -1223,7 +1230,11 @@ sub end_stringresponse { } if ($target eq 'grade' || $target eq 'web' || $target eq 'answer' || $target eq 'tex' || $target eq 'analyze') { - &Apache::lonxml::increment_counter(&Apache::response::repetition()); + &Apache::lonxml::increment_counter(&Apache::response::repetition(), + "$part.$id"); + if ($target eq 'analyze') { + &Apache::lonhomework::set_bubble_lines(); + } } &Apache::response::end_response; return $result;