[LON-CAPA-cvs] cvs: loncom /homework inputtags.pm
albertel
lon-capa-cvs@mail.lon-capa.org
Fri, 08 Mar 2002 19:55:00 -0000
albertel Fri Mar 8 14:55:00 2002 EDT
Modified files:
/loncom/homework inputtags.pm
Log:
- fixes BUG#163
Index: loncom/homework/inputtags.pm
diff -u loncom/homework/inputtags.pm:1.53 loncom/homework/inputtags.pm:1.54
--- loncom/homework/inputtags.pm:1.53 Thu Feb 28 19:23:04 2002
+++ loncom/homework/inputtags.pm Fri Mar 8 14:55:00 2002
@@ -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 @@
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 @@
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;