Fix total values using format_score see BT#13460

pull/2487/head
jmontoyaa 8 years ago
parent 6317d469ad
commit 60c88014cf
  1. 3
      main/gradebook/lib/fe/displaygradebook.php
  2. 5
      main/gradebook/lib/fe/gradebooktable.class.php

@ -314,13 +314,14 @@ class DisplayGradebook
if (!empty($score)) {
$divide = $score[1] == 0 ? 1 : $score[1];
$item_value = $score[0] / $divide * $item->get_weight();
$item_value_total += $item_value;
$item_value_total += $scoredisplay->format_score($item_value);
}
}
$item_total = $main_weight;
$total_score = array($item_value_total, $item_total);
$scorecourse_display = $scoredisplay->display_score($total_score, SCORE_DIV_PERCENT);
if ((!$catobj->get_id() == '0') && (!isset($_GET['studentoverview'])) && (!isset($_GET['search']))) {
$additionalButtons = null;
if (!empty($certificateLinkInfo)) {

@ -385,13 +385,13 @@ class GradebookTable extends SortableTable
$data['result_score'][1]
);
}
$totalResultAverageValue = strip_tags(
$scoredisplay->display_score(
$totalResult,
SCORE_AVERAGE
)
);
$this->dataForGraph['my_result'][] = floatval($totalResultAverageValue);
$this->dataForGraph['my_result_no_float'][] = $data['result_score'][0];
$totalAverageValue = strip_tags($scoredisplay->display_score($totalAverage, SCORE_AVERAGE));
@ -631,8 +631,9 @@ class GradebookTable extends SortableTable
$global = null;
$average = null;
$myTotal = 0;
foreach ($this->dataForGraph['my_result_no_float'] as $result) {
$myTotal += $result;
$myTotal += $scoredisplay->format_score($result);
}
$totalResult[0] = $myTotal;

Loading…
Cancel
Save