Details
-
Type:
Bug
-
Status:
Open
-
Priority:
Major
-
Resolution: Unresolved
-
Affects Version/s: 1.9.2
-
Fix Version/s: None
-
Component/s: Module: Certificate
-
Labels:
-
Database:Any
-
Affected Branches:MOODLE_19_STABLE
Description
When locking certificate issuance to a minimum course grade the select box uses percentages. However, when actually determining whether the certificate should be issued, the certificate uses points instead of the course percentage. Language file also needs to be updated since $coursegrade->percentage includes "%" in string. This is a problem at least in the 1.9 version (1.7 worked fine), version date 2008080901, version number 3.1.9. Below code seems to fix it.
--in lib.php--
LINE 1384: if ($certificate->requiredgrade > $coursegrade->points) {
> SHOULD BE: if ($certificate>requiredgrade > $coursegrade->percentage) {
LINE 1385: $a->current = $coursegrade->points;
> SHOULD BE: $a>current = $coursegrade->percentage;
--in lang/en_utf8/certificate.php--
LINE 101: $string['errorlockgradecourse'] = 'Your current course grade ($a->current%%) is below the grade required ($a->needed%%) to receive your certificate.';
-> SHOULD BE: $string['errorlockgradecourse'] = 'Your current course grade ($a->current) is below the grade required ($a->needed%%) to receive your certificate.';
Duh, it makes more sense to use abs():
1385: if ($certificate->requiredgrade > abs($coursegrade->percentage)) {
1386: $a->current = abs($coursegrade->percentage);
and lang/.../certificate.php needn't be changed at all.