Minor - format code fix php warning

pull/3213/head
Julio Montoya 6 years ago
parent 2b92ced895
commit 67b61d8c72
  1. 2
      main/lp/learnpath.class.php
  2. 10
      main/lp/learnpathItem.class.php

@ -2564,7 +2564,9 @@ class learnpath
$score = $item->get_score();
$maxScore = $item->get_max();
if ($mode = '%') {
if (!empty($maxScore)) {
$percentage = ((float) $score / (float) $maxScore) * 100;
}
$percentage = number_format($percentage, 0);
$text = '%';
} else {

@ -753,7 +753,7 @@ class learnpathItem
*/
public function get_max()
{
if ($this->type == 'sco') {
if ($this->type === 'sco') {
if (isset($this->view_max_score) &&
!empty($this->view_max_score) &&
$this->view_max_score > 0
@ -766,16 +766,16 @@ class learnpathItem
} else {
if (!empty($this->max_score)) {
return $this->max_score;
} else {
return 100;
}
return 100;
}
} else {
if (!empty($this->max_score)) {
return $this->max_score;
} else {
return 100;
}
return 100;
}
}

Loading…
Cancel
Save