# This patch file was generated by NetBeans IDE # This patch can be applied using context Tools: Apply Diff Patch action on respective folder. # It uses platform neutral UTF-8 encoding. # Above lines and this line are ignored by the patching process. Index: moodle/lib/grade/grade_category.php --- moodle/lib/grade/grade_category.php Base (1.96.2.30) +++ moodle/lib/grade/grade_category.php Locally Modified (Based On 1.96.2.30) @@ -38,7 +38,7 @@ */ var $required_fields = array('id', 'courseid', 'parent', 'depth', 'path', 'fullname', 'aggregation', 'keephigh', 'droplow', 'aggregateonlygraded', 'aggregateoutcomes', - 'aggregatesubcats', 'timecreated', 'timemodified'); + 'aggregatesubcats', 'timecreated', 'timemodified', 'hidden'); /** * The course this category belongs to. @@ -1334,25 +1334,6 @@ } /** - * Returns the hidden state/date of the associated grade_item. This method is also available in - * grade_item. - * @return boolean - */ - function is_hidden() { - $this->load_grade_item(); - return $this->grade_item->is_hidden(); - } - - /** - * Check grade hidden status. Uses data from both grade item and grade. - * @return boolean true if hiddenuntil, false if not - */ - function is_hiddenuntil() { - $this->load_grade_item(); - return $this->grade_item->is_hiddenuntil(); - } - - /** * Sets the grade_item's hidden variable and updates the grade_item. * Method named after grade_item::set_hidden(). * @param int $hidden 0, 1 or a timestamp int(10) after which date the item will be hidden. @@ -1361,7 +1342,11 @@ */ function set_hidden($hidden, $cascade=false) { $this->load_grade_item(); + //this hides the associated grade item (the course total) $this->grade_item->set_hidden($hidden); + //this hides the category itself and everything it contains + parent::set_hidden($hidden, $cascade); + if ($cascade) { if ($children = grade_item::fetch_all(array('categoryid'=>$this->id))) { foreach($children as $child) {