Merge branch 'MDL-73633-master' of git://github.com/mihailges/moodle

This commit is contained in:
Jun Pataleta 2022-02-09 17:45:54 +08:00
commit 7d743b255d
10 changed files with 5 additions and 14 deletions

View File

@ -154,7 +154,8 @@ class secondary extends view {
*/
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"];
}
/**

View File

@ -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,

View File

@ -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 |

View File

@ -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 |

View File

@ -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"
@ -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 |
@ -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"

View File

@ -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);

View File

@ -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 |

View File

@ -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 |

View File

@ -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"
@ -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 |
@ -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"

View File

@ -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);