From 4f1983cf19d8533cc49da40281dc13ac360a4510 Mon Sep 17 00:00:00 2001 From: Paolo Tramonti Date: Tue, 21 Jul 2015 17:21:53 +0200 Subject: [PATCH] Adding gradepass feature using standard functions Using the Moodle core standard_grading_coursemodule_elements() function to show the grade section in the attendance module settings. Starting from version 2.9.x this includes the gradepass feature, that permits to show, in gradebook report, the percentage of attendance in green if the grade is greater/equal than the gradepass value, otherwise is shown in red. --- mod_form.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/mod_form.php b/mod_form.php index 5704a35..9d45e13 100644 --- a/mod_form.php +++ b/mod_form.php @@ -51,8 +51,8 @@ class mod_attendance_mod_form extends moodleform_mod { $mform->addRule('name', null, 'required', null, 'client'); $mform->setDefault('name', get_string('modulename', 'attendance')); - $mform->addElement('modgrade', 'grade', get_string('grade')); - $mform->setDefault('grade', 100); + // Grade settings. + $this->standard_grading_coursemodule_elements(); $this->standard_coursemodule_elements(true); $this->add_action_buttons();