[LON-CAPA-cvs] cvs: loncom /homework grades.pm
www
lon-capa-cvs-allow@mail.lon-capa.org
Sat, 11 Aug 2007 13:32:27 -0000
www Sat Aug 11 09:32:27 2007 EDT
Modified files:
/loncom/homework grades.pm
Log:
Don't crash if you don't find questions (would result in division by zero in
the next step).
Index: loncom/homework/grades.pm
diff -u loncom/homework/grades.pm:1.427 loncom/homework/grades.pm:1.428
--- loncom/homework/grades.pm:1.427 Fri Aug 10 16:12:31 2007
+++ loncom/homework/grades.pm Sat Aug 11 09:32:23 2007
@@ -1,7 +1,7 @@
# The LearningOnline Network with CAPA
# The LON-CAPA Grading handler
#
-# $Id: grades.pm,v 1.427 2007/08/10 20:12:31 albertel Exp $
+# $Id: grades.pm,v 1.428 2007/08/11 13:32:23 www Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -7324,6 +7324,9 @@
$result.='<br /><span class="LC_warning">'.&mt("Found [_1] entries for grading!",$correct_count).'</span>';
}
}
+ if ($number<1) {
+ $errormsg.="Found no questions.";
+ }
if ($errormsg) {
$result.='<br /><span class="LC_error">'.&mt($errormsg).'</span>';
} else {