Skip to content

Commit

Permalink
Merge branch 'MDL-73633-master' of git://github.com/mihailges/moodle
Browse files Browse the repository at this point in the history
  • Loading branch information
junpataleta committed Feb 9, 2022
2 parents 5897242 + f8cc5c8 commit 7d743b2
Show file tree
Hide file tree
Showing 10 changed files with 5 additions and 14 deletions.
3 changes: 2 additions & 1 deletion lib/classes/navigation/views/secondary.php
Expand Up @@ -154,7 +154,8 @@ protected function get_default_course_more_menu_nodes(): array {
*/
protected function get_default_module_more_menu_nodes(): array {
return ['roleoverride', 'rolecheck', 'logreport', 'roleassign', 'filtermanage', 'backup', 'restore',
'competencybreakdown'];
'competencybreakdown', "mod_{$this->page->activityname}_useroverrides",
"mod_{$this->page->activityname}_groupoverrides"];
}

/**
Expand Down
2 changes: 1 addition & 1 deletion mod/assign/lib.php
Expand Up @@ -434,7 +434,7 @@ function assign_extend_settings_navigation(settings_navigation $settings, naviga
}

if (has_capability('mod/assign:manageoverrides', $PAGE->cm->context)) {
$url = new moodle_url('/mod/assign/overrides.php', array('cmid' => $PAGE->cm->id));
$url = new moodle_url('/mod/assign/overrides.php', array('cmid' => $PAGE->cm->id, 'mode' => 'user'));

$node = navigation_node::create(get_string('overrides', 'assign'),
$url,
Expand Down
1 change: 0 additions & 1 deletion mod/assign/tests/behat/assign_course_reset.feature
Expand Up @@ -59,7 +59,6 @@ Feature: Assign reset
Scenario: Use course reset to remove user overrides.
And I am on the "Test assignment name" Activity page logged in as teacher1
And I navigate to "Overrides" in current page administration
And I select "User overrides" from the "jump" singleselect
And I press "Add user override"
And I set the following fields to these values:
| Override user | Student1 |
Expand Down
1 change: 0 additions & 1 deletion mod/assign/tests/behat/assign_group_override.feature
Expand Up @@ -160,7 +160,6 @@ Feature: Assign group override
And I should see "Tuesday, 1 January 2030, 8:00"
And I am on the "Test assignment name" Activity page
And I navigate to "Overrides" in current page administration
And I select "User overrides" from the "jump" singleselect
And I press "Add user override"
And I set the following fields to these values:
| Override user | Student1 |
Expand Down
3 changes: 0 additions & 3 deletions mod/assign/tests/behat/assign_user_override.feature
Expand Up @@ -163,7 +163,6 @@ Feature: Assign user override
| student2 | G2 |
And I am on the "Assignment 2" Activity page logged in as teacher1
When I navigate to "Overrides" in current page administration
And I select "User overrides" from the "jump" singleselect
And I press "Add user override"
Then the "Override user" select box should contain "Sam1 Student1, student1@example.com"
And the "Override user" select box should not contain "Sam2 Student2, student2@example.com"
Expand All @@ -188,7 +187,6 @@ Feature: Assign user override
| student2 | G2 |
And I am on the "Assignment 2" Activity page logged in as admin
And I navigate to "Overrides" in current page administration
And I select "User overrides" from the "jump" singleselect
And I press "Add user override"
And I set the following fields to these values:
| Override user | Student1 |
Expand All @@ -202,7 +200,6 @@ Feature: Assign user override

And I am on the "Assignment 2" Activity page logged in as teacher1
When I navigate to "Overrides" in current page administration
And I select "User overrides" from the "jump" singleselect
Then I should see "Student1" in the ".generaltable" "css_element"
But I should not see "Student2" in the ".generaltable" "css_element"

Expand Down
2 changes: 1 addition & 1 deletion mod/lesson/lib.php
Expand Up @@ -1034,7 +1034,7 @@ function lesson_extend_settings_navigation($settings, $lessonnode) {
}

if (has_capability('mod/lesson:manageoverrides', $PAGE->cm->context)) {
$url = new moodle_url('/mod/lesson/overrides.php', array('cmid' => $PAGE->cm->id));
$url = new moodle_url('/mod/lesson/overrides.php', array('cmid' => $PAGE->cm->id, 'mode' => 'user'));
$node = navigation_node::create(get_string('overrides', 'lesson'), $url,
navigation_node::TYPE_SETTING, null, 'mod_lesson_useroverrides');
$lessonnode->add_node($node, $beforekey);
Expand Down
1 change: 0 additions & 1 deletion mod/lesson/tests/behat/lesson_course_reset.feature
Expand Up @@ -66,7 +66,6 @@ Feature: Lesson reset
Scenario: Use course reset to remove user overrides.
When I am on the "Test lesson name" "lesson activity" page
And I navigate to "Overrides" in current page administration
And I select "User overrides" from the "jump" singleselect
And I follow "Add user override"
And I set the following fields to these values:
| Override user | Student1 |
Expand Down
1 change: 0 additions & 1 deletion mod/lesson/tests/behat/lesson_group_override.feature
Expand Up @@ -295,7 +295,6 @@ Feature: Lesson group override
And I should see "Tuesday, 1 January 2030, 8:00"
And I am on the "Test lesson name" "lesson activity" page
And I navigate to "Overrides" in current page administration
And I select "User overrides" from the "jump" singleselect
And I follow "Add user override"
And I set the following fields to these values:
| Override user | Student1 |
Expand Down
3 changes: 0 additions & 3 deletions mod/lesson/tests/behat/lesson_user_override.feature
Expand Up @@ -289,7 +289,6 @@ Feature: Lesson user override
| student2 | G2 |
When I am on the "Lesson 2" "lesson activity" page logged in as teacher1
And I navigate to "Overrides" in current page administration
And I select "User overrides" from the "jump" singleselect
And I follow "Add user override"
Then the "Override user" select box should contain "Sam1 Student1, student1@example.com"
And the "Override user" select box should not contain "Sam2 Student2, student2@example.com"
Expand All @@ -313,7 +312,6 @@ Feature: Lesson user override
| student2 | G2 |
And I am on the "Lesson 2" "lesson activity" page logged in as admin
And I navigate to "Overrides" in current page administration
And I select "User overrides" from the "jump" singleselect
And I follow "Add user override"
And I set the following fields to these values:
| Override user | Student1 |
Expand All @@ -336,7 +334,6 @@ Feature: Lesson user override
And I log out
When I am on the "Lesson 2" "lesson activity" page logged in as teacher1
And I navigate to "Overrides" in current page administration
And I select "User overrides" from the "jump" singleselect
Then I should see "Student1" in the ".generaltable" "css_element"
And I should not see "Student2" in the ".generaltable" "css_element"

Expand Down
2 changes: 1 addition & 1 deletion mod/quiz/lib.php
Expand Up @@ -1724,7 +1724,7 @@ function quiz_extend_settings_navigation($settings, $quiznode) {
}

if (has_any_capability(['mod/quiz:manageoverrides', 'mod/quiz:viewoverrides'], $PAGE->cm->context)) {
$url = new moodle_url('/mod/quiz/overrides.php', array('cmid' => $PAGE->cm->id));
$url = new moodle_url('/mod/quiz/overrides.php', array('cmid' => $PAGE->cm->id, 'mode' => 'user'));
$node = navigation_node::create(get_string('overrides', 'quiz'),
$url, navigation_node::TYPE_SETTING, null, 'mod_quiz_useroverrides');
$quiznode->add_node($node, $beforekey);
Expand Down

0 comments on commit 7d743b2

Please sign in to comment.