How to add/view a activity specific settings by a local plugin

Re: How to add/view a activity specific settings by a local plugin

by Vitaly Potenko -
Number of replies: 0
Picture of Core developers Picture of Plugin developers
Check this out - https://docs.moodle.org/dev/Navigation_API#Local_Plugins
And here is the example code for you which adds a link to the quiz mod settings:

function local_{your_plugin}_extend_settings_navigation(settings_navigation $nav, context $context) {
    global $PAGE;

    $cm = $PAGE->cm;

    if (!$cm) {
return false;
}
if ($cm->modname != 'quiz') {
return false;
}
if (!$quizsettingsnode = $nav->find('modulesettings', navigation_node::TYPE_SETTING)) {
return false;
}

    $node = navigation_node::create('My Node', {your_url, a moodle_url object}, navigation_node::TYPE_SETTING);
$quizsettingsnode->add_node($node);
}