public function set_overridden($state, $refresh = true) {
        if (empty($this->overridden) and $state) {
            $this->overridden = time();
            $this->update();
            return true;

        } else if (!empty($this->overridden) and !$state) {
            $this->overridden = 0;
            $this->update();

            if ($refresh) {
                //refresh when unlocking
                $this->grade_item->refresh_grades($this->userid);
            }

            return true;
        }
        return false;
    }
public function set_overridden($state, $refresh = true) {
        if (empty($this->overridden) and $state) {
            $this->overridden = time();
            $this->update();
            return true;

        } else if (!empty($this->overridden) and !$state) {
            $this->overridden = 0;
            $this->update();

            if ($refresh) {
                //refresh when unlocking
                $this->grade_item->refresh_grades($this->userid);
            }

            return true;
        }
        return false;
    }
public function set_overridden ( $ state , $ refresh = true ) { if ( empty ( $ this -> overridden ) and $ state ) { $ this -> overridden = time ( ) ; $ this -> update ( ) ; return true ; } else if ( ! empty ( $ this -> overridden ) and ! $ state ) { $ this -> overridden = 0 ; $ this -> update ( ) ; if ( $ refresh ) { //refresh when unlocking $ this -> grade_item -> refresh_grades ( $ this -> userid ) ; } return true ; } return false ; }
Set the overridden status of grade

@param bool $state requested overridden state
@param bool $refresh refresh grades from external activities if needed
@return bool true is db state changed
Set the overridden status of grade