grader report MDL-19704 Added ability to hide course and category totals without hiding anything else

This commit is contained in:
Andrew Davis 2010-01-11 07:35:40 +00:00
parent 086f0e6f46
commit a25bb902f0
5 changed files with 53 additions and 55 deletions

View file

@ -214,12 +214,6 @@ class grade_item extends grade_object {
*/
public $decimals = null;
/**
* 0 if visible, 1 always hidden or date not visible until
* @var int $hidden
*/
public $hidden = 0;
/**
* Grade item lock flag. Empty if not locked, locked if any value present, usually date when item was locked. Locking prevents updating.
* @var int $locked
@ -559,30 +553,6 @@ class grade_item extends grade_object {
return $this->locktime;
}
/**
* Returns the hidden state of this grade_item
* @return boolean hidden state
*/
public function is_hidden() {
return ($this->hidden == 1 or ($this->hidden != 0 and $this->hidden > time()));
}
/**
* Check grade hidden status. Uses data from both grade item and grade.
* @return boolean true if hiddenuntil, false if not
*/
public function is_hiddenuntil() {
return $this->hidden > 1;
}
/**
* Check grade item hidden status.
* @return int 0 means visible, 1 hidden always, timestamp hidden until
*/
public function get_hidden() {
return $this->hidden;
}
/**
* Set the hidden status of grade_item and all grades, 0 mean visible, 1 always hidden, number means date to hide until.
* @param int $hidden new hidden status
@ -590,8 +560,7 @@ class grade_item extends grade_object {
* @return void
*/
public function set_hidden($hidden, $cascade=false) {
$this->hidden = $hidden;
$this->update();
parent::set_hidden($hidden, $cascade);
if ($cascade) {
if ($grades = grade_grade::fetch_all(array('itemid'=>$this->id))) {