Skip to content

Commit

Permalink
MDL-58415 mod_lesson: Force int type for calculated progress
Browse files Browse the repository at this point in the history
Under some circumstances the value returned by the function needs
casting.
  • Loading branch information
jleyva committed Apr 20, 2017
1 parent 6d14355 commit 16ca026
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion mod/lesson/locallib.php
Original file line number Diff line number Diff line change
Expand Up @@ -3107,7 +3107,8 @@ public function calculate_progress() {
}

// Progress calculation as a percent.
return round(count($viewedpageids) / count($validpages), 2) * 100;
$progress = round(count($viewedpageids) / count($validpages), 2) * 100;
return (int) $progress;
}

/**
Expand Down

0 comments on commit 16ca026

Please sign in to comment.