Fixed string issues and did other minor adjustments

This commit is contained in:
Mark Nelson 2013-06-25 11:30:45 +10:00
parent 6be22854f4
commit 1f145d6a3c
4 changed files with 13 additions and 10 deletions

View file

@ -23,10 +23,12 @@
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
$string['completiondate'] = 'Completion date';
$string['dateformat'] = 'Date format';
$string['dateformat_help'] = 'This is the format of the date that will be displayed';
$string['dateitem'] = 'Date item';
$string['dateitem_help'] = 'This will be the date that is printed on the certificate';
$string['issueddate'] = 'Issued date';
$string['pluginname'] = 'Date';
$string['numbersuffix_nd'] = 'nd';
$string['numbersuffix_rd'] = 'rd';

View file

@ -69,8 +69,8 @@ class customcert_element_date extends customcert_element_base {
public function render_form_elements($mform) {
// Get the possible date options.
$dateoptions = array();
$dateoptions[CUSTOMCERT_DATE_ISSUE] = get_string('issueddate', 'certificate');
$dateoptions[CUSTOMCERT_DATE_COMPLETION] = get_string('completiondate', 'certificate');
$dateoptions[CUSTOMCERT_DATE_ISSUE] = get_string('issueddate', 'customcertelement_date');
$dateoptions[CUSTOMCERT_DATE_COMPLETION] = get_string('completiondate', 'customcertelement_date');
$dateoptions = $dateoptions + customcert_element_grade::get_grade_items();
$mform->addElement('select', 'dateitem', get_string('dateitem', 'customcertelement_date'), $dateoptions);

View file

@ -23,6 +23,8 @@
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
$string['coursegrade'] = 'Course grade';
$string['grade'] = 'Grade';
$string['gradeitem'] = 'Grade item';
$string['gradeitem_help'] = 'The grade item you wish to display the grade of.';
$string['gradeformat'] = 'Grade format';
@ -31,5 +33,4 @@ $string['gradeitem'] = 'Grade item';
$string['gradepercent'] = 'Percentage Grade';
$string['gradepoints'] = 'Points Grade';
$string['gradeletter'] = 'Letter Grade';
$string['coursegrade'] = 'Course grade';
$string['pluginname'] = 'Grade';

View file

@ -140,14 +140,14 @@ class customcert_element_grade extends customcert_element_base {
// Create the section label depending on course format.
switch ($COURSE->format) {
case "topics":
$sectionlabel = get_string("topic");
case 'topics':
$sectionlabel = get_string('topic');
break;
case "weeks":
$sectionlabel = get_string("week");
case 'weeks':
$sectionlabel = get_string('week');
break;
default:
$sectionlabel = get_string("section");
$sectionlabel = get_string('section');
break;
}
@ -218,11 +218,11 @@ class customcert_element_grade extends customcert_element_base {
$courseitem->gradetype = GRADE_TYPE_VALUE;
$grade = new grade_grade(array('itemid' => $courseitem->id, 'userid' => $userid));
$coursegrade = grade_format_gradevalue($grade->finalgrade, $courseitem, true, $gradeformat, 2);
return get_string('coursegrade', 'certificate') . ': ' . $coursegrade;
return get_string('coursegrade', 'customcertelement_grade') . ': ' . $coursegrade;
}
} else { // Get the module grade.
if ($modinfo = self::get_mod_grade($gradeitem, $gradeformat, $userid)) {
return get_string('grade', 'certificate') . ': ' . $modinfo->gradetodisplay;
return get_string('grade', 'customcertelement_grade') . ': ' . $modinfo->gradetodisplay;
}
}