Fix PHP warning

pull/2487/head
jmontoyaa 8 years ago
parent 5fa816b1ad
commit 67ce8dca35
  1. 6
      main/gradebook/lib/GradebookUtils.php
  2. 2
      main/gradebook/lib/flatview_data_generator.class.php
  3. 2
      main/gradebook/lib/scoredisplay.class.php

@ -876,7 +876,9 @@ class GradebookUtils
}
$user_results = $flatviewtable->datagen->get_data_to_graph2(false);
foreach ($user_results as $user_result) {
$total[$user_result[count($user_result) - 1][1]]++;
$item = $user_result[count($user_result) - 1];
$total[$item[1]]++;
}
}
@ -966,7 +968,7 @@ class GradebookUtils
'course_code' => $course_code,
'add_signatures' => ['Drh', 'Teacher', 'Date']
);
exit;
$page_format = $params['orientation'] == 'landscape' ? 'A4-L' : 'A4';
ob_start();
$pdf = new PDF($page_format, $page_format, $pdfParams);

@ -630,7 +630,7 @@ class FlatViewDataGenerator
$score = $item->calc_score($user_id);
$real_score = $score;
$divide = isset($score[1]) && !empty($score[1]) ? $score[1] : 1;
$divide = isset($score[1]) && !empty($score[1]) && $score[1] > 0 ? $score[1] : 1;
// Sub cat weight
//$sub_cat_percentage = $sum_categories_weight_array[$item->get_category_id()];

@ -323,7 +323,7 @@ class ScoreDisplay
}
if ($this->coloring_enabled && $no_color != false) {
$my_score_denom = isset($score[1]) && !empty($score[1]) ? $score[1] : 1;
$my_score_denom = isset($score[1]) && !empty($score[1]) && $score[1] > 0 ? $score[1] : 1;
$scoreCleaned = isset($score[0]) ? $score[0] : 0;
if (($scoreCleaned / $my_score_denom) < ($this->color_split_value / 100)) {
$display = Display::tag('font', $display, array('color'=>'red'));

Loading…
Cancel
Save