public function extend_settings_navigation(settings_navigation $settingsnav, navigation_node $modulenode=null) {

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

        $areas = $this->get_available_areas();

        if (empty($areas)) {
            // no money, no funny
            return;

        } else if (count($areas) == 1) {
            // make just a single node for the management screen
            $areatitle = reset($areas);
            $areaname  = key($areas);
            $this->set_area($areaname);
            $method = $this->get_active_method();
            $managementnode = $modulenode->add(get_string('gradingmanagement', 'core_grading'),
                $this->get_management_url(), settings_navigation::TYPE_CUSTOM);
            if ($method) {
                $controller = $this->get_controller($method);
                $controller->extend_settings_navigation($settingsnav, $managementnode);
            }

        } else {
            // make management screen node for each area
            $managementnode = $modulenode->add(get_string('gradingmanagement', 'core_grading'),
                null, settings_navigation::TYPE_CUSTOM);
            foreach ($areas as $areaname => $areatitle) {
                $this->set_area($areaname);
                $method = $this->get_active_method();
                $node = $managementnode->add($areatitle,
                    $this->get_management_url(), settings_navigation::TYPE_CUSTOM);
                if ($method) {
                    $controller = $this->get_controller($method);
                    $controller->extend_settings_navigation($settingsnav, $node);
                }
            }
        }
    }