Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Revert "MDL-32249 completion: Round course grades and remove hardcode…

…d string"

This reverts commit b795d69.
  • Loading branch information...
commit 0baa0a305d5ca44b498b27ea730f17023a6dee49 1 parent 47a6c7e
@stronk7 stronk7 authored
View
1  lang/en/completion.php
@@ -118,7 +118,6 @@
$string['daysafterenrolment']='Days after enrolment';
$string['durationafterenrolment']='Duration after enrolment';
$string['fraction']='Fraction';
-$string['gradetopass']='{$a} to pass';
$string['inprogress']='In progress';
$string['manualcompletionby']='Manual completion by';
$string['manualselfcompletion']='Manual self completion';
View
14 lib/completion/completion_criteria_grade.php
@@ -154,14 +154,14 @@ public function get_type_title() {
* @return string
*/
public function get_status($completion) {
- $grade = $this->get_grade($completion);
- $gradepass = round($this->gradepass, 2).'%';
+ // Cast as floats to get rid of excess decimal places
+ $grade = (float) $this->get_grade($completion);
+ $gradepass = (float) $this->gradepass;
if ($grade) {
- $grade = round($grade, 2);
- return $grade.'% ('.get_string('gradetopass', 'completion', $gradepass).')';
+ return $grade.'% ('.$gradepass.'% to pass)';
} else {
- return get_string('gradetopass', 'completion', $gradetopass);
+ return $gradepass.'% to pass';
}
}
@@ -231,10 +231,10 @@ public function get_details($completion) {
$details = array();
$details['type'] = get_string('coursegrade', 'completion');
$details['criteria'] = get_string('passinggrade', 'completion');
- $details['requirement'] = round($this->gradepass, 2).'%';
+ $details['requirement'] = ((float)$this->gradepass).'%';
$details['status'] = '';
- $grade = round($this->get_grade($completion), 2);
+ $grade = (float)$this->get_grade($completion);
if ($grade) {
$details['status'] = $grade.'%';
}
Please sign in to comment.
Something went wrong with that request. Please try again.