MDL-86621 core_question: remove incorrect navigation nodes.
This commit is contained in:
@@ -0,0 +1,36 @@
|
||||
@block @block_navigation
|
||||
Feature: Test that admin can see related nodes in Administration block
|
||||
In order to manage
|
||||
As an admin
|
||||
I need to be able to see related nodes in Administration block
|
||||
|
||||
Background:
|
||||
Given the following "categories" exist:
|
||||
| name | category | idnumber | visible |
|
||||
| cat1 | 0 | cat1 | 1 |
|
||||
And the following "courses" exist:
|
||||
| fullname | shortname | category | visible |
|
||||
| Course 1 | c1 | cat1 | 1 |
|
||||
And the following config values are set as admin:
|
||||
| unaddableblocks | | theme_boost |
|
||||
And I log in as "admin"
|
||||
And I am on site homepage
|
||||
And I turn editing mode on
|
||||
And I add the "Administration" block if not present
|
||||
And I configure the "Administration" block
|
||||
And I set the following fields to these values:
|
||||
| Page contexts | Display throughout the entire site |
|
||||
And I press "Save changes"
|
||||
|
||||
@javascript
|
||||
Scenario: As admin I must not see question related nodes in Administration.
|
||||
Given the following "activities" exist:
|
||||
| activity | name | intro | course | idnumber |
|
||||
| quiz | Quiz 1 | Quiz 1 for testing the Add menu | c1 | quiz1 |
|
||||
And I am on "Course 1" course homepage
|
||||
Then I should see "Question bank"
|
||||
And I should not see "Questions"
|
||||
And I am on the "Quiz 1" "mod_quiz > view" page
|
||||
And "Question bank" "link" should exist
|
||||
And "Questions" "link" should exist
|
||||
And "Categories" "link" should exist
|
||||
@@ -596,7 +596,7 @@ class settings_navigation extends navigation_node {
|
||||
// Questions.
|
||||
require_once($CFG->libdir . '/questionlib.php');
|
||||
$baseurl = \core_question\local\bank\question_bank_helper::get_url_for_qbank_list($course->id);
|
||||
question_extend_settings_navigation($coursenode, $coursecontext, $baseurl)->trim_if_empty();
|
||||
question_extend_settings_navigation($coursenode, $coursecontext, $baseurl);
|
||||
|
||||
if ($adminoptions->update) {
|
||||
// Repository Instances.
|
||||
@@ -1834,7 +1834,7 @@ class settings_navigation extends navigation_node {
|
||||
// Questions.
|
||||
require_once($CFG->libdir . '/questionlib.php');
|
||||
$baseurl = \core_question\local\bank\question_bank_helper::get_url_for_qbank_list($course->id);
|
||||
question_extend_settings_navigation($frontpage, $coursecontext, $baseurl)->trim_if_empty();
|
||||
question_extend_settings_navigation($frontpage, $coursecontext, $baseurl);
|
||||
|
||||
// Manage files.
|
||||
if ($adminoptions->files) {
|
||||
|
||||
@@ -1417,7 +1417,13 @@ function question_extend_settings_navigation(navigation_node $navigationnode, $c
|
||||
$iscourse = $context->contextlevel === CONTEXT_COURSE;
|
||||
|
||||
if ($iscourse) {
|
||||
$params = ['courseid' => $context->instanceid];
|
||||
return $navigationnode->add(
|
||||
get_string('questionbank_plural', 'question'),
|
||||
new moodle_url($baseurl, ['courseid' => $context->instanceid]),
|
||||
navigation_node::TYPE_CONTAINER,
|
||||
null,
|
||||
'questionbank'
|
||||
);
|
||||
} else if ($context->contextlevel == CONTEXT_MODULE) {
|
||||
$params = ['cmid' => $context->instanceid];
|
||||
} else {
|
||||
@@ -1428,8 +1434,13 @@ function question_extend_settings_navigation(navigation_node $navigationnode, $c
|
||||
$params['cat'] = $cat;
|
||||
}
|
||||
|
||||
$questionnode = $navigationnode->add(get_string($iscourse ? 'questionbank_plural' : 'questionbank', 'question'),
|
||||
new moodle_url($baseurl, $params), navigation_node::TYPE_CONTAINER, null, 'questionbank');
|
||||
$questionnode = $navigationnode->add(
|
||||
get_string('questionbank', 'question'),
|
||||
new moodle_url($baseurl, $params),
|
||||
navigation_node::TYPE_CONTAINER,
|
||||
null,
|
||||
'questionbank'
|
||||
);
|
||||
|
||||
$corenavigations = [
|
||||
'questions' => [
|
||||
|
||||
Reference in New Issue
Block a user