Browse Source

Fix warning division by zero in gradebook (scored attendances) and check/uncheck all in attendances

José Loguercio 9 years ago
parent
commit
bb3282f47a

+ 4 - 2
main/attendance/index.php

@@ -149,9 +149,11 @@ $(function() {
 		var calendar_id = col_split[2];
 
 		if (this.checked) {
-			$(".checkboxes_col_"+calendar_id+" input:checkbox").attr("checked",true);
+			$(".checkboxes_col_"+calendar_id+" input:checkbox").prop("checked",true);
+            $(".checkboxes_col_"+calendar_id+"").addClass("row_selected");
 		} else {
-			$(".checkboxes_col_"+calendar_id+" input:checkbox").attr("checked",false);
+			$(".checkboxes_col_"+calendar_id+" input:checkbox").prop("checked",false);
+            $(".checkboxes_col_"+calendar_id+"").removeClass("row_selected");
 		}
 	});
 

+ 1 - 1
main/gradebook/lib/gradebook_data_generator.class.php

@@ -352,7 +352,7 @@ class GradebookDataGenerator
                 case 'L' :
                     //if ($parentId == 0) {
                         $scoreWeight = [
-                            $score[0] / $score[1] * $item->get_weight(),
+                            ($score[1] > 0) ? $score[0] / $score[1] * $item->get_weight() : 0,
                             $item->get_weight()
                         ];
                     //}