[LON-CAPA-cvs] cvs: loncom /homework response.pm
albertel
lon-capa-cvs@mail.lon-capa.org
Mon, 16 Feb 2004 20:09:51 -0000
albertel Mon Feb 16 15:09:51 2004 EDT
Modified files:
/loncom/homework response.pm
Log:
- if we dont get a valid weight don't ISE, default to 1
Index: loncom/homework/response.pm
diff -u loncom/homework/response.pm:1.90 loncom/homework/response.pm:1.91
--- loncom/homework/response.pm:1.90 Mon Feb 9 14:38:00 2004
+++ loncom/homework/response.pm Mon Feb 16 15:09:51 2004
@@ -1,7 +1,7 @@
# The LearningOnline Network with CAPA
# various response type definitons response definition
#
-# $Id: response.pm,v 1.90 2004/02/09 19:38:00 albertel Exp $
+# $Id: response.pm,v 1.91 2004/02/16 20:09:51 albertel Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -502,6 +502,7 @@
if ($increase ne '') { $score+=$increase+1; }
}
my $weight = &Apache::lonnet::EXT("resource.$part.weight");
+ if (!defined($weight) || $weight eq '' || $weight eq 0) { $weight = 1; }
my $pcr=$score/$weight;
$Apache::lonhomework::results{"resource.$part.$id.awarded"}=$pcr;
$Apache::lonhomework::results{"resource.$part.$id.awarddetail"}=