public function get_available_areas() {
        global $CFG;

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

        if ($this->get_context()->contextlevel == CONTEXT_SYSTEM) {
            if ($this->get_component() !== 'core_grading') {
                throw new coding_exception('Unsupported component at the system context');
            } else {
                return array();
            }

        } else if ($this->get_context()->contextlevel == CONTEXT_MODULE) {
            list($context, $course, $cm) = get_context_info_array($this->get_context()->id);
            return self::available_areas('mod_'.$cm->modname);

        } else {
            throw new coding_exception('Unsupported gradable area context level');
        }
    }