]> git.mjollnir.org Git - moodle.git/commitdiff
Just hiding the calculation field from the edit forms until we do something better...
authormoodler <moodler>
Mon, 6 Aug 2007 09:42:47 +0000 (09:42 +0000)
committermoodler <moodler>
Mon, 6 Aug 2007 09:42:47 +0000 (09:42 +0000)
grade/edit/tree/item_form.php
grade/edit/tree/outcomeitem_form.php

index 7c45f022b4dd14f0436b82ff809cc397ea3879b7..730ef8178de0358d900d289246fcd34c036f4e6b 100644 (file)
@@ -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']) {
index 2f16173afaea8eca38a3f21e65e8403aa53762ca..570c87a624423f44cc9bf0751c84fe19b5f1e653 100644 (file)
@@ -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);