]> git.mjollnir.org Git - moodle.git/commitdiff
MDL-16913 Enabled Weight and Extra credit inputs for grade items, but not for categor...
authornicolasconnault <nicolasconnault>
Fri, 27 Feb 2009 13:43:52 +0000 (13:43 +0000)
committernicolasconnault <nicolasconnault>
Fri, 27 Feb 2009 13:43:52 +0000 (13:43 +0000)
grade/edit/tree/lib.php

index b34f91affc3ebf98c0c88cecd7d27272a0a3a445..a4929faf50922351ed1ebd76aff7988849423552 100755 (executable)
@@ -590,11 +590,10 @@ class grade_edit_tree_column_weightorextracredit extends grade_edit_tree_column
             throw new Exception('Array key (element) missing from 2nd param of grade_edit_tree_column_weightorextracredit::get_item_cell($item, $params)');
         }
 
-        $aggcoef_input = grade_edit_tree::get_weight_input($item);
         $html = '<td class="cell">';
 
-        if ($params['element']['type'] == 'categoryitem' || $params['element']['type'] == 'courseitem') {
-            $html .= $aggcoef_input;
+        if (!in_array($params['element']['object']->itemtype, array('courseitem', 'categoryitem', 'category'))) {
+            $html .= grade_edit_tree::get_weight_input($item);
         }
 
         return $html.'</td>';