From: Sam H. v. a. <we...@ma...> - 2005-10-08 22:13:56
|
Log Message: ----------- added check for $total==0 to eliminate potential DIV error (bug #855) Modified Files: -------------- webwork2/lib/WeBWorK/ContentGenerator: Grades.pm Revision Data ------------- Index: Grades.pm =================================================================== RCS file: /webwork/cvs/system/webwork2/lib/WeBWorK/ContentGenerator/Grades.pm,v retrieving revision 1.18 retrieving revision 1.19 diff -Llib/WeBWorK/ContentGenerator/Grades.pm -Llib/WeBWorK/ContentGenerator/Grades.pm -u -r1.18 -r1.19 --- lib/WeBWorK/ContentGenerator/Grades.pm +++ lib/WeBWorK/ContentGenerator/Grades.pm @@ -337,7 +337,7 @@ my $avg_num_attempts = ($num_of_problems) ? $num_of_attempts/$num_of_problems : 0; - my $successIndicator = ($avg_num_attempts) ? ($totalRight/$total)**2/$avg_num_attempts : 0 ; + my $successIndicator = ($avg_num_attempts && $total) ? ($totalRight/$total)**2/$avg_num_attempts : 0 ; push @rows, CGI::Tr( CGI::td(CGI::a({-href=>$act_as_student_set_url}, WeBWorK::ContentGenerator::underscore2nbsp($setName))), |