From d793e4105094649036f4e81485decf136e92bdf2 Mon Sep 17 00:00:00 2001 From: Yannick Warnier Date: Sun, 31 Mar 2013 18:26:38 -0500 Subject: [PATCH] Fixed wrong total score in subcategories' *Total* column - refs BT#6003 --- main/gradebook/lib/flatview_data_generator.class.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/main/gradebook/lib/flatview_data_generator.class.php b/main/gradebook/lib/flatview_data_generator.class.php index a5e643b02a..74594734ff 100644 --- a/main/gradebook/lib/flatview_data_generator.class.php +++ b/main/gradebook/lib/flatview_data_generator.class.php @@ -240,7 +240,7 @@ class FlatViewDataGenerator $parent_id = $this->category->get_parent_id(); - if ($parent_id == 0) { + if ($parent_id == 0 or $this->params['only_subcat'] == $this->category->get_id()) { $main_weight = $this->category->get_weight(); $grade_model_id = $this->category->get_grade_model_id(); } else { @@ -411,7 +411,8 @@ class FlatViewDataGenerator } $item_total = $main_weight; } - $total_score = array($item_value_total, $item_total); + $total_score = array($item_value_total, $item_total); +error_log(print_r($total_score,1)); if (!$show_all) { if ($export_to_pdf) {