From: moodler Date: Mon, 6 Aug 2007 09:42:47 +0000 (+0000) Subject: Just hiding the calculation field from the edit forms until we do something better... X-Git-Url: http://git.mjollnir.org/gw?a=commitdiff_plain;h=e754b3e05837faa81eed72dcaebea3249814f8dd;p=moodle.git Just hiding the calculation field from the edit forms until we do something better with it. Inthe meantime, use the main calcualtion form. --- diff --git a/grade/edit/tree/item_form.php b/grade/edit/tree/item_form.php index 7c45f022b4..730ef8178d 100644 --- a/grade/edit/tree/item_form.php +++ b/grade/edit/tree/item_form.php @@ -23,9 +23,9 @@ class edit_item_form extends moodleform { $mform->addElement('select', 'gradetype', get_string('gradetype', 'grades'), $options); $mform->setDefault('gradetype', GRADE_TYPE_VALUE); - $mform->addElement('text', 'calculation', get_string('calculation', 'grades')); - $mform->disabledIf('calculation', 'gradetype', 'eq', GRADE_TYPE_TEXT); - $mform->disabledIf('calculation', 'gradetype', 'eq', GRADE_TYPE_NONE); + //$mform->addElement('text', 'calculation', get_string('calculation', 'grades')); + //$mform->disabledIf('calculation', 'gradetype', 'eq', GRADE_TYPE_TEXT); + //$mform->disabledIf('calculation', 'gradetype', 'eq', GRADE_TYPE_NONE); $options = array(0=>get_string('usenoscale', 'grades')); if ($scales = get_records('scale')) { @@ -130,7 +130,7 @@ class edit_item_form extends moodleform { if ($grade_item->is_normal_item()) { // following items are set up from modules and should not be overrided by user $mform->hardFreeze('itemname,idnumber,gradetype,grademax,grademin,scaleid'); - $mform->removeElement('calculation'); + //$mform->removeElement('calculation'); } else if ($grade_item->is_manual_item()) { // manual grade item does not use these - uses only final grades @@ -190,6 +190,7 @@ class edit_item_form extends moodleform { } } + /* if (array_key_exists('calculation', $data) and $data['calculation'] != '') { $grade_item = new grade_item(array('id'=>$data['id'], 'itemtype'=>$data['itemtype'], 'courseid'=>$data['courseid'])); $result = $grade_item->validate_formula($data['calculation']); @@ -197,6 +198,7 @@ class edit_item_form extends moodleform { $errors['calculation'] = $result; } } + */ if (array_key_exists('grademin', $data) and array_key_exists('grademax', $data)) { if ($data['grademax'] == $data['grademin'] or $data['grademax'] < $data['grademin']) { diff --git a/grade/edit/tree/outcomeitem_form.php b/grade/edit/tree/outcomeitem_form.php index 2f16173afa..570c87a624 100644 --- a/grade/edit/tree/outcomeitem_form.php +++ b/grade/edit/tree/outcomeitem_form.php @@ -37,8 +37,7 @@ class edit_outcomeitem_form extends moodleform { $mform->addElement('select', 'cmid', get_string('linkedactivity', 'grades'), $options); $mform->setDefault('cmid', 0); - - $mform->addElement('text', 'calculation', get_string('calculation', 'grades')); + //$mform->addElement('text', 'calculation', get_string('calculation', 'grades')); $mform->addElement('text', 'aggregationcoef', get_string('aggregationcoef', 'grades')); $mform->setDefault('aggregationcoef', 0.0);