public function get_management_url(moodle_url $returnurl = null) {

        $this->ensure_isset(array('context', 'component'));

        if ($this->areacache) {
            $params = array('areaid' => $this->areacache->id);
        } else {
            $params = array('contextid' => $this->context->id, 'component' => $this->component);
            if ($this->area) {
                $params['area'] = $this->area;
            }
        }

        if (!is_null($returnurl)) {
            $params['returnurl'] = $returnurl->out(false);
        }

        return new moodle_url('/grade/grading/manage.php', $params);
    }