--- loncom/homework/inputtags.pm 2002/03/01 00:23:04 1.53 +++ loncom/homework/inputtags.pm 2002/03/08 19:55:00 1.54 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # input definitons # -# $Id: inputtags.pm,v 1.53 2002/03/01 00:23:04 albertel Exp $ +# $Id: inputtags.pm,v 1.54 2002/03/08 19:55:00 albertel Exp $ # # Copyright Michigan State University Board of Trustees # @@ -185,7 +185,14 @@ sub finalizeawards { my $award; if ($#_ == '-1') { $result = "NO_RESPONSE"; } if ($result eq '' ) { - foreach $award (@_) { if ($award eq '') {$result='MISSING_ANSWER'; last;}} + my $blankcount; + foreach $award (@_) { + if ($award eq '') { + $result='MISSING_ANSWER'; + $blankcount++; + } + } + if ($blankcount == ($#_ + 1)) { $result = 'NO_RESPONSE'; } } if ($result eq '' ) { foreach $award (@_) { if ($award eq 'ERROR') {$result='ERROR'; last;}} @@ -355,12 +362,8 @@ sub grade { foreach $response (@Apache::inputtags::responselist) { &Apache::lonxml::debug("looking for response.$id.$response.awarddetail"); my $value=$Apache::lonhomework::results{"resource.$id.$response.awarddetail"}; - if ( $value ne '' ) { - &Apache::lonxml::debug("keeping $value from $response for $id"); - push (@awards,$value); - } else { - &Apache::lonxml::debug("skipping $value from $response for $id"); - } + &Apache::lonxml::debug("keeping $value from $response for $id"); + push (@awards,$value); } my $finalaward = &finalizeawards(@awards); my $previously_used;