Skip to content
Permalink
Browse files

Show gradebook final score in report - refs BT#13447

  • Loading branch information...
AngelFQC committed Oct 17, 2017
1 parent 45406ac commit e2ad104fb52633a1c704400d052f86cf800c2b47
Showing with 24 additions and 1 deletion.
  1. +24 −1 main/gradebook/lib/fe/gradebooktable.class.php
@@ -251,7 +251,7 @@ public function get_table_data($from = 1, $per_page = null, $column = null, $dir
$total_categories_weight = 0;
$scoredisplay = ScoreDisplay::instance();
$totalResult = [0, 0];
$totalUserResult = [0, 0];
$totalBest = [0, 0];
$totalAverage = [0, 0];
@@ -366,6 +366,9 @@ public function get_table_data($from = 1, $per_page = null, $column = null, $dir
$data['result_score'][1],
];
$totalUserResult[0] += $totalResult[0] / ($totalResult[1] ?: 1) * $data[3];
$totalUserResult[1] += $data[3];
$totalBest = [
$scoredisplay->format_score($totalBest[0] + $data['best_score'][0]),
$scoredisplay->format_score($totalBest[1] + $data['best_score'][1]),
@@ -802,6 +805,26 @@ public function get_table_data($from = 1, $per_page = null, $column = null, $dir
}
}
if (!$this->teacherView) {
$rowTotal = [];
$rowTotal[] = ' ';
$rowTotal[] = get_lang('FinalScore');
if (!$this->exportToPdf) {
$rowTotal[] = ' ';
}
$rowTotal[] = ' ';
$rowTotal[] = $scoredisplay->display_score(
$totalUserResult,
SCORE_DIV_PERCENT_WITH_CUSTOM
);
$rowTotal[] = ' ';
$rowTotal[] = ' ';
$rowTotal[] = ' ';
$sortable_data[] = $rowTotal;
}
return $sortable_data;
}

0 comments on commit e2ad104

Please sign in to comment.
You can’t perform that action at this time.