------------------------------ course/modedit.php ------------------------------ index 56bf28a..5b38259 100644 @@ -215,10 +215,16 @@ if (!empty($add)) { // do not set if mixed categories present $data->gradecat = $gradecat; } } + $item = grade_item::fetch(array('itemtype'=>'mod', 'itemmodule'=>$data->modulename, + 'iteminstance'=>$data->instance, 'courseid'=>$course->id)); + if (!empty($item->gradepass)) { + $data->gradepass = $item->gradepass; + } + $sectionname = get_section_name($course, $cw); $fullmodulename = get_string('modulename', $module->name); if ($data->section && $course->format != 'site') { $heading = new stdClass(); @@ -517,10 +523,14 @@ if ($mform->is_cancelled()) { 'iteminstance'=>$fromform->instance, 'itemnumber'=>0, 'courseid'=>$course->id))) { if ($grade_item->idnumber != $fromform->cmidnumber) { $grade_item->idnumber = $fromform->cmidnumber; $grade_item->update(); } + if ($grade_item->gradepass != $fromform->gradepass) { + $grade_item->gradepass = $fromform->gradepass; + $grade_item->update(); + } } $items = grade_item::fetch_all(array('itemtype'=>'mod', 'itemmodule'=>$fromform->modulename, 'iteminstance'=>$fromform->instance, 'courseid'=>$course->id)); -------------------------- course/moodleform_mod.php -------------------------- index b4feb9d..afc7862 100644 @@ -756,10 +756,15 @@ abstract class moodleform_mod extends moodleform { //if supports grades and grades arent being handled via ratings if (!$this->_features->rating) { $mform->addElement('modgrade', 'grade', get_string('grade')); $mform->setDefault('grade', 100); + + $mform->addElement('text', 'gradepass', get_string('gradepass', 'grades')); + $mform->setDefault('gradepass', ''); + $mform->setType('gradepass', PARAM_FLOAT); + $mform->setAdvanced('gradepass', true); } if ($this->_features->advancedgrading and !empty($this->current->_advancedgradingdata['methods']) and !empty($this->current->_advancedgradingdata['areas'])) {