diff --git a/admin/search.php b/admin/search.php
index 1bcf3c38c17..e54fb30fb63 100644
--- a/admin/search.php
+++ b/admin/search.php
@@ -59,7 +59,7 @@ if ($data = data_submitted() and confirm_sesskey() and isset($data->action) and
}
}
-$PAGE->has_secondary_navigation_setter(false);
+$PAGE->set_primary_active_tab('siteadminnode');
// and finally, if we get here, then there are matching settings and we have to print a form
// to modify them
diff --git a/admin/tool/behat/tests/behat/data_generators.feature b/admin/tool/behat/tests/behat/data_generators.feature
index ea5d19e743b..a54c5466742 100644
--- a/admin/tool/behat/tests/behat/data_generators.feature
+++ b/admin/tool/behat/tests/behat/data_generators.feature
@@ -385,6 +385,7 @@ Feature: Set up contextual data for tests
| enableoutcomes | 1 |
When I log in as "admin"
And I am on "Course 1" course homepage
+ And I navigate to "Grades" in current page administration
And I follow "Outcomes"
Then I should see "Grade outcome 1" in the "#addoutcomes" "css_element"
And I should see "Grade outcome 2" in the "#removeoutcomes" "css_element"
diff --git a/admin/tool/dataprivacy/tests/behat/manage_defaults.feature b/admin/tool/dataprivacy/tests/behat/manage_defaults.feature
index 0bb5e755965..6f884e3c51d 100644
--- a/admin/tool/dataprivacy/tests/behat/manage_defaults.feature
+++ b/admin/tool/dataprivacy/tests/behat/manage_defaults.feature
@@ -49,7 +49,7 @@ Feature: Manage data registry defaults
And the field "categoryid" matches value "Not set (use the default value)"
And the field "purposeid" matches value "Not set (use the default value)"
And I should see "3 years"
- And I click on "Courses" "link"
+ And I click on "Courses" "link" in the ".data-registry" "css_element"
And I wait until the page is ready
And I click on "Physics 101" "link"
And I wait until the page is ready
@@ -80,7 +80,7 @@ Feature: Manage data registry defaults
Then the field "categoryid" matches value "Category 2"
And the field "purposeid" matches value "Purpose 2"
And I should see "5 years"
- And I click on "Courses" "link"
+ And I click on "Courses" "link" in the ".data-registry" "css_element"
And I wait until the page is ready
# Physics 101 is also a category, so it will get the category default.
And I click on "Physics 101" "link"
@@ -102,7 +102,7 @@ Feature: Manage data registry defaults
Then the field "categoryid" matches value "Category 2"
And the field "purposeid" matches value "Purpose 2"
And I should see "5 years"
- And I click on "Courses" "link"
+ And I click on "Courses" "link" in the ".data-registry" "css_element"
And I wait until the page is ready
# Physics 101 is also a category, so it will get the category default.
And I click on "Physics 101" "link"
@@ -138,7 +138,7 @@ Feature: Manage data registry defaults
Given I set the category and purpose for the course "Physics 101" to "Category 2" and "Purpose 2"
And I navigate to "Users > Privacy and policies > Data registry" in site administration
And I click on "Set defaults" "link"
- And I click on "Courses" "link"
+ And I click on "Courses" "link" in the "#region-main" "css_element"
And I should see "Inherit"
And I should not see "Add a new module default"
And I press "Edit"
@@ -150,7 +150,7 @@ Feature: Manage data registry defaults
And I navigate to "Users > Privacy and policies > Data registry" in site administration
And I click on "Science and technology" "link"
And I wait until the page is ready
- And I click on "Courses" "link"
+ And I click on "Courses" "link" in the ".data-registry" "css_element"
And I wait until the page is ready
And I click on "Physics 101" "link"
And I wait until the page is ready
@@ -168,7 +168,7 @@ Feature: Manage data registry defaults
Given I set the category and purpose for the course "Physics 101" to "Category 2" and "Purpose 2"
And I navigate to "Users > Privacy and policies > Data registry" in site administration
And I click on "Set defaults" "link"
- And I click on "Courses" "link"
+ And I click on "Courses" "link" in the "#region-main" "css_element"
And I should see "Inherit"
And I should not see "Add a new module default"
And I press "Edit"
@@ -181,7 +181,7 @@ Feature: Manage data registry defaults
And I navigate to "Users > Privacy and policies > Data registry" in site administration
And I click on "Science and technology" "link"
And I wait until the page is ready
- And I click on "Courses" "link"
+ And I click on "Courses" "link" in the ".data-registry" "css_element"
And I wait until the page is ready
And I click on "Physics 101" "link"
And I wait until the page is ready
@@ -211,7 +211,7 @@ Feature: Manage data registry defaults
And I navigate to "Users > Privacy and policies > Data registry" in site administration
And I click on "Science and technology" "link"
And I wait until the page is ready
- And I click on "Courses" "link"
+ And I click on "Courses" "link" in the ".data-registry" "css_element"
And I wait until the page is ready
And I click on "Physics 101" "link"
And I wait until the page is ready
@@ -240,7 +240,7 @@ Feature: Manage data registry defaults
And I navigate to "Users > Privacy and policies > Data registry" in site administration
And I click on "Science and technology" "link"
And I wait until the page is ready
- And I click on "Courses" "link"
+ And I click on "Courses" "link" in the ".data-registry" "css_element"
And I wait until the page is ready
And I click on "Physics 101" "link"
And I wait until the page is ready
@@ -273,7 +273,7 @@ Feature: Manage data registry defaults
And I navigate to "Users > Privacy and policies > Data registry" in site administration
And I click on "Science and technology" "link"
And I wait until the page is ready
- And I click on "Courses" "link"
+ And I click on "Courses" "link" in the ".data-registry" "css_element"
And I wait until the page is ready
And I click on "Physics 101" "link"
And I wait until the page is ready
@@ -303,7 +303,7 @@ Feature: Manage data registry defaults
And I navigate to "Users > Privacy and policies > Data registry" in site administration
And I click on "Science and technology" "link"
And I wait until the page is ready
- And I click on "Courses" "link"
+ And I click on "Courses" "link" in the ".data-registry" "css_element"
And I wait until the page is ready
And I click on "Physics 101" "link"
And I wait until the page is ready
@@ -331,7 +331,7 @@ Feature: Manage data registry defaults
And I navigate to "Users > Privacy and policies > Data registry" in site administration
And I click on "Science and technology" "link"
And I wait until the page is ready
- And I click on "Courses" "link"
+ And I click on "Courses" "link" in the ".data-registry" "css_element"
And I wait until the page is ready
And I click on "Physics 101" "link"
And I wait until the page is ready
@@ -360,7 +360,7 @@ Feature: Manage data registry defaults
And I navigate to "Users > Privacy and policies > Data registry" in site administration
And I click on "Science and technology" "link"
And I wait until the page is ready
- And I click on "Courses" "link"
+ And I click on "Courses" "link" in the ".data-registry" "css_element"
And I wait until the page is ready
And I click on "Physics 101" "link"
And I wait until the page is ready
diff --git a/admin/tool/lp/tests/behat/course_competencies.feature b/admin/tool/lp/tests/behat/course_competencies.feature
index 7d901c7a0ad..11dc3e4aa9c 100644
--- a/admin/tool/lp/tests/behat/course_competencies.feature
+++ b/admin/tool/lp/tests/behat/course_competencies.feature
@@ -25,7 +25,7 @@ Feature: See the competencies for an activity on the course competencies page.
| page | PageName1 | PageDesc1 | C1 | PAGE1 | 1 | 1 |
| page | PageName2 | PageDesc2 | C1 | PAGE2 | 1 | 1 |
And I am on the "Course 1" course page logged in as admin
- And I follow "Competencies"
+ And I navigate to "Competencies" in current page administration
And I press "Add competencies to course"
And "Competency picker" "dialogue" should be visible
And I select "Test-Comp1" of the competency tree
diff --git a/admin/tool/lp/tests/behat/plan_crud.feature b/admin/tool/lp/tests/behat/plan_crud.feature
index c5d579b9d2d..4e7554e5ea2 100644
--- a/admin/tool/lp/tests/behat/plan_crud.feature
+++ b/admin/tool/lp/tests/behat/plan_crud.feature
@@ -152,7 +152,7 @@ Feature: Manage plearning plan
And I create a course with:
| Course full name | New course fullname |
| Course short name | New course shortname |
- And I follow "Competencies"
+ And I navigate to "Competencies" in current page administration
And I press "Add competencies to course"
And "Competency picker" "dialogue" should be visible
And I select "comp1" of the competency tree
diff --git a/admin/tool/monitor/tests/behat/course_report_monitor.feature b/admin/tool/monitor/tests/behat/course_report_monitor.feature
index ad5ee2c8018..033b9ce68a7 100644
--- a/admin/tool/monitor/tests/behat/course_report_monitor.feature
+++ b/admin/tool/monitor/tests/behat/course_report_monitor.feature
@@ -22,7 +22,8 @@ Feature: In a course administration page, navigate through report page, test for
And I navigate to "Reports > Event monitoring rules" in site administration
And I click on "Enable" "link"
And I am on "Course 1" course homepage
- When I navigate to "Reports > Event monitoring rules" in current page administration
+ When I navigate to "Reports" in current page administration
+ And I select "Event monitoring rules" from the "Report type" singleselect
Then "Report" "field" should exist
And the "Report" select box should contain "Event monitoring rules"
And the field "Report" matches value "Event monitoring rules"
diff --git a/admin/tool/monitor/tests/behat/rule.feature b/admin/tool/monitor/tests/behat/rule.feature
index 822cf9672f4..221ae54df5e 100644
--- a/admin/tool/monitor/tests/behat/rule.feature
+++ b/admin/tool/monitor/tests/behat/rule.feature
@@ -18,7 +18,8 @@ Feature: tool_monitor_rule
And I navigate to "Reports > Event monitoring rules" in site administration
And I click on "Enable" "link"
And I am on "Course 1" course homepage
- And I navigate to "Reports > Event monitoring rules" in current page administration
+ And I navigate to "Reports" in current page administration
+ And I select "Event monitoring rules" from the "Report type" singleselect
And I press "Add a new rule"
And I set the following fields to these values:
| name | New rule course level |
@@ -45,7 +46,8 @@ Feature: tool_monitor_rule
Scenario: Add a rule on course level
Given I log in as "teacher1"
And I am on "Course 1" course homepage
- And I navigate to "Reports > Event monitoring rules" in current page administration
+ And I navigate to "Reports" in current page administration
+ And I select "Event monitoring rules" from the "Report type" singleselect
When I press "Add a new rule"
And I set the following fields to these values:
| name | New rule |
@@ -65,7 +67,8 @@ Feature: tool_monitor_rule
Scenario: Delete a rule on course level
Given I log in as "teacher1"
And I am on "Course 1" course homepage
- And I navigate to "Reports > Event monitoring rules" in current page administration
+ And I navigate to "Reports" in current page administration
+ And I select "Event monitoring rules" from the "Report type" singleselect
When I click on "Delete rule" "link"
Then I should see "Are you sure you want to delete the rule \"New rule course level\"?"
And I press "Continue"
@@ -75,7 +78,8 @@ Feature: tool_monitor_rule
Scenario: Edit a rule on course level
Given I log in as "teacher1"
And I am on "Course 1" course homepage
- And I navigate to "Reports > Event monitoring rules" in current page administration
+ And I navigate to "Reports" in current page administration
+ And I select "Event monitoring rules" from the "Report type" singleselect
When I click on "Edit rule" "link"
And I set the following fields to these values:
| name | New rule quiz |
@@ -94,7 +98,8 @@ Feature: tool_monitor_rule
Scenario: Duplicate a rule on course level
Given I log in as "teacher1"
And I am on "Course 1" course homepage
- And I navigate to "Reports > Event monitoring rules" in current page administration
+ And I navigate to "Reports" in current page administration
+ And I select "Event monitoring rules" from the "Report type" singleselect
When I click on "Duplicate rule" "link" in the "New rule course level" "table_row"
Then I should see "Rule successfully duplicated"
And "#toolmonitorrules_r1" "css_element" should appear before "#toolmonitorrules_r2" "css_element"
@@ -153,7 +158,8 @@ Feature: tool_monitor_rule
Scenario: Duplicate a rule on site level
Given I log in as "teacher1"
And I am on "Course 1" course homepage
- And I navigate to "Reports > Event monitoring rules" in current page administration
+ And I navigate to "Reports" in current page administration
+ And I select "Event monitoring rules" from the "Report type" singleselect
When I click on "Duplicate rule" "link" in the "New rule site level" "table_row"
Then I should see "Rule successfully duplicated"
And "#toolmonitorrules_r2" "css_element" should appear after "#toolmonitorrules_r1" "css_element"
diff --git a/admin/tool/monitor/tests/behat/subscription.feature b/admin/tool/monitor/tests/behat/subscription.feature
index c91d45a6951..3b881b4b625 100644
--- a/admin/tool/monitor/tests/behat/subscription.feature
+++ b/admin/tool/monitor/tests/behat/subscription.feature
@@ -23,7 +23,8 @@ Feature: tool_monitor_subscriptions
And I navigate to "Reports > Event monitoring rules" in site administration
And I click on "Enable" "link"
And I am on "Course 1" course homepage
- And I navigate to "Reports > Event monitoring rules" in current page administration
+ And I navigate to "Reports" in current page administration
+ And I select "Event monitoring rules" from the "Report type" singleselect
And I press "Add a new rule"
And I set the following fields to these values:
| name | New rule course level |
diff --git a/admin/tool/policy/tests/behat/consent.feature b/admin/tool/policy/tests/behat/consent.feature
index 2cd4e5b773d..edc4dcc0c88 100644
--- a/admin/tool/policy/tests/behat/consent.feature
+++ b/admin/tool/policy/tests/behat/consent.feature
@@ -465,7 +465,7 @@ Feature: User must accept policy managed by this plugin when logging in and sign
When I press "Log in as a guest"
Then I should see "If you continue browsing this website, you agree to our policies"
# Confirm when navigating, the pop-up policies are displayed.
- When I follow "Home"
+ When I am on the "My courses" page
Then I should see "If you continue browsing this website, you agree to our policies"
And I should see "This site policy"
And I should see "This guests policy"
diff --git a/admin/tool/recyclebin/tests/behat/basic_functionality.feature b/admin/tool/recyclebin/tests/behat/basic_functionality.feature
index ce29515267d..09c921f580f 100644
--- a/admin/tool/recyclebin/tests/behat/basic_functionality.feature
+++ b/admin/tool/recyclebin/tests/behat/basic_functionality.feature
@@ -124,8 +124,7 @@ Feature: Basic recycle bin functionality
Scenario: Show recycle bin on category action menu
Given I log in as "admin"
And I navigate to "Courses > Manage courses and categories" in site administration
- And I click on "Actions menu" "link"
- And I click on "Recycle bin" "link"
+ And I navigate to "Recycle bin" in current page administration
Then I should see "There are no items in the recycle bin."
@javascript
diff --git a/admin/tool/uploaduser/tests/behat/upload_users.feature b/admin/tool/uploaduser/tests/behat/upload_users.feature
index 0d1cef6e580..c6cdbce7cc9 100644
--- a/admin/tool/uploaduser/tests/behat/upload_users.feature
+++ b/admin/tool/uploaduser/tests/behat/upload_users.feature
@@ -129,16 +129,14 @@ Feature: Upload users
And I press "Upload users"
And I should see "Users created: 4"
And I press "Continue"
- And I log out
# Boost check.
- And I log in as "jonest"
- And I am on "Maths" course homepage
- And "Calendar" "link" should be visible
- And I log out
+ And I navigate to "Users > Accounts > Browse list of users" in site administration
+ And I click on ".icon[title=Edit]" "css_element" in the "jonest@example.com" "table_row"
+ And I should see "Boost"
# Classic check.
- And I log in as "reznor"
- And I am on "Maths" course homepage
- And "Calendar" "link" should not be visible
+ And I navigate to "Users > Accounts > Browse list of users" in site administration
+ And I click on ".icon[title=Edit]" "css_element" in the "reznor@example.com" "table_row"
+ And I should see "Classic"
@javascript
Scenario: Upload users setting their user theme when allowuserthemes is false
diff --git a/availability/condition/completion/tests/behat/availability_completion_previous.feature b/availability/condition/completion/tests/behat/availability_completion_previous.feature
index ae21266a7c3..bf3848f319b 100644
--- a/availability/condition/completion/tests/behat/availability_completion_previous.feature
+++ b/availability/condition/completion/tests/behat/availability_completion_previous.feature
@@ -42,6 +42,7 @@ Feature: Confirm that availability_completion works with previous activity setti
# Remove Page 2 and check Page3 depends now on Page1.
When I turn editing mode on
+ And I change window size to "large"
And I delete "Page2" activity
And I turn editing mode off
Then I should see "Not available unless: The activity Page1 is marked complete" in the "region-main" "region"
@@ -92,6 +93,7 @@ Feature: Confirm that availability_completion works with previous activity setti
# Test if I disable completion tracking on Page2 section 5 depends on Page2.
When I turn editing mode on
+ And I change window size to "large"
When I open "Page2" actions menu
And I click on "Edit settings" "link" in the "Page2" activity
And I set the following fields to these values:
@@ -120,6 +122,7 @@ Feature: Confirm that availability_completion works with previous activity setti
# Remove Page 2 and check Section 4 depends now on Page1.
When I turn editing mode on
+ And I change window size to "large"
And I delete "Page2" activity
And I turn editing mode off
Then I should see "Not available unless: The activity Page1 is marked complete" in the "region-main" "region"
@@ -160,6 +163,7 @@ Feature: Confirm that availability_completion works with previous activity setti
Scenario: Test previous activities on empty sections
Given I log in as "teacher1"
And I am on "Course 1" course homepage with editing mode on
+ And I change window size to "large"
# Set section 2 restriction to Previous Activity with completion.
When I edit the section "2"
diff --git a/badges/tests/behat/award_badge.feature b/badges/tests/behat/award_badge.feature
index e1c25e83744..6394a5f825d 100644
--- a/badges/tests/behat/award_badge.feature
+++ b/badges/tests/behat/award_badge.feature
@@ -88,7 +88,7 @@ Feature: Award badges
# Teacher 1 should have access to manage/create badges in the Badges navigation section.
When I log in as "teacher1"
And I am on "Course 1" course homepage
- And I follow "Badges"
+ And I navigate to "Badges > Manage badges" in current page administration
Then I should see "Course Badge 1"
And I should see "Course Badge 2"
And I should see "Manage badges"
diff --git a/badges/tests/behat/criteria_competency.feature b/badges/tests/behat/criteria_competency.feature
index 9f7ca5ae2c8..5e588e08bf6 100644
--- a/badges/tests/behat/criteria_competency.feature
+++ b/badges/tests/behat/criteria_competency.feature
@@ -27,8 +27,7 @@ Feature: Award badges based on competency completion
Scenario: Award badge for completing a competency in a course
# Add a competency to the course
When I am on "Course 1" course homepage
- And I follow "Competencies"
- And I press "Add competencies to course"
+ And I navigate to "Competencies > Add competencies to course" in current page administration
And "Competency picker" "dialogue" should be visible
And I select "comp1" of the competency tree
And I click on "Add" "button" in the "Competency picker" "dialogue"
@@ -58,7 +57,7 @@ Feature: Award badges based on competency completion
And I press "Continue"
# Rate the competency in the course
And I am on "Course 1" course homepage
- And I follow "Competencies"
+ And I navigate to "Competencies" in current page administration
And I click on "comp1" "link" in the "[data-region='coursecompetencies']" "css_element"
And I press "Rate"
And I set the following fields to these values:
@@ -75,8 +74,7 @@ Feature: Award badges based on competency completion
Scenario: Award badge for completing a competency in the site
# Add a competency to the course
When I am on "Course 1" course homepage
- And I follow "Competencies"
- And I press "Add competencies to course"
+ And I navigate to "Competencies > Add competencies to course" in current page administration
And "Competency picker" "dialogue" should be visible
And I select "comp1" of the competency tree
And I click on "Add" "button" in the "Competency picker" "dialogue"
@@ -110,7 +108,7 @@ Feature: Award badges based on competency completion
And I press "Continue"
# Rate the competency in the course
And I am on "Course 1" course homepage
- And I follow "Competencies"
+ And I navigate to "Competencies" in current page administration
And I click on "comp1" "link" in the "[data-region='coursecompetencies']" "css_element"
And I press "Rate"
And I set the following fields to these values:
@@ -127,8 +125,7 @@ Feature: Award badges based on competency completion
Scenario: Award badge for completing all competencies in the site
# Add a competency to the course
When I am on "Course 1" course homepage
- And I follow "Competencies"
- And I press "Add competencies to course"
+ And I navigate to "Competencies > Add competencies to course" in current page administration
And "Competency picker" "dialogue" should be visible
And I select "comp1" of the competency tree
And I click on "Add" "button" in the "Competency picker" "dialogue"
@@ -164,7 +161,7 @@ Feature: Award badges based on competency completion
And I press "Continue"
# Rate the competency in the course
And I am on "Course 1" course homepage
- And I follow "Competencies"
+ And I navigate to "Competencies" in current page administration
And I click on "comp1" "link" in the "[data-region='coursecompetencies']" "css_element"
And I press "Rate"
And I set the following fields to these values:
@@ -180,7 +177,7 @@ Feature: Award badges based on competency completion
# Rate the other competency.
And I log in as "admin"
And I am on "Course 1" course homepage
- And I follow "Competencies"
+ And I navigate to "Competencies" in current page administration
And I click on "comp2" "link" in the "[data-region='coursecompetencies']" "css_element"
And I press "Rate"
And I set the following fields to these values:
diff --git a/blocks/completionstatus/tests/behat/block_completionstatus_manual_other.feature b/blocks/completionstatus/tests/behat/block_completionstatus_manual_other.feature
index ebe242faa8c..8be0a3f92ce 100644
--- a/blocks/completionstatus/tests/behat/block_completionstatus_manual_other.feature
+++ b/blocks/completionstatus/tests/behat/block_completionstatus_manual_other.feature
@@ -36,7 +36,8 @@ Feature: Enable Block Completion in a course using manual completion by others
And I log out
And I log in as "teacher1"
And I am on "Course 1" course homepage
- And I navigate to "Reports > Course completion" in current page administration
+ And I navigate to "Reports" in current page administration
+ And I select "Course completion" from the "Report type" singleselect
And I follow "Click to mark user complete"
# Running completion task just after clicking sometimes fail, as record
# should be created before the task runs.
@@ -71,7 +72,8 @@ Feature: Enable Block Completion in a course using manual completion by others
And I log out
And I log in as "teacher1"
And I am on "Course 1" course homepage
- And I navigate to "Reports > Course completion" in current page administration
+ And I navigate to "Reports" in current page administration
+ And I select "Course completion" from the "Report type" singleselect
And I follow "Click to mark user complete"
And I log out
And I log in as "student1"
@@ -85,7 +87,8 @@ Feature: Enable Block Completion in a course using manual completion by others
And I log out
And I log in as "teacher2"
And I am on "Course 1" course homepage
- And I navigate to "Reports > Course completion" in current page administration
+ And I navigate to "Reports" in current page administration
+ And I select "Course completion" from the "Report type" singleselect
And I follow "Click to mark user complete"
# Running completion task just after clicking sometimes fail, as record
# should be created before the task runs.
diff --git a/blocks/course_summary/tests/behat/block_course_summary_frontpage.feature b/blocks/course_summary/tests/behat/block_course_summary_frontpage.feature
index ac91d6de2ea..3b7aca2a814 100644
--- a/blocks/course_summary/tests/behat/block_course_summary_frontpage.feature
+++ b/blocks/course_summary/tests/behat/block_course_summary_frontpage.feature
@@ -9,7 +9,7 @@ Feature: Course summary block used on the frontpage
And I am on site homepage
And I turn editing mode on
And I add the "Course/site summary" block
- And I navigate to "Edit settings" in current page administration
+ And I navigate to "Front page settings" in site administration
And I set the following fields to these values:
| summary | Proved the summary block works! |
And I press "Save changes"
diff --git a/blocks/tests/behat/behat_blocks.php b/blocks/tests/behat/behat_blocks.php
index 94f9b33e28e..d2f22b192e3 100644
--- a/blocks/tests/behat/behat_blocks.php
+++ b/blocks/tests/behat/behat_blocks.php
@@ -47,7 +47,7 @@ class behat_blocks extends behat_base {
*/
public function i_add_the_block($blockname) {
$addblock = get_string('addblock');
- $this->execute('behat_navigation::i_select_from_flat_navigation_drawer', $addblock);
+ $this->execute('behat_general::i_click_on_in_the', [$addblock, 'link_exact', '.block_fake', 'css_element']);
if (!$this->running_javascript()) {
$this->execute('behat_general::i_click_on_in_the', [$blockname, 'link_exact', '#region-main', 'css_element']);
@@ -121,7 +121,8 @@ class behat_blocks extends behat_base {
*/
public function the_add_block_selector_should_contain_block($blockname) {
$addblock = get_string('addblock');
- $this->execute('behat_navigation::i_select_from_flat_navigation_drawer', $addblock);
+ $this->execute('behat_general::i_click_on', [$addblock, 'link_exact']);
+
$cancelstr = get_string('cancel');
if (!$this->running_javascript()) {
@@ -141,7 +142,8 @@ class behat_blocks extends behat_base {
*/
public function the_add_block_selector_should_not_contain_block($blockname) {
$addblock = get_string('addblock');
- $this->execute('behat_navigation::i_select_from_flat_navigation_drawer', $addblock);
+ $this->execute('behat_general::i_click_on', [$addblock, 'link_exact']);
+
$cancelstr = get_string('cancel');
if (!$this->running_javascript()) {
diff --git a/blocks/tests/behat/configure_block_throughout_site.feature b/blocks/tests/behat/configure_block_throughout_site.feature
index f6cfc09be4a..fd9c4d91027 100644
--- a/blocks/tests/behat/configure_block_throughout_site.feature
+++ b/blocks/tests/behat/configure_block_throughout_site.feature
@@ -46,7 +46,7 @@ Feature: Add and configure blocks throughout the site
And I press "Save changes"
And I am on "Course 1" course homepage
# The first block matching the pattern should be top-left block
- And I should see "Comments" in the "//*[@id='region-pre' or @id='block-region-side-pre']/descendant::*[contains(concat(' ', normalize-space(@class), ' '), ' block ')]" "xpath_element"
+ And I should see "Comments" in the "//*[@id='region-pre' or @id='block-region-side-pre']/descendant::*[contains(concat(' ', normalize-space(@class), ' '), ' block_comments ')]" "xpath_element"
Scenario: Blocks on the dashboard page can have roles assigned to them
Given I log in as "manager1"
diff --git a/blocks/tests/behat/manage_blocks.feature b/blocks/tests/behat/manage_blocks.feature
index 0a2e25dd657..485a3b91068 100644
--- a/blocks/tests/behat/manage_blocks.feature
+++ b/blocks/tests/behat/manage_blocks.feature
@@ -58,7 +58,6 @@ Feature: Block appearances
And I set the following fields to these values:
| Visible | No |
And I press "Save changes"
- And I click on "Topic 1" "link"
- And I turn editing mode off
+ And I am on "Course 1" course homepage with editing mode off
And I click on "Test book name" "link" in the "region-main" "region"
Then I should not see "Comments"
diff --git a/completion/tests/behat/behat_completion.php b/completion/tests/behat/behat_completion.php
index ba99eed53a4..cecc1d89089 100644
--- a/completion/tests/behat/behat_completion.php
+++ b/completion/tests/behat/behat_completion.php
@@ -87,7 +87,8 @@ class behat_completion extends behat_base {
$reportsnode = get_string('reports');
$this->execute("behat_navigation::i_navigate_to_in_current_page_administration",
- $reportsnode . ' > ' . $completionnode);
+ $reportsnode);
+ $this->execute("behat_forms::i_select_from_the_singleselect", [$completionnode, "Report type"]);
}
/**
diff --git a/contentbank/contenttype/h5p/tests/behat/admin_upload_content.feature b/contentbank/contenttype/h5p/tests/behat/admin_upload_content.feature
index dbc596a9a15..917ecb1e098 100644
--- a/contentbank/contenttype/h5p/tests/behat/admin_upload_content.feature
+++ b/contentbank/contenttype/h5p/tests/behat/admin_upload_content.feature
@@ -50,7 +50,7 @@ Feature: H5P file upload to content bank for admins
And I navigate to "Plugins > Content bank > Manage content types" in site administration
And I click on "Disable" "icon" in the "H5P" "table_row"
And I wait until the page is ready
- When I click on "Content bank" "link"
+ When I navigate to "Plugins > Content bank" in site administration
Then I should not see "filltheblanks.h5p"
Scenario: Contents in a context are not available from other contexts
diff --git a/contentbank/contenttype/h5p/tests/behat/teacher_replace_content.feature b/contentbank/contenttype/h5p/tests/behat/teacher_replace_content.feature
index d994b6738d7..014b032aa3f 100644
--- a/contentbank/contenttype/h5p/tests/behat/teacher_replace_content.feature
+++ b/contentbank/contenttype/h5p/tests/behat/teacher_replace_content.feature
@@ -35,6 +35,8 @@ Feature: Replace H5P file from an existing content requires special capabilities
And I click on "Content bank" "link"
# Force the content deploy
And I click on "admincontent" "link"
+ And I am on "Course 1" course homepage
+ And I expand "Site pages" node
And I click on "Content bank" "link"
Scenario: Teacher can replace its own H5P files
diff --git a/contentbank/tests/behat/access_permissions.feature b/contentbank/tests/behat/access_permissions.feature
index 1b7ad49610f..e1d17c8ce67 100644
--- a/contentbank/tests/behat/access_permissions.feature
+++ b/contentbank/tests/behat/access_permissions.feature
@@ -17,7 +17,8 @@ Feature: Access permission to content Bank
Scenario: Admins access content bank
Given I log in as "admin"
- Then "Content bank" "link" should exist
+ And I am on "Course 1" course homepage
+ Then "Content bank" "link" should exist in current page administration
Scenario: Editing teachers can access content bank at course level
Given I log in as "teacher1"
diff --git a/contentbank/tests/behat/edit_content.feature b/contentbank/tests/behat/edit_content.feature
index 133b84937e3..85eaaa2e934 100644
--- a/contentbank/tests/behat/edit_content.feature
+++ b/contentbank/tests/behat/edit_content.feature
@@ -195,6 +195,6 @@ Feature: Content bank use editor feature
And I click on "Content bank" "link"
And I follow "ipsums.h5p"
Then "Edit" "link" should exist in the "region-main" "region"
- And I click on "Content bank" "link"
+ And I navigate to "Content bank" in current page administration
And I follow "filltheblanks.h5p"
Then "Edit" "link" should not exist in the "region-main" "region"
diff --git a/course/format/tests/behat/course_courseindex.feature b/course/format/tests/behat/course_courseindex.feature
index 55c831d7d1d..77f187d2bab 100644
--- a/course/format/tests/behat/course_courseindex.feature
+++ b/course/format/tests/behat/course_courseindex.feature
@@ -30,8 +30,7 @@ Feature: Course index depending on role
Given I am on the "C1" "Course" page logged in as "teacher1"
Given the "multilang" filter is "on"
And the "multilang" filter applies to "content and headings"
- And I am on the "C1" "Course" page logged in as "teacher1"
- When I click on "Side panel" "button"
+ When I am on the "C1" "Course" page logged in as "teacher1"
Then I should see "Open course index drawer"
And I am on the "Activity sample 1" "assign activity editing" page
And I set the field "Assignment name" in the "General" "fieldset" to "ActivityAktivität sample 1"
@@ -44,7 +43,6 @@ Feature: Course index depending on role
Scenario: Course index as a teacher
Given I log in as "teacher1"
And I am on "Course 1" course homepage
- And I click on "Side panel" "button"
When I click on "Open course index drawer" "button"
Then I should see "Topic 1" in the "courseindex-content" "region"
And I should see "Topic 2" in the "courseindex-content" "region"
@@ -63,7 +61,6 @@ Feature: Course index depending on role
And I log out
And I log in as "teacher1"
And I am on "Course 1" course homepage
- And I click on "Side panel" "button"
When I click on "Open course index drawer" "button"
Then I should see "Topic 1" in the "courseindex-content" "region"
And I should see "Topic 2" in the "courseindex-content" "region"
@@ -82,7 +79,6 @@ Feature: Course index depending on role
And I log out
And I log in as "student1"
And I am on "Course 1" course homepage
- And I click on "Side panel" "button"
When I click on "Open course index drawer" "button"
Then I should see "Topic 1" in the "courseindex-content" "region"
And I should not see "Topic 2" in the "courseindex-content" "region"
@@ -95,7 +91,6 @@ Feature: Course index depending on role
Scenario: Delete an activity as a teacher
Given I log in as "teacher1"
And I am on "Course 1" course homepage with editing mode on
- And I click on "Side panel" "button"
When I delete "Activity sample 2" activity
And I click on "Open course index drawer" "button"
Then I should not see "Activity sample 2" in the "courseindex-content" "region"
@@ -104,7 +99,6 @@ Feature: Course index depending on role
Scenario: Highlight sections are represented in the course index.
Given I log in as "teacher1"
And I am on "Course 1" course homepage with editing mode on
- And I click on "Side panel" "button"
And I turn section "2" highlighting on
And I click on "Open course index drawer" "button"
# Current section is only marked visually in the course index.
@@ -124,7 +118,6 @@ Feature: Course index depending on role
| book | Second activity in section 1 | Test book description | C1 | sample4 | 1 |
And I log in as "teacher1"
And I am on "Course 1" course homepage
- And I click on "Side panel" "button"
When I click on "Open course index drawer" "button"
# Sections should be opened by default.
Then I should see "Topic 1" in the "courseindex-content" "region"
@@ -174,7 +167,6 @@ Feature: Course index depending on role
@javascript
Scenario: Course index section preferences
Given I am on the "C1" "Course" page logged in as "teacher1"
- And I click on "Side panel" "button"
When I click on "Open course index drawer" "button"
Then I should see "Topic 1" in the "courseindex-content" "region"
And I should see "Activity sample 1" in the "courseindex-content" "region"
@@ -205,6 +197,7 @@ Feature: Course index depending on role
And I delete section "1"
And I click on "Delete" "button" in the ".modal" "css_element"
And I reload the page
+ And I click on "Open course index drawer" "button"
And I should not see "Activity sample 1" in the "courseindex-content" "region"
And I should see "Topic 1" in the "courseindex-content" "region"
And I should see "Activity sample 2" in the "courseindex-content" "region"
@@ -215,7 +208,6 @@ Feature: Course index depending on role
Scenario: Adding section should alter the course index
Given I log in as "teacher1"
And I am on "Course 1" course homepage with editing mode on
- And I click on "Side panel" "button"
And I click on "Open course index drawer" "button"
When I click on "Add topic after" "link" in the "Topic 4" "section"
Then I should see "Topic 5" in the "courseindex-content" "region"
@@ -224,7 +216,6 @@ Feature: Course index depending on role
Scenario: Remove a section should alter the course index
Given I log in as "teacher1"
And I am on "Course 1" course homepage with editing mode on
- And I click on "Side panel" "button"
And I click on "Open course index drawer" "button"
When I delete section "4"
Then I should not see "Topic 4" in the "courseindex-content" "region"
@@ -233,7 +224,6 @@ Feature: Course index depending on role
Scenario: Delete a previous section should alter the course index unnamed sections
Given I log in as "teacher1"
And I am on "Course 1" course homepage with editing mode on
- And I click on "Side panel" "button"
And I click on "Open course index drawer" "button"
When I delete section "1"
And I click on "Delete" "button" in the ".modal" "css_element"
diff --git a/course/format/tests/behat/courseindex_completion.feature b/course/format/tests/behat/courseindex_completion.feature
index 56e7de3e74f..afc63064798 100644
--- a/course/format/tests/behat/courseindex_completion.feature
+++ b/course/format/tests/behat/courseindex_completion.feature
@@ -26,7 +26,6 @@ Feature: Course index completion icons
@javascript
Scenario: Teacher does not see completion icons.
Given I am on the "C1" "Course" page logged in as "teacher1"
- And I click on "Side panel" "button"
When I click on "Open course index drawer" "button"
Then I should see "Topic 1" in the "courseindex-content" "region"
And I should see "Activity sample 1" in the "courseindex-content" "region"
@@ -35,7 +34,6 @@ Feature: Course index completion icons
@javascript
Scenario: User should see the completion icons
Given I am on the "C1" "Course" page logged in as "student1"
- And I click on "Side panel" "button"
When I click on "Open course index drawer" "button"
Then I should see "Topic 1" in the "courseindex-content" "region"
And I should see "Activity sample 1" in the "courseindex-content" "region"
@@ -44,7 +42,6 @@ Feature: Course index completion icons
@javascript
Scenario: Manual completion shoudl update the course index completion
Given I am on the "C1" "Course" page logged in as "student1"
- And I click on "Side panel" "button"
And I click on "Open course index drawer" "button"
And "To do" "icon" should exist in the "courseindex-content" "region"
When I press "Mark as done"
@@ -57,7 +54,6 @@ Feature: Course index completion icons
@javascript
Scenario: Refresh the page should keep the completion consistent
Given I am on the "C1" "Course" page logged in as "student1"
- And I click on "Side panel" "button"
And I click on "Open course index drawer" "button"
And "To do" "icon" should exist in the "courseindex-content" "region"
When I press "Mark as done"
@@ -72,7 +68,6 @@ Feature: Course index completion icons
| assign | Activity sample 2 | Test assignment description | C1 | sample2 | 1 | 1 | 1 |
When I am on the "sample2" "Activity" page logged in as "student1"
And I am on the "C1" "Course" page
- And I click on "Side panel" "button"
And I click on "Open course index drawer" "button"
Then "Done" "icon" should exist in the "courseindex-content" "region"
@@ -94,7 +89,6 @@ Feature: Course index completion icons
| slot | response |
| 1 | False |
When I am on the "C1" "Course" page logged in as "student1"
- And I click on "Side panel" "button"
And I click on "Open course index drawer" "button"
And "Failed" "icon" should exist in the "courseindex-content" "region"
@@ -116,6 +110,5 @@ Feature: Course index completion icons
| slot | response |
| 1 | True |
When I am on the "C1" "Course" page logged in as "student1"
- And I click on "Side panel" "button"
And I click on "Open course index drawer" "button"
And "Done" "icon" should exist in the "courseindex-content" "region"
diff --git a/course/format/tests/behat/courseindex_keyboardnav.feature b/course/format/tests/behat/courseindex_keyboardnav.feature
index 46d746a3b02..6a29fd791d2 100644
--- a/course/format/tests/behat/courseindex_keyboardnav.feature
+++ b/course/format/tests/behat/courseindex_keyboardnav.feature
@@ -17,7 +17,6 @@ Feature: Verify that courseindex is usable with the keyboard
| book | Activity sample 2 | Test book description | C1 | sample2 | 2 |
| choice | Activity sample 3 | Test choice description | C1 | sample3 | 3 |
Given I am on the "C1" "Course" page logged in as "admin"
- And I click on "Side panel" "button"
And I click on "Open course index drawer" "button"
And I should see "Topic 1" in the "courseindex-content" "region"
And the focused element is "[data-preference='drawer-open-index'] .drawertoggle" "css_element"
diff --git a/course/tests/behat/behat_course.php b/course/tests/behat/behat_course.php
index 6cb2402191c..ee3878125ba 100644
--- a/course/tests/behat/behat_course.php
+++ b/course/tests/behat/behat_course.php
@@ -1938,7 +1938,7 @@ class behat_course extends behat_base {
* @Given /^I navigate to course participants$/
*/
public function i_navigate_to_course_participants() {
- $this->execute('behat_navigation::i_select_from_flat_navigation_drawer', get_string('participants'));
+ $this->execute('behat_navigation::i_select_from_secondary_navigation', get_string('participants'));
}
/**
diff --git a/course/tests/behat/course_collapse_sections.feature b/course/tests/behat/course_collapse_sections.feature
index 16a8778ee45..79d4d83e527 100644
--- a/course/tests/behat/course_collapse_sections.feature
+++ b/course/tests/behat/course_collapse_sections.feature
@@ -155,7 +155,7 @@ Feature: Collapse course sections
| Course layout | Show one section per page |
And I press "Save and display"
And "[data-toggle=collapse]" "css_element" should not exist in the "region-main" "region"
- And I follow "Topic 2"
+ And I click on "Topic 2" "link" in the "region-main" "region"
And I should see "Assignment 2" in the "region-main" "region"
And "[data-toggle=collapse]" "css_element" should not exist in the "region-main" "region"
Then "Topic 1" "section" should not exist
@@ -178,7 +178,7 @@ Feature: Collapse course sections
| Course layout | Show one section per page |
And I press "Save and display"
And "[data-toggle=collapse]" "css_element" should not exist in the "region-main" "region"
- And I follow "8 May - 14 May"
+ And I click on "8 May - 14 May" "link" in the "region-main" "region"
And I should see "Assignment 2" in the "region-main" "region"
And "[data-toggle=collapse]" "css_element" should not exist in the "region-main" "region"
Then "1 May - 7 May" "section" should not exist
diff --git a/course/tests/behat/course_controls.feature b/course/tests/behat/course_controls.feature
index b8c22e34b22..835dd275392 100644
--- a/course/tests/behat/course_controls.feature
+++ b/course/tests/behat/course_controls.feature
@@ -27,9 +27,8 @@ Feature: Course activity controls works as expected
| user | course | role |
| teacher1 | C1 | editingteacher |
And I log in as "teacher1"
- And I am on "Course 1" course homepage
- When I follow
- And I turn editing mode on
+ And I am on "Course 1" course homepage with editing mode on
+ When I follow the breadcrumb
And I add the "Recent activity" block
And I open the action menu in "Recent activity" "block"
And I click on "Delete Recent activity block" "link"
@@ -99,9 +98,8 @@ Feature: Course activity controls works as expected
| forum | Test forum name 1 | Test forum description 1 | C1 | 0001 | 1 |
| forum | Test forum name 2 | Test forum description 2 | C1 | 0002 | 1 |
And I log in as "teacher1"
- And I am on "Course 1" course homepage
- When I follow
- And I turn editing mode on
+ And I am on "Course 1" course homepage with editing mode on
+ When I follow the breadcrumb
And I add the "Recent activity" block
And I open the action menu in "Recent activity" "block"
And I click on "Delete Recent activity block" "link"
diff --git a/course/tests/behat/course_creation.feature b/course/tests/behat/course_creation.feature
index 73ec8538cb8..40b384c6055 100644
--- a/course/tests/behat/course_creation.feature
+++ b/course/tests/behat/course_creation.feature
@@ -27,7 +27,7 @@ Feature: Managers can create courses
And I log out
And I am on the Announcements "forum activity" page logged in as student1
And "Add a new topic" "link" should not exist
- And "Forced subscription" "text" should exist in current page administration
+ And "Forced subscription" "text" should exist
Scenario: Create a course from the management interface and return to it
Given the following "courses" exist:
diff --git a/course/tests/behat/course_download_content_permissions.feature b/course/tests/behat/course_download_content_permissions.feature
index 21edbd45663..74dd85e3d84 100644
--- a/course/tests/behat/course_download_content_permissions.feature
+++ b/course/tests/behat/course_download_content_permissions.feature
@@ -27,11 +27,13 @@ Feature: Access to downloading course content can be controlled
And I navigate to "Settings" in current page administration
And I set the field "Enable download course content" to "Yes"
And I press "Save and display"
- And "Download course content" "link" should exist in current page administration
+ And I navigate to "Course administration" in current page administration
+ And "Download course content" "link" should exist
When the following config values are set as admin:
| downloadcoursecontentallowed | 0 |
And I am on "Hockey 101" course homepage
- Then "Download course content" "link" should not exist in current page administration
+ And I navigate to "Course administration" in current page administration
+ And "Download course content" "link" should not exist
And I navigate to "Settings" in current page administration
And I should not see "Enable download course content"
@@ -43,7 +45,8 @@ Feature: Access to downloading course content can be controlled
And I set the field "Enable download course content" to "Yes"
And I press "Save changes"
And I am on "Hockey 101" course homepage
- Then "Download course content" "link" should exist in current page administration
+ And I navigate to "Course administration" in current page administration
+ Then "Download course content" "link" should exist
Scenario: A teacher can enable and disable the download course content feature when it is available
Given I log in as "teacher1"
@@ -53,11 +56,13 @@ Feature: Access to downloading course content can be controlled
And I should see "Enable download course content"
And I set the field "Enable download course content" to "Yes"
And I press "Save and display"
- Then "Download course content" "link" should exist in current page administration
+ And I navigate to "Course administration" in current page administration
+ Then "Download course content" "link" should exist
And I navigate to "Settings" in current page administration
And I set the field "Enable download course content" to "No"
And I press "Save and display"
- And "Download course content" "link" should not exist in current page administration
+ And I navigate to "Course administration" in current page administration
+ And "Download course content" "link" should not exist
Scenario: Teachers require a capability to access the download course content feature or modify its availability in a course
Given I log in as "admin"
@@ -68,7 +73,8 @@ Feature: Access to downloading course content can be controlled
# Check teacher can see download option and enable dropdown.
And I log in as "teacher1"
And I am on "Hockey 101" course homepage
- And "Download course content" "link" should exist in current page administration
+ And I navigate to "Course administration" in current page administration
+ And "Download course content" "link" should exist
And I navigate to "Settings" in current page administration
And "Enable download course content" "select" should exist
And I log out
@@ -82,7 +88,8 @@ Feature: Access to downloading course content can be controlled
# Check teacher can no longer see download option, and that enable value is visible, but dropdown no longer available.
When I log in as "teacher1"
And I am on "Hockey 101" course homepage
- Then "Download course content" "link" should not exist in current page administration
+ And I navigate to "Course administration" in current page administration
+ Then "Download course content" "link" should not exist
And I navigate to "Settings" in current page administration
And I should see "Enable download course content"
And I should see "Site default (Yes)"
diff --git a/files/tests/behat/course_files.feature b/files/tests/behat/course_files.feature
index daea45c0433..c7e95c94f92 100644
--- a/files/tests/behat/course_files.feature
+++ b/files/tests/behat/course_files.feature
@@ -14,8 +14,7 @@ Feature: Course files
| legacyfilesaddallowed | 1 |
When I log in as "admin"
And I am on "Course 1" course homepage
- Then "Legacy course files" "link" should exist in current page administration
- And I navigate to "Legacy course files" in current page administration
+ Then I navigate to "Legacy course files" in current page administration
And I press "Edit legacy course files"
And "Add..." "link" should be visible
And "Create folder" "link" should be visible
@@ -30,8 +29,7 @@ Feature: Course files
| legacyfilesaddallowed | 0 |
When I log in as "admin"
And I am on "Course 1" course homepage
- Then "Legacy course files" "link" should exist in current page administration
- And I navigate to "Legacy course files" in current page administration
+ Then I navigate to "Legacy course files" in current page administration
And I press "Edit legacy course files"
And "Add..." "link" should not be visible
And "Create folder" "link" should not be visible
diff --git a/grade/grading/form/guide/tests/behat/edit_guide.feature b/grade/grading/form/guide/tests/behat/edit_guide.feature
index 7381dd0a334..1ae960f7cbb 100644
--- a/grade/grading/form/guide/tests/behat/edit_guide.feature
+++ b/grade/grading/form/guide/tests/behat/edit_guide.feature
@@ -36,6 +36,7 @@ Feature: Marking guides can be created and edited
And I press "Save and return to course"
# Defining a marking guide
When I go to "Test assignment 1 name" advanced grading definition page
+ And I change window size to "large"
And I set the following fields to these values:
| Name | Assignment 1 marking guide |
| Description | Marking guide test description |
@@ -85,7 +86,8 @@ Feature: Marking guides can be created and edited
@javascript
Scenario: Grading and viewing graded marking guide
# Grading a student.
- When I go to "Student 1" "Test assignment 1 name" activity advanced grading page
+ When I navigate to "Assignment" in current page administration
+ And I go to "Student 1" "Test assignment 1 name" activity advanced grading page
And I grade by filling the marking guide with:
| Guide criterion A | 25 | Very good |
| Guide criterion B | 20 | |
@@ -97,8 +99,7 @@ Feature: Marking guides can be created and edited
And I wait "1" seconds
Then the field "Guide criterion B criterion remark" matches value "Comment \"4\""
When I press "Save changes"
- And I follow "Edit settings"
- And I follow "Test assignment 1 name"
+ And I follow "Assignment: Test assignment 1 name"
And I follow "View all submissions"
# Checking that the user grade is correct.
Then I should see "80" in the "Student 1" "table_row"
diff --git a/grade/grading/form/rubric/tests/behat/edit_rubric.feature b/grade/grading/form/rubric/tests/behat/edit_rubric.feature
index 1172d9866e1..2c5dc289818 100644
--- a/grade/grading/form/rubric/tests/behat/edit_rubric.feature
+++ b/grade/grading/form/rubric/tests/behat/edit_rubric.feature
@@ -49,6 +49,7 @@ Feature: Rubrics can be created and edited
And I press "Save rubric and make it ready"
Then I should see "Ready for use"
# Grading two students.
+ And I navigate to "Assignment" in current page administration
And I go to "Student 1" "Test assignment 1 name" activity advanced grading page
And I grade by filling the rubric with:
| Criterion 1 | 50 | Very good |
@@ -64,6 +65,7 @@ Feature: Rubrics can be created and edited
# Checking that the user grade is correct.
And I should see "65" in the "Student 1" "table_row"
# Updating the user grade.
+ And I am on the "Test assignment 1 name" "assign activity" page
And I go to "Student 1" "Test assignment 1 name" activity advanced grading page
And I grade by filling the rubric with:
| Criterion 1 | 20 | Bad, I changed my mind |
diff --git a/grade/grading/form/rubric/tests/behat/grade_calculation.feature b/grade/grading/form/rubric/tests/behat/grade_calculation.feature
index 7eb16133014..fa62ae43670 100644
--- a/grade/grading/form/rubric/tests/behat/grade_calculation.feature
+++ b/grade/grading/form/rubric/tests/behat/grade_calculation.feature
@@ -35,6 +35,7 @@ Feature: Converting rubric score to grades
| Criterion 2 | Level 21 | 20 | Level 22 | 25 | Level 23 | 30 | | |
| Criterion 3 | Level 31 | 10 | Level 32 | 20 | | | | |
And I press "Save rubric and make it ready"
+ And I navigate to "Assignment" in current page administration
# Grading a student.
And I go to "Student 1" "Test assignment 1" activity advanced grading page
And I grade by filling the rubric with:
diff --git a/grade/grading/form/rubric/tests/behat/negative_points.feature b/grade/grading/form/rubric/tests/behat/negative_points.feature
index 363bb6feea7..4d8b1bc3411 100644
--- a/grade/grading/form/rubric/tests/behat/negative_points.feature
+++ b/grade/grading/form/rubric/tests/behat/negative_points.feature
@@ -39,18 +39,21 @@ Feature: Rubrics can have levels with negative scores
| Criterion 3 | Level 31 | 10 | Level 32 | 20 | | | | |
And I press "Save rubric and make it ready"
# Grading a student.
+ And I navigate to "Assignment" in current page administration
And I go to "Student 1" "Test assignment 1" activity advanced grading page
And I grade by filling the rubric with:
| Criterion 1 | 25 | |
| Criterion 2 | 30 | |
| Criterion 3 | 10 | |
And I save the advanced grading form
+ And I am on the "Test assignment 1" "assign activity" page
And I go to "Student 2" "Test assignment 1" activity advanced grading page
And I grade by filling the rubric with:
| Criterion 1 | 25 | |
| Criterion 2 | -20 | |
| Criterion 3 | 10 | |
And I save the advanced grading form
+ And I am on the "Test assignment 1" "assign activity" page
And I go to "Student 3" "Test assignment 1" activity advanced grading page
And I grade by filling the rubric with:
| Criterion 1 | -11 | |
diff --git a/grade/grading/tests/behat/behat_grading.php b/grade/grading/tests/behat/behat_grading.php
index 54c2a450ca5..5ee23b1d0db 100644
--- a/grade/grading/tests/behat/behat_grading.php
+++ b/grade/grading/tests/behat/behat_grading.php
@@ -47,7 +47,11 @@ class behat_grading extends behat_base {
*/
public function i_go_to_advanced_grading_page($activityname) {
- $this->execute("behat_general::i_click_on_in_the", [$this->escape($activityname), 'link', 'page', 'region']);
+ try {
+ $this->execute("behat_general::i_click_on_in_the", [$this->escape($activityname), 'link', 'page', 'region']);
+ } catch (Exception $e) {
+ $this->execute('behat_navigation::go_to_breadcrumb_location', $this->escape($activityname));
+ }
$this->execute('behat_navigation::i_navigate_to_in_current_page_administration',
get_string('gradingmanagement', 'grading'));
diff --git a/grade/tests/behat/behat_grade.php b/grade/tests/behat/behat_grade.php
index 02a4d1e0037..a95939db62a 100644
--- a/grade/tests/behat/behat_grade.php
+++ b/grade/tests/behat/behat_grade.php
@@ -325,7 +325,7 @@ class behat_grade extends behat_base {
// If we are not on one of the gradebook pages already, follow "Grades" link in the navigation drawer.
$xpath = '//div[contains(@class,\'grade-navigation\')]';
if (!$this->getSession()->getPage()->findAll('xpath', $xpath)) {
- $this->execute('behat_navigation::i_select_from_flat_navigation_drawer', get_string('grades'));
+ $this->execute('behat_navigation::i_select_from_secondary_navigation', get_string('grades'));
}
$this->select_in_gradebook_tabs($gradepath);
diff --git a/grade/tests/behat/grade_letter_boundary.feature b/grade/tests/behat/grade_letter_boundary.feature
index 2b0fa5bb652..c65e27b47f1 100644
--- a/grade/tests/behat/grade_letter_boundary.feature
+++ b/grade/tests/behat/grade_letter_boundary.feature
@@ -36,7 +36,8 @@ Feature: We can customise the letter boundary of a course.
And I turn editing mode on
And I give the grade "57" to the user "Student 1" for the grade item "Test assignment one"
And I press "Save changes"
- And I turn editing mode off
+ And I am on "Course 1" course homepage with editing mode off
+ And I navigate to "View > Grader report" in the course gradebook
Then the following should exist in the "user-grades" table:
| -1- | -4- | -5- |
| Student 1 | D | D |
diff --git a/grade/tests/behat/grade_letter_boundary_20160518.feature b/grade/tests/behat/grade_letter_boundary_20160518.feature
index b46c43c5ef4..bbeea47b7e3 100644
--- a/grade/tests/behat/grade_letter_boundary_20160518.feature
+++ b/grade/tests/behat/grade_letter_boundary_20160518.feature
@@ -37,7 +37,8 @@ Feature: We can customise the letter boundary of a course in gradebook version 2
And I turn editing mode on
And I give the grade "57" to the user "Student 1" for the grade item "Test assignment one"
And I press "Save changes"
- And I turn editing mode off
+ And I am on "Course 1" course homepage with editing mode off
+ And I navigate to "View > Grader report" in the course gradebook
Then the following should exist in the "user-grades" table:
| -1- | -4- | -5- |
| Student 1 | F | F |
diff --git a/index.php b/index.php
index cd37dc75907..d8c88df1258 100644
--- a/index.php
+++ b/index.php
@@ -98,6 +98,13 @@ $PAGE->set_title($SITE->fullname);
$PAGE->set_heading($SITE->fullname);
$PAGE->has_secondary_navigation_setter(false);
$courserenderer = $PAGE->get_renderer('core', 'course');
+
+if ($hassiteconfig) {
+ $editurl = new moodle_url('/course/view.php', ['id' => SITEID, 'sesskey' => sesskey()]);
+ $editbutton = $OUTPUT->edit_button($editurl);
+ $PAGE->set_button($editbutton);
+}
+
echo $OUTPUT->header();
$siteformatoptions = course_get_format($SITE)->get_format_options();
diff --git a/lib/amd/build/addblockmodal.min.js b/lib/amd/build/addblockmodal.min.js
index 830678757f5..bea876da82f 100644
--- a/lib/amd/build/addblockmodal.min.js
+++ b/lib/amd/build/addblockmodal.min.js
@@ -1,2 +1,2 @@
-define ("core/addblockmodal",["exports","core/modal_factory","core/templates","core/str","core/ajax"],function(a,b,c,d,e){"use strict";Object.defineProperty(a,"__esModule",{value:!0});a.init=void 0;b=f(b);c=f(c);e=f(e);function f(a){return a&&a.__esModule?a:{default:a}}function g(a,b,c,d,e,f,g){try{var h=a[f](g),i=h.value}catch(a){c(a);return}if(h.done){b(i)}else{Promise.resolve(i).then(d,e)}}function h(a){return function(){var b=this,c=arguments;return new Promise(function(d,e){var i=a.apply(b,c);function f(a){g(i,d,e,f,h,"next",a)}function h(a){g(i,d,e,f,h,"throw",a)}f(void 0)})}}var i={ADD_BLOCK:"[data-key=\"addblock\"]"},j=null,k=function(a,b,c){document.addEventListener("click",function(d){if(d.target.closest(i.ADD_BLOCK)){d.preventDefault();if(j){j.show()}else{l().then(function(d){j=d;var e=m(c,a,b);d.setBody(e);d.show();return e}).catch(function(){j.destroy();j=null})}}})},l=function(){return b.default.create({type:b.default.types.CANCEL,title:(0,d.get_string)("addblock")})},m=function(){var a=h(regeneratorRuntime.mark(function a(b,d,e){var f;return regeneratorRuntime.wrap(function(a){while(1){switch(a.prev=a.next){case 0:a.next=2;return n(d,e);case 2:f=a.sent;return a.abrupt("return",c.default.render("core/add_block_body",{blocks:f,url:b}));case 4:case"end":return a.stop();}}},a)}));return function(){return a.apply(this,arguments)}}(),n=function(){var a=h(regeneratorRuntime.mark(function a(b,c){var d;return regeneratorRuntime.wrap(function(a){while(1){switch(a.prev=a.next){case 0:d={methodname:"core_block_fetch_addable_blocks",args:{pagecontextid:M.cfg.contextid,pagetype:b,pagelayout:c}};return a.abrupt("return",e.default.call([d])[0]);case 2:case"end":return a.stop();}}},a)}));return function(){return a.apply(this,arguments)}}();a.init=function init(a,b,c){k(a,b,c)}});
+define ("core/addblockmodal",["exports","core/modal_factory","core/templates","core/str","core/ajax"],function(a,b,c,d,e){"use strict";Object.defineProperty(a,"__esModule",{value:!0});a.init=void 0;b=f(b);c=f(c);e=f(e);function f(a){return a&&a.__esModule?a:{default:a}}function g(a,b,c,d,e,f,g){try{var h=a[f](g),i=h.value}catch(a){c(a);return}if(h.done){b(i)}else{Promise.resolve(i).then(d,e)}}function h(a){return function(){var b=this,c=arguments;return new Promise(function(d,e){var i=a.apply(b,c);function f(a){g(i,d,e,f,h,"next",a)}function h(a){g(i,d,e,f,h,"throw",a)}f(void 0)})}}var i={ADD_BLOCK:"[data-key=\"addblock\"]"},j=null,k=function(a,b,c){document.addEventListener("click",function(d){if(d.target.closest(i.ADD_BLOCK)){d.preventDefault();if(null===c){c=d.target.closest(i.ADD_BLOCK).dataset.url}if(j){j.show()}else{l().then(function(d){j=d;var e=m(c,a,b);d.setBody(e);d.show();return e}).catch(function(){j.destroy();j=null})}}})},l=function(){return b.default.create({type:b.default.types.CANCEL,title:(0,d.get_string)("addblock")})},m=function(){var a=h(regeneratorRuntime.mark(function a(b,d,e){var f;return regeneratorRuntime.wrap(function(a){while(1){switch(a.prev=a.next){case 0:a.next=2;return n(d,e);case 2:f=a.sent;return a.abrupt("return",c.default.render("core/add_block_body",{blocks:f,url:b}));case 4:case"end":return a.stop();}}},a)}));return function(){return a.apply(this,arguments)}}(),n=function(){var a=h(regeneratorRuntime.mark(function a(b,c){var d;return regeneratorRuntime.wrap(function(a){while(1){switch(a.prev=a.next){case 0:d={methodname:"core_block_fetch_addable_blocks",args:{pagecontextid:M.cfg.contextid,pagetype:b,pagelayout:c}};return a.abrupt("return",e.default.call([d])[0]);case 2:case"end":return a.stop();}}},a)}));return function(){return a.apply(this,arguments)}}();a.init=function init(a,b){var c=2.\n\n/**\n * Show an add block modal instead of doing it on a separate page.\n *\n * @module core/addblockmodal\n * @copyright 2016 Damyon Wiese \n * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later\n */\n\nimport ModalFactory from 'core/modal_factory';\nimport Templates from 'core/templates';\nimport {get_string as getString} from 'core/str';\nimport Ajax from 'core/ajax';\n\nconst SELECTORS = {\n ADD_BLOCK: '[data-key=\"addblock\"]'\n};\n\nlet addBlockModal = null;\n\n/**\n * Register related event listeners.\n *\n * @method registerListenerEvents\n * @param {String} pageType The type of the page\n * @param {String} pageLayout The layout of the page\n * @param {String} addBlockUrl The add block URL\n */\nconst registerListenerEvents = (pageType, pageLayout, addBlockUrl) => {\n document.addEventListener('click', e => {\n\n if (e.target.closest(SELECTORS.ADD_BLOCK)) {\n e.preventDefault();\n\n if (addBlockModal) { // The 'add block' modal has been already created.\n // Display the 'add block' modal.\n addBlockModal.show();\n } else {\n buildAddBlockModal()\n .then(modal => {\n addBlockModal = modal;\n const modalBody = renderBlocks(addBlockUrl, pageType, pageLayout);\n modal.setBody(modalBody);\n modal.show();\n\n return modalBody;\n })\n .catch(() => {\n addBlockModal.destroy();\n // Unset the addBlockModal in case this is a transient error and it goes away on a relaunch.\n addBlockModal = null;\n });\n }\n }\n });\n};\n\n/**\n * Method that creates the 'add block' modal.\n *\n * @method buildAddBlockModal\n * @returns {Promise} The modal promise (modal's body will be rendered later).\n */\nconst buildAddBlockModal = () => {\n return ModalFactory.create({\n type: ModalFactory.types.CANCEL,\n title: getString('addblock')\n });\n};\n\n/**\n * Method that renders the list of available blocks.\n *\n * @method renderBlocks\n * @param {String} addBlockUrl The add block URL\n * @param {String} pageType The type of the page\n * @param {String} pageLayout The layout of the page\n * @return {Promise}\n */\nconst renderBlocks = async(addBlockUrl, pageType, pageLayout) => {\n // Fetch all addable blocks in the given page.\n const blocks = await getAddableBlocks(pageType, pageLayout);\n\n return Templates.render('core/add_block_body', {\n blocks: blocks,\n url: addBlockUrl\n });\n};\n\n/**\n * Method that fetches all addable blocks in a given page.\n *\n * @method getAddableBlocks\n * @param {String} pageType The type of the page\n * @param {String} pageLayout The layout of the page\n * @return {Promise}\n */\nconst getAddableBlocks = async(pageType, pageLayout) => {\n const request = {\n methodname: 'core_block_fetch_addable_blocks',\n args: {\n pagecontextid: M.cfg.contextid,\n pagetype: pageType,\n pagelayout: pageLayout\n },\n };\n\n return Ajax.call([request])[0];\n};\n\n/**\n * Set up the actions.\n *\n * @method init\n * @param {String} pageType The type of the page\n * @param {String} pageLayout The layout of the page\n * @param {String} addBlockUrl The add block URL\n */\nexport const init = (pageType, pageLayout, addBlockUrl) => {\n registerListenerEvents(pageType, pageLayout, addBlockUrl);\n};\n"],"file":"addblockmodal.min.js"}
\ No newline at end of file
+{"version":3,"sources":["../src/addblockmodal.js"],"names":["SELECTORS","ADD_BLOCK","addBlockModal","registerListenerEvents","pageType","pageLayout","addBlockUrl","document","addEventListener","e","target","closest","preventDefault","dataset","url","show","buildAddBlockModal","then","modal","modalBody","renderBlocks","setBody","catch","destroy","ModalFactory","create","type","types","CANCEL","title","getAddableBlocks","blocks","Templates","render","request","methodname","args","pagecontextid","M","cfg","contextid","pagetype","pagelayout","Ajax","call","init"],"mappings":"sMAuBA,OACA,OAEA,O,qXAEMA,CAAAA,CAAS,CAAG,CACdC,SAAS,CAAE,yBADG,C,CAIdC,CAAa,CAAG,I,CAUdC,CAAsB,CAAG,SAACC,CAAD,CAAWC,CAAX,CAAuBC,CAAvB,CAAuC,CAClEC,QAAQ,CAACC,gBAAT,CAA0B,OAA1B,CAAmC,SAAAC,CAAC,CAAI,CAEpC,GAAIA,CAAC,CAACC,MAAF,CAASC,OAAT,CAAiBX,CAAS,CAACC,SAA3B,CAAJ,CAA2C,CACvCQ,CAAC,CAACG,cAAF,GAEA,GAAoB,IAAhB,GAAAN,CAAJ,CAA0B,CACtBA,CAAW,CAAGG,CAAC,CAACC,MAAF,CAASC,OAAT,CAAiBX,CAAS,CAACC,SAA3B,EAAsCY,OAAtC,CAA8CC,GAC/D,CAED,GAAIZ,CAAJ,CAAmB,CAEfA,CAAa,CAACa,IAAd,EACH,CAHD,IAGO,CACHC,CAAkB,GACjBC,IADD,CACM,SAAAC,CAAK,CAAI,CACXhB,CAAa,CAAGgB,CAAhB,CACA,GAAMC,CAAAA,CAAS,CAAGC,CAAY,CAACd,CAAD,CAAcF,CAAd,CAAwBC,CAAxB,CAA9B,CACAa,CAAK,CAACG,OAAN,CAAcF,CAAd,EACAD,CAAK,CAACH,IAAN,GAEA,MAAOI,CAAAA,CACV,CARD,EASCG,KATD,CASO,UAAM,CACTpB,CAAa,CAACqB,OAAd,GAEArB,CAAa,CAAG,IACnB,CAbD,CAcH,CACJ,CACJ,CA7BD,CA8BH,C,CAQKc,CAAkB,CAAG,UAAM,CAC7B,MAAOQ,WAAaC,MAAb,CAAoB,CACvBC,IAAI,CAAEF,UAAaG,KAAb,CAAmBC,MADF,CAEvBC,KAAK,CAAE,iBAAU,UAAV,CAFgB,CAApB,CAIV,C,CAWKT,CAAY,4CAAG,WAAMd,CAAN,CAAmBF,CAAnB,CAA6BC,CAA7B,wGAEIyB,CAAAA,CAAgB,CAAC1B,CAAD,CAAWC,CAAX,CAFpB,QAEX0B,CAFW,iCAIVC,UAAUC,MAAV,CAAiB,qBAAjB,CAAwC,CAC3CF,MAAM,CAAEA,CADmC,CAE3CjB,GAAG,CAAER,CAFsC,CAAxC,CAJU,0CAAH,uD,CAkBZwB,CAAgB,4CAAG,WAAM1B,CAAN,CAAgBC,CAAhB,yFACf6B,CADe,CACL,CACZC,UAAU,CAAE,iCADA,CAEZC,IAAI,CAAE,CACFC,aAAa,CAAEC,CAAC,CAACC,GAAF,CAAMC,SADnB,CAEFC,QAAQ,CAAErC,CAFR,CAGFsC,UAAU,CAAErC,CAHV,CAFM,CADK,0BAUdsC,UAAKC,IAAL,CAAU,CAACV,CAAD,CAAV,EAAqB,CAArB,CAVc,0CAAH,uD,QAqBF,QAAPW,CAAAA,IAAO,CAACzC,CAAD,CAAWC,CAAX,CAA8C,IAAvBC,CAAAA,CAAuB,wDAAT,IAAS,CAC9DH,CAAsB,CAACC,CAAD,CAAWC,CAAX,CAAuBC,CAAvB,CACzB,C","sourcesContent":["// This file is part of Moodle - http://moodle.org/\n//\n// Moodle is free software: you can redistribute it and/or modify\n// it under the terms of the GNU General Public License as published by\n// the Free Software Foundation, either version 3 of the License, or\n// (at your option) any later version.\n//\n// Moodle is distributed in the hope that it will be useful,\n// but WITHOUT ANY WARRANTY; without even the implied warranty of\n// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n// GNU General Public License for more details.\n//\n// You should have received a copy of the GNU General Public License\n// along with Moodle. If not, see .\n\n/**\n * Show an add block modal instead of doing it on a separate page.\n *\n * @module core/addblockmodal\n * @copyright 2016 Damyon Wiese \n * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later\n */\n\nimport ModalFactory from 'core/modal_factory';\nimport Templates from 'core/templates';\nimport {get_string as getString} from 'core/str';\nimport Ajax from 'core/ajax';\n\nconst SELECTORS = {\n ADD_BLOCK: '[data-key=\"addblock\"]'\n};\n\nlet addBlockModal = null;\n\n/**\n * Register related event listeners.\n *\n * @method registerListenerEvents\n * @param {String} pageType The type of the page\n * @param {String} pageLayout The layout of the page\n * @param {String|null} addBlockUrl The add block URL\n */\nconst registerListenerEvents = (pageType, pageLayout, addBlockUrl) => {\n document.addEventListener('click', e => {\n\n if (e.target.closest(SELECTORS.ADD_BLOCK)) {\n e.preventDefault();\n\n if (addBlockUrl === null) {\n addBlockUrl = e.target.closest(SELECTORS.ADD_BLOCK).dataset.url;\n }\n\n if (addBlockModal) { // The 'add block' modal has been already created.\n // Display the 'add block' modal.\n addBlockModal.show();\n } else {\n buildAddBlockModal()\n .then(modal => {\n addBlockModal = modal;\n const modalBody = renderBlocks(addBlockUrl, pageType, pageLayout);\n modal.setBody(modalBody);\n modal.show();\n\n return modalBody;\n })\n .catch(() => {\n addBlockModal.destroy();\n // Unset the addBlockModal in case this is a transient error and it goes away on a relaunch.\n addBlockModal = null;\n });\n }\n }\n });\n};\n\n/**\n * Method that creates the 'add block' modal.\n *\n * @method buildAddBlockModal\n * @returns {Promise} The modal promise (modal's body will be rendered later).\n */\nconst buildAddBlockModal = () => {\n return ModalFactory.create({\n type: ModalFactory.types.CANCEL,\n title: getString('addblock')\n });\n};\n\n/**\n * Method that renders the list of available blocks.\n *\n * @method renderBlocks\n * @param {String} addBlockUrl The add block URL\n * @param {String} pageType The type of the page\n * @param {String} pageLayout The layout of the page\n * @return {Promise}\n */\nconst renderBlocks = async(addBlockUrl, pageType, pageLayout) => {\n // Fetch all addable blocks in the given page.\n const blocks = await getAddableBlocks(pageType, pageLayout);\n\n return Templates.render('core/add_block_body', {\n blocks: blocks,\n url: addBlockUrl\n });\n};\n\n/**\n * Method that fetches all addable blocks in a given page.\n *\n * @method getAddableBlocks\n * @param {String} pageType The type of the page\n * @param {String} pageLayout The layout of the page\n * @return {Promise}\n */\nconst getAddableBlocks = async(pageType, pageLayout) => {\n const request = {\n methodname: 'core_block_fetch_addable_blocks',\n args: {\n pagecontextid: M.cfg.contextid,\n pagetype: pageType,\n pagelayout: pageLayout\n },\n };\n\n return Ajax.call([request])[0];\n};\n\n/**\n * Set up the actions.\n *\n * @method init\n * @param {String} pageType The type of the page\n * @param {String} pageLayout The layout of the page\n * @param {String|null} addBlockUrl The add block URL\n */\nexport const init = (pageType, pageLayout, addBlockUrl = null) => {\n registerListenerEvents(pageType, pageLayout, addBlockUrl);\n};\n"],"file":"addblockmodal.min.js"}
\ No newline at end of file
diff --git a/lib/amd/src/addblockmodal.js b/lib/amd/src/addblockmodal.js
index 16b42e883f6..bf585059af1 100644
--- a/lib/amd/src/addblockmodal.js
+++ b/lib/amd/src/addblockmodal.js
@@ -38,7 +38,7 @@ let addBlockModal = null;
* @method registerListenerEvents
* @param {String} pageType The type of the page
* @param {String} pageLayout The layout of the page
- * @param {String} addBlockUrl The add block URL
+ * @param {String|null} addBlockUrl The add block URL
*/
const registerListenerEvents = (pageType, pageLayout, addBlockUrl) => {
document.addEventListener('click', e => {
@@ -46,6 +46,10 @@ const registerListenerEvents = (pageType, pageLayout, addBlockUrl) => {
if (e.target.closest(SELECTORS.ADD_BLOCK)) {
e.preventDefault();
+ if (addBlockUrl === null) {
+ addBlockUrl = e.target.closest(SELECTORS.ADD_BLOCK).dataset.url;
+ }
+
if (addBlockModal) { // The 'add block' modal has been already created.
// Display the 'add block' modal.
addBlockModal.show();
@@ -128,8 +132,8 @@ const getAddableBlocks = async(pageType, pageLayout) => {
* @method init
* @param {String} pageType The type of the page
* @param {String} pageLayout The layout of the page
- * @param {String} addBlockUrl The add block URL
+ * @param {String|null} addBlockUrl The add block URL
*/
-export const init = (pageType, pageLayout, addBlockUrl) => {
+export const init = (pageType, pageLayout, addBlockUrl = null) => {
registerListenerEvents(pageType, pageLayout, addBlockUrl);
};
diff --git a/lib/blocklib.php b/lib/blocklib.php
index 56feb707a4a..d01f0685cf4 100644
--- a/lib/blocklib.php
+++ b/lib/blocklib.php
@@ -837,12 +837,23 @@ class block_manager {
}
}
- public function add_block_at_end_of_default_region($blockname) {
+ /**
+ * When passed a block name create a new instance of the block in the specified region.
+ *
+ * @param string $blockname Name of the block to add.
+ * @param null|string $blockregion If defined add the new block to the specified region.
+ */
+ public function add_block_at_end_of_default_region($blockname, $blockregion = null) {
if (empty($this->birecordsbyregion)) {
// No blocks or block regions exist yet.
return;
}
- $defaulregion = $this->get_default_region();
+
+ if ($blockregion === null) {
+ $defaulregion = $this->get_default_region();
+ } else {
+ $defaulregion = $blockregion;
+ }
$lastcurrentblock = end($this->birecordsbyregion[$defaulregion]);
if ($lastcurrentblock) {
@@ -1458,6 +1469,8 @@ class block_manager {
global $CFG, $PAGE, $OUTPUT;
$blocktype = optional_param('bui_addblock', null, PARAM_PLUGIN);
+ $blockregion = optional_param('bui_blockregion', null, PARAM_TEXT);
+
if ($blocktype === null) {
return false;
}
@@ -1519,7 +1532,7 @@ class block_manager {
throw new moodle_exception('cannotaddthisblocktype', '', $this->page->url->out(), $blocktype);
}
- $this->add_block_at_end_of_default_region($blocktype);
+ $this->add_block_at_end_of_default_region($blocktype, $blockregion);
// If the page URL was a guess, it will contain the bui_... param, so we must make sure it is not there.
$this->page->ensure_param_not_in_url('bui_addblock');
diff --git a/lib/classes/navigation/views/secondary.php b/lib/classes/navigation/views/secondary.php
index 591a530c073..eeec8eaecbe 100644
--- a/lib/classes/navigation/views/secondary.php
+++ b/lib/classes/navigation/views/secondary.php
@@ -58,6 +58,10 @@ class secondary extends view {
'outcomes' => 2.2,
'coursecompletion' => 6,
'filtermanagement' => 9,
+ 'unenrolself' => 10,
+ 'coursetags' => 11,
+ 'download' => 12,
+ 'contextlocking' => 13,
],
];
$nodes['navigation'] = [
diff --git a/lib/enrollib.php b/lib/enrollib.php
index cd572e19d68..9e6e8a8cc5a 100644
--- a/lib/enrollib.php
+++ b/lib/enrollib.php
@@ -515,6 +515,7 @@ function enrol_add_course_navigation(navigation_node $coursenode, $course) {
if ($unenrollink = $plugin->get_unenrolself_link($instance)) {
$shortname = format_string($course->shortname, true, array('context' => $coursecontext));
$coursenode->add(get_string('unenrolme', 'core_enrol', $shortname), $unenrollink, navigation_node::TYPE_SETTING, null, 'unenrolself', new pix_icon('i/user', ''));
+ $coursenode->get('unenrolself')->set_force_into_more_menu();
break;
//TODO. deal with multiple unenrol links - not likely case, but still...
}
diff --git a/lib/navigationlib.php b/lib/navigationlib.php
index 87a7a1409e8..11189b76bef 100644
--- a/lib/navigationlib.php
+++ b/lib/navigationlib.php
@@ -844,6 +844,24 @@ class navigation_node implements renderable {
return $this->action;
}
+ /**
+ * Return an array consisting of the additional attributes for the action url.
+ *
+ * @return array Formatted array to parse in a template
+ */
+ public function actionattributes() {
+ if ($this->action instanceof action_link) {
+ return array_map(function($key, $value) {
+ return [
+ 'name' => $key,
+ 'value' => $value
+ ];
+ }, array_keys($this->action->attributes), $this->action->attributes);
+ }
+
+ return [];
+ }
+
/**
* Sets whether the node and its children should be added into a "more" menu whenever possible.
*
@@ -4100,27 +4118,8 @@ class flat_navigation extends navigation_node_collection {
$flat->icon = new pix_icon('t/preferences', '');
$this->add($flat);
}
-
- // Add-a-block in editing mode.
- if (isset($this->page->theme->addblockposition) &&
- $this->page->theme->addblockposition == BLOCK_ADDBLOCK_POSITION_FLATNAV &&
- $PAGE->user_is_editing() && $PAGE->user_can_edit_blocks()) {
- $url = new moodle_url($PAGE->url, ['bui_addblock' => '', 'sesskey' => sesskey()]);
- $addablock = navigation_node::create(get_string('addblock'), $url);
- $flat = new flat_navigation_node($addablock, 0);
- $flat->set_showdivider(true, get_string('blocksaddedit'));
- $flat->key = 'addblock';
- $flat->icon = new pix_icon('i/addblock', '');
- $this->add($flat);
-
- $addblockurl = "?{$url->get_query_string(false)}";
-
- $PAGE->requires->js_call_amd('core/addblockmodal', 'init',
- [$PAGE->pagetype, $PAGE->pagelayout, $addblockurl]);
- }
}
-
/**
* Override the parent so we can set a label for this collection if it has not been set yet.
*
@@ -4518,6 +4517,7 @@ class settings_navigation extends navigation_node {
if (!$adminoptions->update && $adminoptions->tags) {
$url = new moodle_url('/course/tags.php', array('id' => $course->id));
$coursenode->add(get_string('coursetags', 'tag'), $url, self::TYPE_SETTING, null, 'coursetags', new pix_icon('i/settings', ''));
+ $coursenode->get('coursetags')->set_force_into_more_menu();
}
// add enrol nodes
@@ -4654,6 +4654,7 @@ class settings_navigation extends navigation_node {
$coursenode->add($linkattr->displaystring, $actionlink, self::TYPE_SETTING, null, 'download',
new pix_icon('t/download', ''));
+ $coursenode->get('download')->set_force_into_more_menu();
}
// Return we are done
diff --git a/lib/templates/add_block_button.mustache b/lib/templates/add_block_button.mustache
new file mode 100644
index 00000000000..c7276dab7b5
--- /dev/null
+++ b/lib/templates/add_block_button.mustache
@@ -0,0 +1,41 @@
+{{!
+ This file is part of Moodle - http://moodle.org/
+
+ Moodle is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation, either version 3 of the License, or
+ (at your option) any later version.
+
+ Moodle is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with Moodle. If not, see .
+}}
+{{!
+ @template core/add_block_button
+
+ Template for the body of the fake 'add block' block.
+
+ Example context (json):
+ {
+ "link" : "/my/index.php?bui_addblock&bui_blockregion=content&sesskey=M3mes",
+ "escapedlink" : "?bui_addblock&bui_blockregion=content&sesskey=M3mes",
+ "pageType" : "my-index",
+ "pageLayout" : "mydashboard"
+ }
+
+}}
+
+ {{#str}}addblock{{/str}}
+
+
+
+{{#js}}
+ // Initialise the JS for the modal window which displays the blocks available to add.
+ require(['core/addblockmodal'], function(addBlockModal) {
+ addBlockModal.init('{{pageType}}', '{{pageLayout}}');
+ });
+{{/js}}
diff --git a/lib/templates/full_header.mustache b/lib/templates/full_header.mustache
index 108a0a277a2..00f44ae4a86 100644
--- a/lib/templates/full_header.mustache
+++ b/lib/templates/full_header.mustache
@@ -48,16 +48,10 @@
diff --git a/lib/tests/behat/alpha_chooser.feature b/lib/tests/behat/alpha_chooser.feature
index afd9d4556ca..7aa3d4c696f 100644
--- a/lib/tests/behat/alpha_chooser.feature
+++ b/lib/tests/behat/alpha_chooser.feature
@@ -250,7 +250,8 @@ Feature: Initials bar
And I click on "Save changes" "button"
And I log out
And I am on the "C1" "Course" page logged in as "teacher"
- And I navigate to "Reports > Activity completion" in current page administration
+ And I navigate to "Reports" in current page administration
+ And I select "Activity completion" from the "Report type" singleselect
And ".initialbarall.page-item.active" "css_element" should exist in the ".initialbar.firstinitial" "css_element"
And ".initialbarall.page-item.active" "css_element" should exist in the ".initialbar.lastinitial" "css_element"
And ".page-item.active.B" "css_element" should not exist in the ".initialbar.firstinitial" "css_element"
@@ -275,7 +276,8 @@ Feature: Initials bar
And I should see "Bstudent Astudent"
And I should not see "Cstudent Cstudent"
And I am on "Course 1" course homepage
- And I navigate to "Reports > Activity completion" in current page administration
+ And I navigate to "Reports" in current page administration
+ And I select "Activity completion" from the "Report type" singleselect
And ".initialbarall.page-item.active" "css_element" should not exist in the ".initialbar.firstinitial" "css_element"
And ".initialbarall.page-item.active" "css_element" should not exist in the ".initialbar.lastinitial" "css_element"
And ".page-item.active.B" "css_element" should exist in the ".initialbar.firstinitial" "css_element"
diff --git a/lib/tests/behat/behat_deprecated.php b/lib/tests/behat/behat_deprecated.php
index f8c3faec41f..f1690d818ac 100644
--- a/lib/tests/behat/behat_deprecated.php
+++ b/lib/tests/behat/behat_deprecated.php
@@ -81,4 +81,18 @@ class behat_deprecated extends behat_base {
throw new Exception($message);
}
+ /**
+ * Clicks link with specified id|title|alt|text in the flat navigation drawer.
+ *
+ * @When /^I select "(?P(?:[^"]|\\")*)" from flat navigation drawer$/
+ * @throws ElementNotFoundException Thrown by behat_base::find
+ * @param string $link
+ * @deprecated Since Moodle 4.0
+ */
+ public function i_select_from_flat_navigation_drawer(string $link) {
+ self::deprecated_message(['i_select_from_primary_navigation', 'i_select_from_secondary_navigation'], true);
+
+ $this->i_open_flat_navigation_drawer();
+ $this->execute('behat_general::i_click_on_in_the', [$link, 'link', '#nav-drawer', 'css_element']);
+ }
}
diff --git a/lib/tests/behat/behat_navigation.php b/lib/tests/behat/behat_navigation.php
index 88f56cb62bb..a0e405310ac 100644
--- a/lib/tests/behat/behat_navigation.php
+++ b/lib/tests/behat/behat_navigation.php
@@ -444,7 +444,9 @@ class behat_navigation extends behat_base {
$nodetext = end($nodes);
// Find administration menu.
- $menuxpath = $this->find_header_administration_menu() ?: $this->find_page_administration_menu(true);
+ if (!$menuxpath = $this->find_page_action_menu()) {
+ $menuxpath = $this->find_header_administration_menu() ?: $this->find_page_administration_menu(true);
+ }
$this->toggle_page_administration_menu($menuxpath);
$this->execute('behat_general::should_exist_in_the', [$nodetext, $selectortype, $menuxpath, 'xpath_element']);
@@ -489,7 +491,7 @@ class behat_navigation extends behat_base {
*/
public function i_navigate_to_in_site_administration($nodetext) {
$nodelist = array_map('trim', explode('>', $nodetext));
- $this->i_select_from_flat_navigation_drawer(get_string('administrationsite'));
+ $this->i_select_from_primary_navigation(get_string('administrationsite'));
$this->select_on_administration_page($nodelist);
}
@@ -911,15 +913,28 @@ class behat_navigation extends behat_base {
}
/**
- * Clicks link with specified id|title|alt|text in the flat navigation drawer.
+ * Clicks link with specified id|title|alt|text in the primary navigation
*
- * @When /^I select "(?P(?:[^"]|\\")*)" from flat navigation drawer$/
+ * @When /^I select "(?P(?:[^"]|\\")*)" from primary navigation$/
* @throws ElementNotFoundException Thrown by behat_base::find
* @param string $link
*/
- public function i_select_from_flat_navigation_drawer($link) {
- $this->i_open_flat_navigation_drawer();
- $this->execute('behat_general::i_click_on_in_the', [$link, 'link', '#nav-drawer', 'css_element']);
+ public function i_select_from_primary_navigation(string $link) {
+ $this->execute('behat_general::i_click_on_in_the',
+ [$link, 'link', '.primary-navigation .moremenu.navigation', 'css_element']
+ );
+ }
+
+ /**
+ * Clicks link with specified id|title|alt|text in the secondary navigation
+ *
+ * @throws ElementNotFoundException Thrown by behat_base::find
+ * @param string $link
+ */
+ public function i_select_from_secondary_navigation(string $link) {
+ $this->execute('behat_general::i_click_on_in_the',
+ [$link, 'link', '.secondary-navigation .moremenu.navigation', 'css_element']
+ );
}
/**
@@ -928,7 +943,9 @@ class behat_navigation extends behat_base {
protected function go_to_main_course_page() {
$url = $this->getSession()->getCurrentUrl();
if (!preg_match('|/course/view.php\?id=[\d]+$|', $url)) {
- $node = $this->find('xpath', '//header//div[@id=\'page-navbar\']//a[contains(@href,\'/course/view.php?id=\')]');
+ $node = $this->find('xpath',
+ '//header//div[@id=\'page-navbar\']//a[contains(@href,\'/course/view.php?id=\')]'
+ );
$this->execute('behat_general::i_click_on', [$node, 'NodeElement']);
}
}
@@ -993,11 +1010,16 @@ class behat_navigation extends behat_base {
// Find a link and click on it.
$linkname = behat_context_helper::escape($lastnode);
- $xpath .= '//a[contains(normalize-space(.), ' . $linkname . ')]';
- if (!$node = $this->getSession()->getPage()->find('xpath', $xpath)) {
- throw new ElementNotFoundException($this->getSession(), 'Link "' . join(' > ', $nodelist) . '"');
+ $xpathlink = $xpathbutton = $xpath;
+ $xpathlink .= '//a[contains(normalize-space(.), ' . $linkname . ')]';
+ $xpathbutton .= '//button[contains(normalize-space(.), ' . $linkname . ')]';
+ if ($node = $this->getSession()->getPage()->find('xpath', $xpathbutton)) {
+ $this->execute('behat_general::i_click_on', [$node, 'NodeElement']);
+ } else if (!$node = $this->getSession()->getPage()->find('xpath', $xpathlink)) {
+ throw new ElementNotFoundException($this->getSession(), 'Link "' . join(' > ', $nodelist) . '"');
+ } else {
+ $this->execute('behat_general::i_click_on', [$node, 'NodeElement']);
}
- $this->execute('behat_general::i_click_on', [$node, 'NodeElement']);
}
/**
@@ -1007,7 +1029,8 @@ class behat_navigation extends behat_base {
* @return null|string
*/
protected function find_header_administration_menu($mustexist = false) {
- $menuxpath = '//header[@id=\'page-header\']//div[contains(@class,\'moodle-actionmenu\')]';
+ $menuxpath = '//div[contains(@class,\'secondary-navigation\')]//nav[contains(@class,\'moremenu\')]';
+
if ($mustexist) {
$exception = new ElementNotFoundException($this->getSession(), 'Page header administration menu');
$this->find('xpath', $menuxpath, $exception);
@@ -1034,6 +1057,24 @@ class behat_navigation extends behat_base {
return $menuxpath;
}
+ /**
+ * Locates the action menu on the page (but not in the header) and returns its xpath
+ *
+ * @param null|bool $mustexist if specified throws an exception if menu is not found
+ * @return null|string
+ */
+ protected function find_page_action_menu($mustexist = false) {
+ $menuxpath = '//div[@id=\'action-menu-0-menubar\']';
+
+ if ($mustexist) {
+ $exception = new ElementNotFoundException($this->getSession(), 'Page check');
+ $this->find('xpath', $menuxpath, $exception);
+ } else if (!$this->getSession()->getPage()->find('xpath', $menuxpath)) {
+ return null;
+ }
+ return $menuxpath;
+ }
+
/**
* Toggles administration menu
*
@@ -1045,7 +1086,9 @@ class behat_navigation extends behat_base {
}
if ($menuxpath && $this->running_javascript()) {
$node = $this->find('xpath', $menuxpath . '//a[@data-toggle=\'dropdown\']');
- $this->execute('behat_general::i_click_on', [$node, 'NodeElement']);
+ if ($node->isVisible()) {
+ $this->execute('behat_general::i_click_on', [$node, 'NodeElement']);
+ }
}
}
@@ -1062,6 +1105,8 @@ class behat_navigation extends behat_base {
// Find administration menu.
if ($menuxpath = $this->find_header_administration_menu()) {
$isheader = true;
+ } else if ($menuxpath = $this->find_page_action_menu(true)) {
+ $isheader = false;
} else {
$menuxpath = $this->find_page_administration_menu(true);
$isheader = false;
@@ -1069,6 +1114,12 @@ class behat_navigation extends behat_base {
$this->execute('behat_navigation::toggle_page_administration_menu', [$menuxpath]);
+ $firstnode = $nodelist[0];
+ $firstlinkname = behat_context_helper::escape($firstnode);
+ $firstlink = $this->getSession()->getPage()->find('xpath',
+ $menuxpath . '//a[contains(normalize-space(.), ' . $firstlinkname . ')]'
+ );
+
if (!$isheader || count($nodelist) == 1) {
$lastnode = end($nodelist);
$linkname = behat_context_helper::escape($lastnode);
@@ -1077,16 +1128,32 @@ class behat_navigation extends behat_base {
$this->execute('behat_general::i_click_on', [$link, 'NodeElement']);
return;
}
+ } else if ($firstlink) {
+ $this->execute('behat_general::i_click_on', [$firstlink, 'NodeElement']);
+ array_splice($nodelist, 0, 1);
+ $this->select_on_administration_page($nodelist);
+ return;
}
if ($isheader) {
- // Course administration and Front page administration will have subnodes under "More...".
+ // Front page administration will have subnodes under "More...".
$linkname = behat_context_helper::escape(get_string('morenavigationlinks'));
- $link = $this->getSession()->getPage()->find('xpath', $menuxpath . '//a[contains(normalize-space(.), ' . $linkname . ')]');
+ $link = $this->getSession()->getPage()->find('xpath',
+ $menuxpath . '//a[contains(normalize-space(.), ' . $linkname . ')]'
+ );
+ // Course administration will have subnodes under "Course administration".
+ $courselinkname = behat_context_helper::escape(get_string('courseadministration'));
+ $courselink = $this->getSession()->getPage()->find('xpath',
+ $menuxpath . '//a[contains(normalize-space(.), ' . $courselinkname . ')]'
+ );
if ($link) {
$this->execute('behat_general::i_click_on', [$link, 'NodeElement']);
$this->select_on_administration_page($nodelist);
return;
+ } else if ($courselink) {
+ $this->execute('behat_general::i_click_on', [$courselink, 'NodeElement']);
+ $this->select_on_administration_page($nodelist);
+ return;
}
}
@@ -1115,6 +1182,7 @@ class behat_navigation extends behat_base {
* First checks to see if we are on this page via the breadcrumb. If not we then attempt to follow the link name given.
*
* @param string $pagename Name of the breadcrumb item to check and follow.
+ * @Given /^I follow the breadcrumb "(?P(?:[^"]|\\")*)"$/
*/
public function go_to_breadcrumb_location(string $pagename): void {
$link = $this->getSession()->getPage()->find(
diff --git a/mod/assign/feedback/editpdf/tests/behat/annotate_pdf.feature b/mod/assign/feedback/editpdf/tests/behat/annotate_pdf.feature
index 8ed63f4f20b..762be8cc47d 100644
--- a/mod/assign/feedback/editpdf/tests/behat/annotate_pdf.feature
+++ b/mod/assign/feedback/editpdf/tests/behat/annotate_pdf.feature
@@ -124,7 +124,5 @@ Feature: In an assignment, teacher can annotate PDF files during grading
And I draw on the pdf
And I press "Save changes"
And I should see "The changes to the grade and feedback were saved"
- And I click on "Edit settings" "link"
- And I follow "Test assignment name"
And I follow "View all submissions"
And I should see "View annotated PDF..." in the "student2@example.com" "table_row"
diff --git a/mod/assign/tests/behat/comment_inline.feature b/mod/assign/tests/behat/comment_inline.feature
index eefea929367..5088de82f4f 100644
--- a/mod/assign/tests/behat/comment_inline.feature
+++ b/mod/assign/tests/behat/comment_inline.feature
@@ -39,8 +39,6 @@ Feature: In an assignment, teachers can edit a students submission inline
| Feedback comments | I'm the teacher feedback |
And I upload "lib/tests/fixtures/empty.txt" file to "Feedback files" filemanager
And I press "Save changes"
- And I click on "Edit settings" "link"
- And I follow "Test assignment name"
And I follow "View all submissions"
Then I should see "50.00" in the "Student 1" "table_row"
And I should see "Submitted for grading" in the "Student 1" "table_row"
diff --git a/mod/assign/tests/behat/display_grade.feature b/mod/assign/tests/behat/display_grade.feature
index 24a5666884b..a57602be3b6 100644
--- a/mod/assign/tests/behat/display_grade.feature
+++ b/mod/assign/tests/behat/display_grade.feature
@@ -33,8 +33,6 @@ Feature: Check that the assignment grade can be updated correctly
And I set the field "Grade out of 100" to "50"
And I set the field "Notify students" to "0"
And I press "Save changes"
- And I click on "Edit settings" "link"
- And I follow "Test assignment name"
And I follow "View all submissions"
And "Student 1" row "Grade" column of "generaltable" table should contain "50.00"
@@ -69,7 +67,5 @@ Feature: Check that the assignment grade can be updated correctly
And I set the field "Grade out of 100" to "50"
And I set the field "Notify students" to "0"
And I press "Save changes"
- And I click on "Edit settings" "link"
- And I follow "Test assignment name"
And I follow "View all submissions"
Then "Student 1" row "Grade" column of "generaltable" table should contain "50.00"
diff --git a/mod/assign/tests/behat/grading_status.feature b/mod/assign/tests/behat/grading_status.feature
index 9c583de2de8..1a3e006748f 100644
--- a/mod/assign/tests/behat/grading_status.feature
+++ b/mod/assign/tests/behat/grading_status.feature
@@ -65,8 +65,6 @@ Feature: View the grading status of an assignment
And I should see "1 of 1"
And I set the field "Marking workflow state" to "Released"
And I press "Save changes"
- And I click on "Edit settings" "link"
- And I follow "Test assignment name"
And I follow "View all submissions"
And I should see "Released" in the "Student 1" "table_row"
And I log out
diff --git a/mod/assign/tests/behat/quickgrading.feature b/mod/assign/tests/behat/quickgrading.feature
index 9eaac14c34a..323ecba07d1 100644
--- a/mod/assign/tests/behat/quickgrading.feature
+++ b/mod/assign/tests/behat/quickgrading.feature
@@ -32,7 +32,6 @@ Feature: In an assignment, teachers grade multiple students on one page
And I follow "View all submissions"
When I click on "Grade" "link" in the "Student 1" "table_row"
And I press "Save changes"
- And I click on "Edit settings" "link"
And I follow "Test assignment name"
Then I should see "1" in the "Needs grading" "table_row"
@@ -100,8 +99,6 @@ Feature: In an assignment, teachers grade multiple students on one page
| M8d skillZ! | 1337 |
| Feedback comments | I'm the teacher first feedback |
And I press "Save changes"
- And I click on "Edit settings" "link"
- And I follow "Test assignment name"
And I follow "View all submissions"
Then I click on "Quick grading" "checkbox"
And I set the field "User grade" to "60.0"
diff --git a/mod/assign/tests/behat/rescale_grades.feature b/mod/assign/tests/behat/rescale_grades.feature
index 9bb54909807..56e05dd3c03 100644
--- a/mod/assign/tests/behat/rescale_grades.feature
+++ b/mod/assign/tests/behat/rescale_grades.feature
@@ -32,8 +32,6 @@ Feature: Check that the assignment grade can be rescaled when the max grade is c
And I click on "Grade" "link" in the "Student 1" "table_row"
And I set the field "Grade out of 100" to "40"
And I press "Save changes"
- And I follow "Edit settings"
- And I follow "Test assignment name"
And I follow "View all submissions"
And "Student 1" row "Grade" column of "generaltable" table should contain "40.00"
And I am on the "Test assignment name" "assign activity" page
diff --git a/mod/assign/tests/behat/steps_blind_marking.feature b/mod/assign/tests/behat/steps_blind_marking.feature
index 7fb4ec5c47a..689a3ef8c8d 100644
--- a/mod/assign/tests/behat/steps_blind_marking.feature
+++ b/mod/assign/tests/behat/steps_blind_marking.feature
@@ -42,8 +42,6 @@ Feature: Assignments correctly add feedback to the grade report when workflow an
And I set the field "Feedback comments" to "Great job! Lol, not really."
And I set the field "Notify students" to "0"
And I press "Save changes"
- And I click on "Edit settings" "link"
- And I follow "Test assignment name"
And I follow "View all submissions"
And I should see "In review" in the "I'm the student's first submission" "table_row"
@@ -53,15 +51,11 @@ Feature: Assignments correctly add feedback to the grade report when workflow an
And I set the field "Marking workflow state" to "Ready for release"
And I set the field "Notify students" to "0"
And I press "Save changes"
- And I click on "Edit settings" "link"
- And I follow "Test assignment name"
And I follow "View all submissions"
And I should see "Ready for release" in the "I'm the student's first submission" "table_row"
And I click on "Grade" "link" in the "I'm the student's first submission" "table_row"
And I set the field "Marking workflow state" to "Released"
And I press "Save changes"
- And I click on "Edit settings" "link"
- And I follow "Test assignment name"
And I follow "View all submissions"
And I should see "Released" in the "I'm the student's first submission" "table_row"
And I set the field "Grading action" to "Reveal student identities"
@@ -79,8 +73,6 @@ Feature: Assignments correctly add feedback to the grade report when workflow an
And I set the field "Marking workflow state" to "Ready for release"
And I set the field "Notify students" to "0"
And I press "Save changes"
- And I click on "Edit settings" "link"
- And I follow "Test assignment name"
And I follow "View all submissions"
And I should see "Ready for release" in the "I'm the student's first submission" "table_row"
And I set the field "Grading action" to "Reveal student identities"
@@ -88,8 +80,6 @@ Feature: Assignments correctly add feedback to the grade report when workflow an
And I click on "Grade" "link" in the "Student 1" "table_row"
And I set the field "Marking workflow state" to "Released"
And I press "Save changes"
- And I click on "Edit settings" "link"
- And I follow "Test assignment name"
And I follow "View all submissions"
And I should see "Released" in the "Student 1" "table_row"
And I log out
diff --git a/mod/assign/tests/behat/submission_comments.feature b/mod/assign/tests/behat/submission_comments.feature
index 071473c08b3..a2e5b78a77e 100644
--- a/mod/assign/tests/behat/submission_comments.feature
+++ b/mod/assign/tests/behat/submission_comments.feature
@@ -98,8 +98,6 @@ Feature: In an assignment, students can comment in their submissions
| Grade out of 100 | 50 |
| Feedback comments | I'm the teacher feedback |
And I press "Save changes"
- And I click on "Edit settings" "link"
- And I follow "Test assignment name"
And I follow "View all submissions"
Then I should see "50.00" in the "Student 1" "table_row"
And I should see "I'm the teacher feedback" in the "Student 1" "table_row"
diff --git a/mod/assign/view.php b/mod/assign/view.php
index 830fec3a11c..a38d6fcbce2 100644
--- a/mod/assign/view.php
+++ b/mod/assign/view.php
@@ -43,6 +43,13 @@ $urlparams = array('id' => $id,
$url = new moodle_url('/mod/assign/view.php', $urlparams);
$PAGE->set_url($url);
+// MDL-71915 Will remove this place holder.
+if (defined('BEHAT_SITE_RUNNING')) {
+ $PAGE->has_secondary_navigation_setter(false);
+ if ($urlparams['action'] !== 'grader') {
+ $PAGE->add_header_action($OUTPUT->region_main_settings_menu());
+ }
+}
// Update module completion status.
$assign->set_module_viewed();
diff --git a/mod/book/tests/behat/log_entries.feature b/mod/book/tests/behat/log_entries.feature
index fa5e0267305..9d16c31101c 100644
--- a/mod/book/tests/behat/log_entries.feature
+++ b/mod/book/tests/behat/log_entries.feature
@@ -33,35 +33,36 @@ Feature: In a book, verify log entries
And I click on "Next" "link"
And I click on "Previous" "link"
And I navigate to "Print book" in current page administration
+ And I am on the "Test book" "book activity" page
And I navigate to "Download IMS CP" in current page administration
+ And I am on the "Test book" "book activity" page
And I navigate to "Logs" in current page administration
Then I should see "Book exported"
And I should see "Book printed"
- And I should see "Chapter viewed" in the "#report_log_r2_c5" "css_element"
- And I should see "Chapter viewed" in the "#report_log_r3_c5" "css_element"
- And I should see "Chapter viewed" in the "#report_log_r4_c5" "css_element"
- And I should see "Chapter updated" in the "#report_log_r5_c5" "css_element"
And I should see "Chapter viewed" in the "#report_log_r6_c5" "css_element"
- And I should see "Chapter created" in the "#report_log_r7_c5" "css_element"
- And I should see "Chapter created" in the "#report_log_r9_c5" "css_element"
- And I click on "Chapter viewed" "link" in the "#report_log_r2_c5" "css_element"
+ And I should see "Chapter viewed" in the "#report_log_r7_c5" "css_element"
+ And I should see "Chapter viewed" in the "#report_log_r8_c5" "css_element"
+ And I should see "Chapter updated" in the "#report_log_r9_c5" "css_element"
+ And I should see "Chapter viewed" in the "#report_log_r10_c5" "css_element"
+ And I should see "Chapter created" in the "#report_log_r11_c5" "css_element"
+ And I click on "Chapter viewed" "link" in the "#report_log_r6_c5" "css_element"
And I switch to "action" window
And I change window size to "large"
And I should see "1. First chapter edited" in the ".book_content" "css_element"
And I switch to the main window
- And I click on "Chapter viewed" "link" in the "#report_log_r3_c5" "css_element"
+ And I click on "Chapter viewed" "link" in the "#report_log_r7_c5" "css_element"
And I switch to "action" window
And I should see "2. Second chapter" in the ".book_content" "css_element"
And I switch to the main window
- And I click on "Chapter updated" "link" in the "#report_log_r5_c5" "css_element"
+ And I click on "Chapter updated" "link" in the "#report_log_r9_c5" "css_element"
And I switch to "action" window
And I should see "1. First chapter edited" in the ".book_content" "css_element"
And I switch to the main window
- And I click on "Chapter created" "link" in the "#report_log_r7_c5" "css_element"
+ And I click on "Chapter created" "link" in the "#report_log_r11_c5" "css_element"
And I switch to "action" window
And I should see "2. Second chapter" in the ".book_content" "css_element"
And I switch to the main window
- And I click on "Chapter created" "link" in the "#report_log_r9_c5" "css_element"
+ And I click on "Chapter created" "link" in the "#report_log_r13_c5" "css_element"
And I switch to "action" window
And I should see "1. First chapter edited" in the ".book_content" "css_element"
And I switch to the main window
diff --git a/mod/choice/tests/behat/activity_info_completion_automatic.feature b/mod/choice/tests/behat/activity_info_completion_automatic.feature
index de7111256bc..30e228c31af 100644
--- a/mod/choice/tests/behat/activity_info_completion_automatic.feature
+++ b/mod/choice/tests/behat/activity_info_completion_automatic.feature
@@ -45,7 +45,8 @@ Feature: Automatic completion in the choice activity
@javascript
Scenario: Overriding automatic choice completion for a user
Given I am on the "Course 1" course page logged in as teacher1
- And I navigate to "Reports > Activity completion" in current page administration
+ And I navigate to "Reports" in current page administration
+ And I select "Activity completion" from the "Report type" singleselect
And I click on "Student 1, What to drink?: Not completed" "link"
And I press "Save changes"
And I log out
diff --git a/mod/choice/tests/behat/activity_info_completion_manual.feature b/mod/choice/tests/behat/activity_info_completion_manual.feature
index 92db49d5ad6..ec408b3d446 100644
--- a/mod/choice/tests/behat/activity_info_completion_manual.feature
+++ b/mod/choice/tests/behat/activity_info_completion_manual.feature
@@ -53,7 +53,8 @@ Feature: Manual completion in the choice activity
@javascript
Scenario: Overriding a manual choice completion for a user to done
Given I am on the "Course 1" course page logged in as teacher1
- And I navigate to "Reports > Activity completion" in current page administration
+ And I navigate to "Reports" in current page administration
+ And I select "Activity completion" from the "Report type" singleselect
And I click on "Student 1, What to drink?: Not completed" "link"
And I press "Save changes"
And I log out
@@ -69,7 +70,8 @@ Feature: Manual completion in the choice activity
And I wait until the page is ready
And I log out
And I am on the "Course 1" course page logged in as teacher1
- And I navigate to "Reports > Activity completion" in current page administration
+ And I navigate to "Reports" in current page administration
+ And I select "Activity completion" from the "Report type" singleselect
And I click on "Student 1, What to drink?: Completed" "link"
And I press "Save changes"
And I log out
diff --git a/mod/choice/tests/behat/multiple_options.feature b/mod/choice/tests/behat/multiple_options.feature
index befa5e18798..bd0af8f05fc 100644
--- a/mod/choice/tests/behat/multiple_options.feature
+++ b/mod/choice/tests/behat/multiple_options.feature
@@ -45,7 +45,6 @@ Feature: Multiple option choice response
And I log in as "teacher1"
And I am on "Course 1" course homepage with editing mode on
And I follow "Choice name"
- And I click on "Actions menu" "link"
And I follow "Settings"
And I set the following fields to these values:
| Limit 1 | 1 |
diff --git a/mod/feedback/tests/behat/anonymous.feature b/mod/feedback/tests/behat/anonymous.feature
index c64d8ccf1e7..a2ae14902b3 100644
--- a/mod/feedback/tests/behat/anonymous.feature
+++ b/mod/feedback/tests/behat/anonymous.feature
@@ -57,7 +57,7 @@ Feature: Anonymous feedback
And I set the following fields to these values:
| Yes | 1 |
And I press "Submit your answers"
- And I should not see "Submitted answers"
+ And I should not see "Analysis"
And I press "Continue"
@javascript
@@ -89,7 +89,7 @@ Feature: Anonymous feedback
And I set the following fields to these values:
| No | 1 |
And I press "Submit your answers"
- And I follow "Submitted answers"
+ And I follow "Analysis"
And I should see "Submitted answers: 2"
And I should see "Questions: 1"
# And I should not see "multichoice2" # TODO MDL-29303 do not show labels to users who can not edit feedback
@@ -121,7 +121,7 @@ Feature: Anonymous feedback
And I set the following fields to these values:
| Yes | 1 |
And I press "Submit your answers"
- And I should not see "Submitted answers"
+ And I should not see "Analysis"
And I press "Continue"
@javascript
@@ -153,7 +153,7 @@ Feature: Anonymous feedback
And I set the following fields to these values:
| No | 1 |
And I press "Submit your answers"
- And I follow "Submitted answers"
+ And I follow "Analysis"
And I should see "Submitted answers: 2"
And I should see "Questions: 1"
# And I should not see "multichoice2" # TODO MDL-29303
@@ -202,7 +202,7 @@ Feature: Anonymous feedback
And I set the following fields to these values:
| No | 1 |
And I press "Submit your answers"
- And I follow "Submitted answers"
+ And I follow "Analysis"
And I should see "Submitted answers: 2"
And I should see "Questions: 1"
# And I should not see "multichoice2" # TODO MDL-29303
@@ -274,7 +274,7 @@ Feature: Anonymous feedback
And I click on "," "link" in the "Username 1" "table_row"
And I should see "(Username 1)"
And I should see "usertext"
- And I follow "Back"
+ And I navigate to "Responses" in current page administration
And I follow "Response number: 1"
And I should see "Response number: 1 (Anonymous)"
Then I should see "anontext"
diff --git a/mod/feedback/tests/behat/coursemapping.feature b/mod/feedback/tests/behat/coursemapping.feature
index 72a215081e6..44d69d7b3e9 100644
--- a/mod/feedback/tests/behat/coursemapping.feature
+++ b/mod/feedback/tests/behat/coursemapping.feature
@@ -67,7 +67,6 @@ Feature: Mapping courses in a feedback
And I am on "Course 1" course homepage
And I follow "Another feedback"
And I should not see "Mapped courses"
- And I should not see "Map feedback to courses"
@javascript
Scenario: Site feedback is not mapped to any course
@@ -135,7 +134,7 @@ Feature: Mapping courses in a feedback
And I log in as "manager"
And I am on site homepage
And I follow "Course feedback"
- And I follow "Map feedback to courses"
+ And I follow "Mapped courses"
And I set the field "Courses" to "Course 2, Course 3"
And I press "Save changes"
And I should see "Course mapping has been changed"
diff --git a/mod/feedback/tests/behat/groups.feature b/mod/feedback/tests/behat/groups.feature
index 1424f611084..7a91900b5a1 100644
--- a/mod/feedback/tests/behat/groups.feature
+++ b/mod/feedback/tests/behat/groups.feature
@@ -87,7 +87,7 @@ Feature: Feedbacks in courses with groups
| I don't know | 1 |
# View analysis, user1 should only see one group - group 1
And I am on the "Course feedback" "feedback activity" page logged in as user1
- And I follow "Submitted answers"
+ And I follow "Analysis"
And I should see "Separate groups: Group 1"
And I show chart data for the "multichoice1" feedback
And I should see "2 (50.00 %)" in the "Yes of course" "table_row"
@@ -95,7 +95,7 @@ Feature: Feedbacks in courses with groups
And I log out
# View analysis, user3 should only see one group - group 2
And I am on the "Course feedback" "feedback activity" page logged in as user3
- And I follow "Submitted answers"
+ And I follow "Analysis"
And I should see "Separate groups: Group 2"
And I show chart data for the "multichoice1" feedback
And I should see "0" in the "Yes of course" "table_row"
@@ -103,7 +103,7 @@ Feature: Feedbacks in courses with groups
And I log out
# View analysis, user2 should see a group selector and be able to change the group but not view all.
And I am on the "Course feedback" "feedback activity" page logged in as user2
- And I follow "Submitted answers"
+ And I follow "Analysis"
And the field "Separate groups" matches value "Group 1"
And I show chart data for the "multichoice1" feedback
And I should see "2 (50.00 %)" in the "Yes of course" "table_row"
@@ -116,7 +116,7 @@ Feature: Feedbacks in courses with groups
And I log out
# User without group can see all participants only
And I am on the "Course feedback" "feedback activity" page logged in as user7
- And I follow "Submitted answers"
+ And I follow "Analysis"
And I should see "Separate groups: All participants"
And I show chart data for the "multichoice1" feedback
And I should see "2 (28.57 %)" in the "Yes of course" "table_row"
@@ -165,7 +165,7 @@ Feature: Feedbacks in courses with groups
And I log in as "user1" and complete feedback "Course anon feedback" in course "Course 1" with:
| Not at all | 1 |
And I am on the "Course anon feedback" "feedback activity" page logged in as user1
- And I follow "Submitted answers"
+ And I follow "Analysis"
And I should see "There are insufficient responses for this group"
And I should not see "Yes of course"
And I log out
@@ -183,7 +183,7 @@ Feature: Feedbacks in courses with groups
| I don't know | 1 |
# View analysis, user1 should only see one group - group 1
And I am on the "Course anon feedback" "feedback activity" page logged in as user1
- And I follow "Submitted answers"
+ And I follow "Analysis"
And I should see "Separate groups: Group 1"
And I show chart data for the "multichoice1" feedback
And I should see "2 (50.00 %)" in the "Yes of course" "table_row"
@@ -191,7 +191,7 @@ Feature: Feedbacks in courses with groups
And I log out
# View analysis, user3 should only see one group - group 2
And I am on the "Course anon feedback" "feedback activity" page logged in as user3
- And I follow "Submitted answers"
+ And I follow "Analysis"
And I should see "Separate groups: Group 2"
And I show chart data for the "multichoice1" feedback
And I should see "0" in the "Yes of course" "table_row"
@@ -199,7 +199,7 @@ Feature: Feedbacks in courses with groups
And I log out
# View analysis, user2 should see a group selector and be able to change the group but not view all.
And I am on the "Course anon feedback" "feedback activity" page logged in as user2
- And I follow "Submitted answers"
+ And I follow "Analysis"
And the field "Separate groups" matches value "Group 1"
And I show chart data for the "multichoice1" feedback
And I should see "2 (50.00 %)" in the "Yes of course" "table_row"
@@ -212,7 +212,7 @@ Feature: Feedbacks in courses with groups
And I log out
# User without group can see all participants only
And I am on the "Course anon feedback" "feedback activity" page logged in as user7
- And I follow "Submitted answers"
+ And I follow "Analysis"
And I should see "Separate groups: All participants"
And I show chart data for the "multichoice1" feedback
And I should see "2 (28.57 %)" in the "Yes of course" "table_row"
diff --git a/mod/feedback/tests/behat/non_anonymous.feature b/mod/feedback/tests/behat/non_anonymous.feature
index b7bd5f37b5a..a8c30b97628 100644
--- a/mod/feedback/tests/behat/non_anonymous.feature
+++ b/mod/feedback/tests/behat/non_anonymous.feature
@@ -53,7 +53,7 @@ Feature: Non anonymous feedback
And I set the following fields to these values:
| Yes of course | 1 |
And I press "Submit your answers"
- And I should not see "Submitted answers"
+ And I should not see "Analysis"
And I press "Continue"
@javascript
@@ -75,7 +75,7 @@ Feature: Non anonymous feedback
And I set the following fields to these values:
| Not at all | 1 |
And I press "Submit your answers"
- And I follow "Submitted answers"
+ And I follow "Analysis"
And I should see "Submitted answers: 2"
And I should see "Questions: 1"
# And I should not see "multichoice2" # TODO MDL-29303 do not show labels to users who can not edit feedback
@@ -92,7 +92,6 @@ Feature: Non anonymous feedback
And I click on "," "link" in the "Username 1" "table_row"
And I should see "(Username 1)"
And I should see "Yes of course"
- And I follow "Back"
And I log out
@javascript
@@ -119,7 +118,7 @@ Feature: Non anonymous feedback
And I set the following fields to these values:
| Not at all | 1 |
And I press "Submit your answers"
- And I follow "Submitted answers"
+ And I follow "Analysis"
And I should see "Submitted answers: 2"
And I should see "Questions: 1"
# And I should not see "multichoice2" # TODO MDL-29303
diff --git a/mod/forum/view.php b/mod/forum/view.php
index 37165ee06e7..711ca6a9cc9 100644
--- a/mod/forum/view.php
+++ b/mod/forum/view.php
@@ -107,6 +107,11 @@ $PAGE->add_body_class('forumtype-' . $forum->get_type());
$PAGE->set_heading($course->fullname);
$PAGE->add_header_action(forum_search_form($course, $search));
+// MDL-71915 Will remove this place holder.
+if (defined('BEHAT_SITE_RUNNING')) {
+ $PAGE->has_secondary_navigation_setter(false);
+}
+
if ($istypesingle && $displaymode == FORUM_MODE_NESTED_V2) {
$PAGE->add_body_class('nested-v2-display-mode reset-style');
$settingstrigger = $OUTPUT->render_from_template('mod_forum/settings_drawer_trigger', null);
diff --git a/mod/glossary/tests/behat/import_entries.feature b/mod/glossary/tests/behat/import_entries.feature
index 38cfbafb7bf..7d6daf8e937 100644
--- a/mod/glossary/tests/behat/import_entries.feature
+++ b/mod/glossary/tests/behat/import_entries.feature
@@ -24,7 +24,7 @@ Feature: Importing glossary entries
And I am on "Course 1" course homepage with editing mode on
And I add the "Recent activity" block
And I am on the "Glossary 1" "glossary activity" page
- And I navigate to "Import entries" in current page administration
+ And I press "Import entries"
And I upload "mod/glossary/tests/fixtures/texfilter_glossary_en.xml" file to "File to import" filemanager
When I press "Submit"
Then I should see "103" in the "Total entries:" "table_row"
@@ -39,7 +39,7 @@ Feature: Importing glossary entries
And I am on "Course 1" course homepage with editing mode on
And I add the "Tags" block
And I am on the "Glossary 1" "glossary activity" page
- And I navigate to "Import entries" in current page administration
+ And I press "Import entries"
And I upload "mod/glossary/tests/fixtures/musicians.xml" file to "File to import" filemanager
When I press "Submit"
And I am on "Course 1" course homepage
diff --git a/mod/h5pactivity/tests/behat/grading_attempts.feature b/mod/h5pactivity/tests/behat/grading_attempts.feature
index 48647607eb8..568e8e3c089 100644
--- a/mod/h5pactivity/tests/behat/grading_attempts.feature
+++ b/mod/h5pactivity/tests/behat/grading_attempts.feature
@@ -48,7 +48,7 @@ Feature: Change grading options in an H5P activity
@javascript
Scenario: Default grading is max attempt grade
- Given I am on the "Awesome H5P package" "h5pactivity activity" page logged in as teacher1
+ Given I am on the "Course 1" course page logged in as teacher1
When I navigate to "View > User report" in the course gradebook
And I set the field "Select all or one user" to "Student 1"
Then the following should exist in the "user-grade" table:
diff --git a/mod/lesson/tests/behat/behat_mod_lesson_behat.php b/mod/lesson/tests/behat/behat_mod_lesson_behat.php
index 9dd3ff3f270..6dc6ace5640 100644
--- a/mod/lesson/tests/behat/behat_mod_lesson_behat.php
+++ b/mod/lesson/tests/behat/behat_mod_lesson_behat.php
@@ -71,7 +71,9 @@ class behat_mod_lesson_behat extends behat_base {
try {
$this->execute("behat_general::click_link", [get_string('edit', 'mod_lesson')]);
} catch (ElementNotFoundException $e) {
- $this->execute("behat_general::i_click_on", [get_string('edit', 'mod_lesson'), 'button']);
+ $this->execute("behat_general::i_click_on_in_the",
+ [get_string('edit', 'mod_lesson'), 'button', 'region-main', 'region']
+ );
}
}
}
diff --git a/mod/quiz/report/grading/tests/behat/grading.feature b/mod/quiz/report/grading/tests/behat/grading.feature
index eb9b54a4140..48d46628a3a 100644
--- a/mod/quiz/report/grading/tests/behat/grading.feature
+++ b/mod/quiz/report/grading/tests/behat/grading.feature
@@ -43,7 +43,7 @@ Feature: Basic use of the Manual grading report
# Check report shows nothing when there are no attempts.
When I am on the "Quiz 1" "mod_quiz > View" page logged in as "teacher1"
And I navigate to "Results > Manual grading" in current page administration
- Then I should see "Manual grading"
+ Then I should see "Quiz 1" in the "//nav[contains(concat(' ', normalize-space(@aria-label), ' '), ' Navigation bar ')]" "xpath_element"
And I should see "Quiz 1"
And I should see "Nothing to display"
And I follow "Also show questions that have been graded automatically"
diff --git a/mod/quiz/report/overview/tests/behat/basic.feature b/mod/quiz/report/overview/tests/behat/basic.feature
index 5ee1d0f5627..683ff1ee0cf 100644
--- a/mod/quiz/report/overview/tests/behat/basic.feature
+++ b/mod/quiz/report/overview/tests/behat/basic.feature
@@ -50,7 +50,7 @@ Feature: Basic use of the Grades report
Scenario: Using the Grades report
# Basic check of the Grades report
When I am on the "Quiz 1" "quiz activity" page logged in as teacher1
- And I navigate to "Results > Grades" in current page administration
+ And I navigate to "Results" in current page administration
Then I should see "Attempts: 2"
# Check student1's grade
And I should see "25.00" in the "S1 Student1" "table_row"
@@ -85,6 +85,6 @@ Feature: Basic use of the Grades report
Given the following config values are set as admin:
| showuseridentity | email,profile_field_fruit |
And I am on the "Quiz 1" "quiz activity" page logged in as teacher1
- And I navigate to "Results > Grades" in current page administration
+ And I navigate to "Results" in current page administration
Then I should see "Apple" in the "S1 Student1" "table_row"
And I should see "Banana" in the "S2 Student2" "table_row"
diff --git a/mod/quiz/report/overview/tests/behat/regrading.feature b/mod/quiz/report/overview/tests/behat/regrading.feature
index 6645f0b59d2..32f1c940f39 100644
--- a/mod/quiz/report/overview/tests/behat/regrading.feature
+++ b/mod/quiz/report/overview/tests/behat/regrading.feature
@@ -43,7 +43,7 @@ Feature: Regrading quiz attempts using the Grades report
Scenario: Regrade all attempts
Given I am on the "Quiz for testing regrading" "quiz activity" page logged in as teacher
- And I navigate to "Results > Grades" in current page administration
+ And I navigate to "Results" in current page administration
When I press "Regrade all"
# Note, the order is not defined, so we can only check part of the message.
@@ -60,7 +60,7 @@ Feature: Regrading quiz attempts using the Grades report
Scenario: Regrade selected attempts
Given I am on the "Quiz for testing regrading" "quiz activity" page logged in as teacher
- And I navigate to "Results > Grades" in current page administration
+ And I navigate to "Results" in current page administration
When I click on "Select attempt" "checkbox" in the "Student Two" "table_row"
And I press "Regrade selected attempts"
diff --git a/mod/quiz/tests/behat/attempt_redo_questions.feature b/mod/quiz/tests/behat/attempt_redo_questions.feature
index ffc0697e82e..dcf73cd7dfd 100644
--- a/mod/quiz/tests/behat/attempt_redo_questions.feature
+++ b/mod/quiz/tests/behat/attempt_redo_questions.feature
@@ -86,6 +86,7 @@ Feature: Allow students to redo questions in a practice quiz, without starting a
And I switch to the main window
And the state of "First question" question is shown as "Not answered"
And I should not see "Submit" in the ".history" "css_element"
+ And I am on the "Quiz 1" "mod_quiz > View" page
And I navigate to "Results > Statistics" in current page administration
And I follow "TF1"
And "False" row "Frequency" column of "quizresponseanalysis" table should contain "100.00%"
diff --git a/mod/quiz/tests/behat/completion_condition_attempts_used.feature b/mod/quiz/tests/behat/completion_condition_attempts_used.feature
index f79805fd5e3..c58e3387d64 100644
--- a/mod/quiz/tests/behat/completion_condition_attempts_used.feature
+++ b/mod/quiz/tests/behat/completion_condition_attempts_used.feature
@@ -59,7 +59,8 @@ Feature: Set a quiz to be marked complete when the student uses all attempts all
And I follow "Test quiz name"
And "Test quiz name" should have the "Receive a pass grade or complete all available attempts" completion condition
And I am on "Course 1" course homepage
- And I navigate to "Reports > Activity completion" in current page administration
+ And I navigate to "Reports" in current page administration
+ And I select "Activity completion" from the "Report type" singleselect
And "" "icon" should exist in the "Student 1" "table_row"
Examples:
diff --git a/mod/quiz/tests/behat/completion_condition_minimum_attempts.feature b/mod/quiz/tests/behat/completion_condition_minimum_attempts.feature
index 499e68ab8d8..1c5df692704 100644
--- a/mod/quiz/tests/behat/completion_condition_minimum_attempts.feature
+++ b/mod/quiz/tests/behat/completion_condition_minimum_attempts.feature
@@ -57,5 +57,6 @@ Feature: Set a quiz to be marked complete when the student completes a minimum a
And I follow "Test quiz name"
And "Test quiz name" should have the "Make attempts: 2" completion condition
And I am on "Course 1" course homepage
- And I navigate to "Reports > Activity completion" in current page administration
+ And I navigate to "Reports" in current page administration
+ And I select "Activity completion" from the "Report type" singleselect
And "Completed" "icon" should exist in the "Student 1" "table_row"
diff --git a/mod/quiz/tests/behat/completion_condition_passing_grade.feature b/mod/quiz/tests/behat/completion_condition_passing_grade.feature
index 1ee28b89535..86c92a607eb 100644
--- a/mod/quiz/tests/behat/completion_condition_passing_grade.feature
+++ b/mod/quiz/tests/behat/completion_condition_passing_grade.feature
@@ -51,5 +51,6 @@ Feature: Set a quiz to be marked complete when the student passes
And I log out
And I log in as "teacher1"
And I am on "Course 1" course homepage
- And I navigate to "Reports > Activity completion" in current page administration
+ And I navigate to "Reports" in current page administration
+ And I select "Activity completion" from the "Report type" singleselect
And "Completed" "icon" should exist in the "Student 1" "table_row"
diff --git a/mod/quiz/tests/behat/editing_add.feature b/mod/quiz/tests/behat/editing_add.feature
index 2952285fc0f..c93e14dc7f4 100644
--- a/mod/quiz/tests/behat/editing_add.feature
+++ b/mod/quiz/tests/behat/editing_add.feature
@@ -120,7 +120,7 @@ Feature: Edit quiz page - adding things
Then I press "id_submitbutton"
And I should see "Subcat 2"
- And I follow "Question bank"
+ And I click on "Questions" "link"
Then I should see "Question bank"
And I should see "Select a category"
diff --git a/mod/quiz/tests/behat/editing_add_from_question_bank.feature b/mod/quiz/tests/behat/editing_add_from_question_bank.feature
index 68e2b043670..97e7c2c767f 100644
--- a/mod/quiz/tests/behat/editing_add_from_question_bank.feature
+++ b/mod/quiz/tests/behat/editing_add_from_question_bank.feature
@@ -28,7 +28,7 @@ Feature: Adding questions to a quiz from the question bank
Scenario: The questions can be filtered by tag
Given I log in as "teacher1"
And I am on "Course 1" course homepage
- When I navigate to "Question bank > Questions" in current page administration
+ When I navigate to "Question bank" in current page administration
And I choose "Edit question" action for "question 01 name" in the question bank
And I set the following fields to these values:
| Tags | foo |
diff --git a/mod/quiz/tests/behat/quiz_activity_completion.feature b/mod/quiz/tests/behat/quiz_activity_completion.feature
index 9fb7a378a81..7845ea74c75 100644
--- a/mod/quiz/tests/behat/quiz_activity_completion.feature
+++ b/mod/quiz/tests/behat/quiz_activity_completion.feature
@@ -75,7 +75,8 @@ Feature: View activity completion in the quiz activity
And I log out
And I log in as "teacher1"
And I am on "Course 1" course homepage
- And I navigate to "Reports > Activity completion" in current page administration
+ And I navigate to "Reports" in current page administration
+ And I select "Activity completion" from the "Report type" singleselect
And "" "icon" should exist in the "Student 1" "table_row"
Examples:
diff --git a/mod/quiz/tests/behat/settings_form_fields_disableif.feature b/mod/quiz/tests/behat/settings_form_fields_disableif.feature
index d4f6374c83a..1f04d6cba4f 100644
--- a/mod/quiz/tests/behat/settings_form_fields_disableif.feature
+++ b/mod/quiz/tests/behat/settings_form_fields_disableif.feature
@@ -58,7 +58,6 @@ Feature: Settings form fields disabled if not required
| Override user | Student1 |
| Attempts allowed | 3 |
And I press "Save"
- And I follow "Test quiz"
And I navigate to "Settings" in current page administration
And I expand all fieldsets
And I set the field "Attempts allowed" to "1"
@@ -72,7 +71,6 @@ Feature: Settings form fields disabled if not required
And I click on "Edit" "link" in the "region-main" "region"
And I set the field "Attempts allowed" to "2"
And I press "Save"
- And I follow "Test quiz"
And I navigate to "Settings" in current page administration
And I expand all fieldsets
And I set the field "Attempts allowed" to "1"
@@ -88,7 +86,6 @@ Feature: Settings form fields disabled if not required
| Override user | Student2 |
| Attempts allowed | Unlimited |
And I press "Save"
- And I follow "Test quiz"
And I navigate to "Settings" in current page administration
And I expand all fieldsets
And I set the field "Attempts allowed" to "1"
diff --git a/mod/quiz/view.php b/mod/quiz/view.php
index 53edef2b677..94f609ee231 100644
--- a/mod/quiz/view.php
+++ b/mod/quiz/view.php
@@ -144,6 +144,11 @@ $title = $course->shortname . ': ' . format_string($quiz->name);
$PAGE->set_title($title);
$PAGE->set_heading($course->fullname);
$output = $PAGE->get_renderer('mod_quiz');
+// MDL-71915 Will remove this place holder.
+if (defined('BEHAT_SITE_RUNNING')) {
+ $PAGE->has_secondary_navigation_setter(false);
+}
+$PAGE->add_header_action($OUTPUT->region_main_settings_menu());
// Print table with existing attempts.
if ($attempts) {
diff --git a/my/index.php b/my/index.php
index 8a741243601..96f2843b275 100644
--- a/my/index.php
+++ b/my/index.php
@@ -91,6 +91,10 @@ $PAGE->set_title($pagetitle);
$PAGE->set_heading($header);
$PAGE->has_secondary_navigation_setter(false);
+if ($block = my_page_add_block_center()) {
+ $PAGE->blocks->add_fake_block($block, 'content');
+}
+
if (!isguestuser()) { // Skip default home page for guests
if (get_home_page() != HOMEPAGE_MY) {
if (optional_param('setdefaulthome', false, PARAM_BOOL)) {
diff --git a/my/indexsys.php b/my/indexsys.php
index 09515a4dc66..ebacb0d4839 100644
--- a/my/indexsys.php
+++ b/my/indexsys.php
@@ -70,6 +70,10 @@ $PAGE->set_title($header);
$PAGE->set_heading($header);
$PAGE->blocks->add_region('content');
+if ($block = my_page_add_block_center()) {
+ $PAGE->blocks->add_fake_block($block, 'content');
+}
+
// Get the My Moodle page info. Should always return something unless the database is broken.
if (!$currentpage = my_get_page(null, MY_PAGE_PRIVATE)) {
print_error('mymoodlesetup');
diff --git a/my/lib.php b/my/lib.php
index 9002df0b1c6..f2e9c1b5363 100644
--- a/my/lib.php
+++ b/my/lib.php
@@ -295,6 +295,38 @@ function my_reset_page_for_all_users(
}
}
+/**
+ * Within /my we need to be able to add a block to the center content region directly as well as show
+ * the standard add a block information.
+ *
+ * @return block_contents|null
+ */
+function my_page_add_block_center(): ?block_contents {
+ global $PAGE, $OUTPUT;
+ // Add-a-block in editing mode.
+ if (isset($PAGE->theme->addblockposition) &&
+ $PAGE->user_is_editing() &&
+ $PAGE->user_can_edit_blocks() &&
+ !defined('BEHAT_SITE_RUNNING')
+ ) {
+ $url = new moodle_url($PAGE->url, ['bui_addblock' => '', 'bui_blockregion' => 'content', 'sesskey' => sesskey()]);
+
+ $block = new block_contents;
+ $block->content = $OUTPUT->render_from_template('core/add_block_button',
+ [
+ 'link' => $url->out(false),
+ 'escapedlink' => "?{$url->get_query_string(false)}",
+ 'pageType' => $PAGE->pagetype,
+ 'pageLayout' => $PAGE->pagelayout,
+ ]
+ );
+
+ return $block;
+ }
+
+ return null;
+}
+
class my_syspage_block_manager extends block_manager {
// HACK WARNING!
// TODO: figure out a better way to do this
diff --git a/question/bank/comment/tests/behat/question_comment.feature b/question/bank/comment/tests/behat/question_comment.feature
index 7b1dd784fc4..3ec89c3d742 100644
--- a/question/bank/comment/tests/behat/question_comment.feature
+++ b/question/bank/comment/tests/behat/question_comment.feature
@@ -27,7 +27,7 @@ Feature: A Teacher can comment in a question
Scenario: Add a comment in question
Given I log in as "teacher1"
And I am on the "Test quiz" "quiz activity" page
- And I navigate to "Question bank > Questions" in current page administration
+ And I navigate to "Question bank" in current page administration
And I set the field "Select a category" to "Test questions"
And I should see "0" on the comments column
When I click "0" on the row on the comments column
@@ -41,7 +41,7 @@ Feature: A Teacher can comment in a question
Scenario: Delete a comment from question
Given I log in as "teacher1"
And I am on the "Test quiz" "quiz activity" page
- And I navigate to "Question bank > Questions" in current page administration
+ And I navigate to "Question bank" in current page administration
And I set the field "Select a category" to "Test questions"
And I should see "0" on the comments column
When I click "0" on the row on the comments column
@@ -60,7 +60,7 @@ Feature: A Teacher can comment in a question
Scenario: Preview question with comments
Given I log in as "teacher1"
And I am on the "Test quiz" "quiz activity" page
- And I navigate to "Question bank > Questions" in current page administration
+ And I navigate to "Question bank" in current page administration
And I set the field "Select a category" to "Test questions"
And I choose "Preview" action for "First question" in the question bank
Then I should see "Save comment"
@@ -86,7 +86,7 @@ Feature: A Teacher can comment in a question
And I log out
Then I log in as "teacher1"
And I am on the "Test quiz" "quiz activity" page
- And I navigate to "Question bank > Questions" in current page administration
+ And I navigate to "Question bank" in current page administration
And I set the field "Select a category" to "Test questions"
And I choose "Preview" action for "First question" in the question bank
Then I should not see "Save comment"
@@ -104,7 +104,7 @@ Feature: A Teacher can comment in a question
And I log out
Then I log in as "teacher2"
And I am on the "Test quiz" "quiz activity" page
- And I navigate to "Question bank > Questions" in current page administration
+ And I navigate to "Question bank" in current page administration
And I set the field "Select a category" to "Test questions"
And I choose "Preview" action for "First question" in the question bank
Then I should not see "Save comment"
diff --git a/question/bank/comment/tests/behat/question_comment_column.feature b/question/bank/comment/tests/behat/question_comment_column.feature
index c0c870ecd2f..59824a2bad9 100644
--- a/question/bank/comment/tests/behat/question_comment_column.feature
+++ b/question/bank/comment/tests/behat/question_comment_column.feature
@@ -23,10 +23,10 @@ Feature: Use the qbank plugin manager page for comment
And I should see "Question comments"
And I click on "Disable" "link" in the "Question comments" "table_row"
And I am on the "Test quiz" "quiz activity" page
- And I navigate to "Question bank > Questions" in current page administration
+ And I navigate to "Question bank" in current page administration
Then "#categoryquestions .header.commentcount" "css_element" should not be visible
And I navigate to "Plugins > Question bank plugins > Manage question bank plugins" in site administration
And I click on "Enable" "link" in the "Question comments" "table_row"
And I am on the "Test quiz" "quiz activity" page
- And I navigate to "Question bank > Questions" in current page administration
+ And I navigate to "Question bank" in current page administration
And "#categoryquestions .header.commentcount" "css_element" should be visible
diff --git a/question/bank/deletequestion/tests/behat/delete_question_column.feature b/question/bank/deletequestion/tests/behat/delete_question_column.feature
index 67d4f429f16..c11ac8b9b9e 100644
--- a/question/bank/deletequestion/tests/behat/delete_question_column.feature
+++ b/question/bank/deletequestion/tests/behat/delete_question_column.feature
@@ -24,13 +24,13 @@ Feature: Use the qbank plugin manager page for deletequestion
And I click on "Disable" "link" in the "Delete question" "table_row"
And I am on the "Test quiz" "quiz activity" page
And I navigate to "Question bank > Questions" in current page administration
- And I click on "#action-menu-toggle-2" "css_element" in the "First question" "table_row"
+ And I click on "#action-menu-toggle-1" "css_element" in the "First question" "table_row"
Then I should not see "Delete" in the "region-main" "region"
And I navigate to "Plugins > Question bank plugins > Manage question bank plugins" in site administration
And I click on "Enable" "link" in the "Delete question" "table_row"
And I am on the "Test quiz" "quiz activity" page
And I navigate to "Question bank > Questions" in current page administration
- And I click on "#action-menu-toggle-2" "css_element" in the "First question" "table_row"
+ And I click on "#action-menu-toggle-1" "css_element" in the "First question" "table_row"
And I should see "Delete" in the "region-main" "region"
@javascript
diff --git a/question/bank/exporttoxml/tests/behat/export_to_xml_action.feature b/question/bank/exporttoxml/tests/behat/export_to_xml_action.feature
index 2819d202e98..f713f2a7eb5 100644
--- a/question/bank/exporttoxml/tests/behat/export_to_xml_action.feature
+++ b/question/bank/exporttoxml/tests/behat/export_to_xml_action.feature
@@ -22,12 +22,12 @@ Feature: Use the qbank plugin manager page for exporttoxml
And I should see "Export to XML"
And I click on "Disable" "link" in the "Export to XML" "table_row"
And I am on the "Test quiz" "quiz activity" page
- And I navigate to "Question bank > Questions" in current page administration
- And I click on "#action-menu-toggle-2" "css_element" in the "First question" "table_row"
+ And I navigate to "Question bank" in current page administration
+ And I click on "#action-menu-toggle-1" "css_element" in the "First question" "table_row"
Then I should not see "Export as Moodle XML"
And I navigate to "Plugins > Question bank plugins > Manage question bank plugins" in site administration
And I click on "Enable" "link" in the "Export to XML" "table_row"
And I am on the "Test quiz" "quiz activity" page
- And I navigate to "Question bank > Questions" in current page administration
- And I click on "#action-menu-toggle-2" "css_element" in the "First question" "table_row"
+ And I navigate to "Question bank" in current page administration
+ And I click on "#action-menu-toggle-1" "css_element" in the "First question" "table_row"
And I should see "Export as Moodle XML"
diff --git a/question/bank/previewquestion/tests/behat/preview_question.feature b/question/bank/previewquestion/tests/behat/preview_question.feature
index 9d1c6903c75..c7e9beb6b65 100644
--- a/question/bank/previewquestion/tests/behat/preview_question.feature
+++ b/question/bank/previewquestion/tests/behat/preview_question.feature
@@ -25,7 +25,7 @@ Feature: A teacher can preview questions in the question bank
| Test questions | numerical | Test question to be previewed |
And I log in as "teacher1"
And I am on the "Test quiz" "quiz activity" page
- And I navigate to "Question bank > Questions" in current page administration
+ And I navigate to "Question bank" in current page administration
When I choose "Preview" action for "Test question to be previewed" in the question bank
Scenario: Question preview shows the question and other information
diff --git a/question/bank/previewquestion/tests/behat/preview_question_action.feature b/question/bank/previewquestion/tests/behat/preview_question_action.feature
index c720b06a845..ce758a803a9 100644
--- a/question/bank/previewquestion/tests/behat/preview_question_action.feature
+++ b/question/bank/previewquestion/tests/behat/preview_question_action.feature
@@ -22,15 +22,17 @@ Feature: Use the qbank plugin manager page for previewquestion
When I navigate to "Plugins > Question bank plugins > Manage question bank plugins" in site administration
And I should see "Preview question"
And I click on "Disable" "link" in the "Preview question" "table_row"
+ And I am on the "C1" "Course" page
And I am on the "Test quiz" "quiz activity" page
- And I navigate to "Question bank > Questions" in current page administration
- And I click on "#action-menu-toggle-2" "css_element" in the "First question" "table_row"
+ And I navigate to "Question bank" in current page administration
+ And I click on ".action-menu" "css_element" in the "First question" "table_row"
Then I should not see "Preview" in the "region-main" "region"
And I navigate to "Plugins > Question bank plugins > Manage question bank plugins" in site administration
And I click on "Enable" "link" in the "Preview question" "table_row"
+ And I am on the "C1" "Course" page
And I am on the "Test quiz" "quiz activity" page
- And I navigate to "Question bank > Questions" in current page administration
- And I click on "#action-menu-toggle-2" "css_element" in the "First question" "table_row"
+ And I navigate to "Question bank" in current page administration
+ And I click on ".action-menu" "css_element" in the "First question" "table_row"
And I should see "Preview" in the "region-main" "region"
Scenario: Enable/disable preview button from question edit form
@@ -39,12 +41,12 @@ Feature: Use the qbank plugin manager page for previewquestion
And I should see "Preview question"
And I click on "Disable" "link" in the "Preview question" "table_row"
And I am on the "Test quiz" "quiz activity" page
- And I navigate to "Question bank > Questions" in current page administration
+ And I navigate to "Question bank" in current page administration
And I choose "Edit question" action for "First question" in the question bank
Then I should not see "Preview" in the "region-main" "region"
And I navigate to "Plugins > Question bank plugins > Manage question bank plugins" in site administration
And I click on "Enable" "link" in the "Preview question" "table_row"
And I am on the "Test quiz" "quiz activity" page
- And I navigate to "Question bank > Questions" in current page administration
+ And I navigate to "Question bank" in current page administration
And I choose "Edit question" action for "First question" in the question bank
And I should see "Preview" in the "region-main" "region"
diff --git a/question/bank/tagquestion/tests/behat/tag_question_action.feature b/question/bank/tagquestion/tests/behat/tag_question_action.feature
index e254db04308..795b0299875 100644
--- a/question/bank/tagquestion/tests/behat/tag_question_action.feature
+++ b/question/bank/tagquestion/tests/behat/tag_question_action.feature
@@ -22,14 +22,14 @@ Feature: Use the qbank plugin manager page for tagquestion
And I should see "Tag question"
And I click on "Disable" "link" in the "Tag question" "table_row"
And I am on the "Test quiz" "quiz activity" page
- And I navigate to "Question bank > Questions" in current page administration
- And I click on "#action-menu-toggle-2" "css_element" in the "First question" "table_row"
+ And I navigate to "Question bank" in current page administration
+ And I click on "#action-menu-toggle-1" "css_element" in the "First question" "table_row"
Then I should not see "Manage tags"
And I navigate to "Plugins > Question bank plugins > Manage question bank plugins" in site administration
And I click on "Enable" "link" in the "Tag question" "table_row"
And I am on the "Test quiz" "quiz activity" page
- And I navigate to "Question bank > Questions" in current page administration
- And I click on "#action-menu-toggle-2" "css_element" in the "First question" "table_row"
+ And I navigate to "Question bank" in current page administration
+ And I click on "#action-menu-toggle-1" "css_element" in the "First question" "table_row"
And I should see "Manage tags"
Scenario: Enable/disable tagquestion section from question edit form
@@ -38,12 +38,12 @@ Feature: Use the qbank plugin manager page for tagquestion
And I should see "Tag question"
And I click on "Disable" "link" in the "Tag question" "table_row"
And I am on the "Test quiz" "quiz activity" page
- And I navigate to "Question bank > Questions" in current page administration
+ And I navigate to "Question bank" in current page administration
And I choose "Edit question" action for "First question" in the question bank
Then I should not see "Tags" in the "region-main" "region"
And I navigate to "Plugins > Question bank plugins > Manage question bank plugins" in site administration
And I click on "Enable" "link" in the "Tag question" "table_row"
And I am on the "Test quiz" "quiz activity" page
- And I navigate to "Question bank > Questions" in current page administration
+ And I navigate to "Question bank" in current page administration
And I choose "Edit question" action for "First question" in the question bank
And I should see "Tags" in the "region-main" "region"
diff --git a/question/bank/viewcreator/tests/behat/view_view_creator_column.feature b/question/bank/viewcreator/tests/behat/view_view_creator_column.feature
index 7172b8c688d..7b1244266a2 100644
--- a/question/bank/viewcreator/tests/behat/view_view_creator_column.feature
+++ b/question/bank/viewcreator/tests/behat/view_view_creator_column.feature
@@ -22,12 +22,12 @@ Feature: Use the qbank plugin manager page for viewcreator plugin
And I should see "View creator"
When I click on "Disable" "link" in the "View creator" "table_row"
And I am on the "Test quiz" "quiz activity" page
- And I navigate to "Question bank > Questions" in current page administration
+ And I navigate to "Question bank" in current page administration
Then I should not see "Created by"
And I should not see "Last modified by"
And I navigate to "Plugins > Question bank plugins > Manage question bank plugins" in site administration
And I click on "Enable" "link" in the "View creator" "table_row"
And I am on the "Test quiz" "quiz activity" page
- And I navigate to "Question bank > Questions" in current page administration
+ And I navigate to "Question bank" in current page administration
Then I should see "Created by"
And I should see "Last modified by"
diff --git a/question/bank/viewquestionname/tests/behat/view_question_name_column.feature b/question/bank/viewquestionname/tests/behat/view_question_name_column.feature
index 73b0852abd5..9f59437cce4 100644
--- a/question/bank/viewquestionname/tests/behat/view_question_name_column.feature
+++ b/question/bank/viewquestionname/tests/behat/view_question_name_column.feature
@@ -22,10 +22,10 @@ Feature: Use the qbank plugin manager page for viewquestionname
And I should see "View question name"
When I click on "Disable" "link" in the "View question name" "table_row"
And I am on the "Test quiz" "quiz activity" page
- And I navigate to "Question bank > Questions" in current page administration
+ And I navigate to "Question bank" in current page administration
Then I should not see "First question"
And I navigate to "Plugins > Question bank plugins > Manage question bank plugins" in site administration
And I click on "Enable" "link" in the "View question name" "table_row"
And I am on the "Test quiz" "quiz activity" page
- And I navigate to "Question bank > Questions" in current page administration
+ And I navigate to "Question bank" in current page administration
And I should see "First question"
diff --git a/question/bank/viewquestiontext/tests/behat/view_question_name_column.feature b/question/bank/viewquestiontext/tests/behat/view_question_name_column.feature
index 742a5e02084..69d4ec5f48c 100644
--- a/question/bank/viewquestiontext/tests/behat/view_question_name_column.feature
+++ b/question/bank/viewquestiontext/tests/behat/view_question_name_column.feature
@@ -23,13 +23,13 @@ Feature: Use the qbank plugin manager page for viewquestiontext
And I should see "View question text"
When I click on "Disable" "link" in the "View question text" "table_row"
And I am on the "Test quiz" "quiz activity" page
- And I navigate to "Question bank > Questions" in current page administration
+ And I navigate to "Question bank" in current page administration
And I should not see "Show question text in the question list"
Then "#categoryquestions .questiontext" "css_element" should not be visible
And I navigate to "Plugins > Question bank plugins > Manage question bank plugins" in site administration
And I click on "Enable" "link" in the "View question text" "table_row"
And I am on the "Test quiz" "quiz activity" page
- And I navigate to "Question bank > Questions" in current page administration
+ And I navigate to "Question bank" in current page administration
And I should see "Show question text in the question list"
And I click on "qbshowtext" "checkbox"
And I should see "Answer the first question"
diff --git a/question/bank/viewquestiontype/tests/behat/view_question_type_column.feature b/question/bank/viewquestiontype/tests/behat/view_question_type_column.feature
index 0079c94179d..a8df68b2e09 100644
--- a/question/bank/viewquestiontype/tests/behat/view_question_type_column.feature
+++ b/question/bank/viewquestiontype/tests/behat/view_question_type_column.feature
@@ -23,10 +23,10 @@ Feature: Use the qbank plugin manager page for viewquestiontype
And I should see "View question type"
And I click on "Disable" "link" in the "View question type" "table_row"
And I am on the "Test quiz" "quiz activity" page
- And I navigate to "Question bank > Questions" in current page administration
+ And I navigate to "Question bank" in current page administration
Then "#categoryquestions .header.qtype" "css_element" should not be visible
And I navigate to "Plugins > Question bank plugins > Manage question bank plugins" in site administration
And I click on "Enable" "link" in the "View question type" "table_row"
And I am on the "Test quiz" "quiz activity" page
- And I navigate to "Question bank > Questions" in current page administration
+ And I navigate to "Question bank" in current page administration
And "#categoryquestions .header.qtype" "css_element" should be visible
diff --git a/question/renderer.php b/question/renderer.php
index 8d4cb3c5a1b..83cfc413e52 100644
--- a/question/renderer.php
+++ b/question/renderer.php
@@ -48,7 +48,7 @@ class core_question_bank_renderer extends plugin_renderer_base {
foreach ($children as $key => $node) {
$tabs[] = new \tabobject($node->key, $node->action, $node->text);
}
- if (empty($active)) {
+ if (empty($active) && $questionnode->find_active_node()) {
$active = $questionnode->find_active_node()->key;
}
return \html_writer::div(print_tabs([$tabs], $active, null, null, true),
diff --git a/question/tests/behat/behat_question.php b/question/tests/behat/behat_question.php
index 1985da7bea1..d059e3fcd8d 100644
--- a/question/tests/behat/behat_question.php
+++ b/question/tests/behat/behat_question.php
@@ -49,10 +49,6 @@ class behat_question extends behat_question_base {
* @param TableNode $questiondata The data to fill the question type form.
*/
public function i_add_a_question_filling_the_form_with($questiontypename, TableNode $questiondata) {
-
- // Go to question bank.
- $this->execute("behat_general::click_link", get_string('questionbank', 'question'));
-
// Click on create question.
$this->execute('behat_forms::press_button', get_string('createnewquestion', 'question'));
diff --git a/question/tests/behat/delete_questions.feature b/question/tests/behat/delete_questions.feature
index aef5bd72c68..428ee233493 100644
--- a/question/tests/behat/delete_questions.feature
+++ b/question/tests/behat/delete_questions.feature
@@ -22,7 +22,7 @@ Feature: A teacher can delete questions in the question bank
| Test questions | essay | Test question to be deleted | Write about whatever you want |
And I log in as "teacher1"
And I am on "Course 1" course homepage
- And I navigate to "Question bank > Questions" in current page administration
+ And I navigate to "Question bank" in current page administration
@javascript
Scenario: A question not used anywhere can really be deleted
@@ -53,7 +53,7 @@ Feature: A teacher can delete questions in the question bank
| question | page | requireprevious |
| Test used question to be deleted | 1 | 0 |
When I am on "Course 1" course homepage
- And I navigate to "Question bank > Questions" in current page administration
+ And I navigate to "Question bank" in current page administration
And I choose "Delete" action for "Test used question to be deleted" in the question bank
And I press "Delete"
Then I should not see "Test used question to be deleted"
diff --git a/question/tests/behat/duplicate_questions.feature b/question/tests/behat/duplicate_questions.feature
index b04f661bc9d..65a80a8722e 100644
--- a/question/tests/behat/duplicate_questions.feature
+++ b/question/tests/behat/duplicate_questions.feature
@@ -22,7 +22,7 @@ Feature: A teacher can duplicate questions in the question bank
| Test questions | essay | Test question to be copied | Write about whatever you want | qid |
And I log in as "teacher"
And I am on "Course 1" course homepage
- And I navigate to "Question bank > Questions" in current page administration
+ And I navigate to "Question bank" in current page administration
Scenario: Duplicating a previously created question
When I choose "Duplicate" action for "Test question to be copied" in the question bank
diff --git a/question/tests/behat/edit_question_tags.feature b/question/tests/behat/edit_question_tags.feature
index 6f7007deda0..997747c7e0e 100644
--- a/question/tests/behat/edit_question_tags.feature
+++ b/question/tests/behat/edit_question_tags.feature
@@ -22,7 +22,7 @@ Feature: A teacher can manage tags on questions in the question bank
| Test questions | essay | Test question to be tagged | Write about whatever you want |
And I log in as "teacher1"
And I am on "Course 1" course homepage
- And I navigate to "Question bank > Questions" in current page administration
+ And I navigate to "Question bank" in current page administration
@javascript
Scenario: Manage tags on a question
diff --git a/question/tests/behat/edit_questions.feature b/question/tests/behat/edit_questions.feature
index 8fdb5ca08a7..d46215a5a92 100644
--- a/question/tests/behat/edit_questions.feature
+++ b/question/tests/behat/edit_questions.feature
@@ -22,7 +22,7 @@ Feature: A teacher can edit questions in the question bank
| Test questions | essay | Test question to be edited | Write about whatever you want |
And I log in as "teacher1"
And I am on "Course 1" course homepage
- And I navigate to "Question bank > Questions" in current page administration
+ And I navigate to "Question bank" in current page administration
Scenario: Edit a previously created question
When I choose "Edit question" action for "Test question to be edited" in the question bank
diff --git a/question/tests/behat/edit_questions_standard_tags.feature b/question/tests/behat/edit_questions_standard_tags.feature
index c6307015d16..8732aebd845 100644
--- a/question/tests/behat/edit_questions_standard_tags.feature
+++ b/question/tests/behat/edit_questions_standard_tags.feature
@@ -22,7 +22,7 @@ Feature: The questions can be tagged
Scenario: The tags autocomplete should include standard tags
When I log in as "teacher1"
And I am on "Course 1" course homepage
- And I navigate to "Question bank > Questions" in current page administration
+ And I navigate to "Question bank" in current page administration
And I press "Create a new question ..."
And I set the field "item_qtype_truefalse" to "1"
And I click on "Add" "button" in the "Choose a question type to add" "dialogue"
diff --git a/question/tests/behat/filter_questions_by_tag.feature b/question/tests/behat/filter_questions_by_tag.feature
index ce9df72c5fe..d2add2e957c 100644
--- a/question/tests/behat/filter_questions_by_tag.feature
+++ b/question/tests/behat/filter_questions_by_tag.feature
@@ -23,7 +23,7 @@ Feature: The questions in the question bank can be filtered by tags
| Test questions | essay | question 2 name | teacher1 | Question 2 text |
And I log in as "teacher1"
And I am on "Course 1" course homepage
- And I navigate to "Question bank > Questions" in current page administration
+ And I navigate to "Question bank" in current page administration
And I choose "Edit question" action for "question 1 name" in the question bank
And I set the following fields to these values:
| Tags | foo |
diff --git a/question/tests/behat/question_categories.feature b/question/tests/behat/question_categories.feature
index 42381d44ae9..90ab3e04f13 100644
--- a/question/tests/behat/question_categories.feature
+++ b/question/tests/behat/question_categories.feature
@@ -28,7 +28,7 @@ Feature: A teacher can move questions between categories in the question bank
@javascript
Scenario: Move a question between categories via the question page
- When I navigate to "Question bank > Questions" in current page administration
+ When I navigate to "Question bank" in current page administration
And I set the field "Select a category" to "Used category"
And I click on "Test question to be moved" "checkbox" in the "Test question to be moved" "table_row"
And I click on "With selected" "button"
@@ -42,7 +42,7 @@ Feature: A teacher can move questions between categories in the question bank
@javascript
Scenario: Move a question between categories via the question settings page
- When I navigate to "Question bank > Questions" in current page administration
+ When I navigate to "Question bank" in current page administration
And I set the field "Select a category" to "Used category"
And I choose "Edit question" action for "Test question to be moved" in the question bank
And I click on "Use this category" "checkbox"
diff --git a/question/tests/behat/question_categories_idnumber.feature b/question/tests/behat/question_categories_idnumber.feature
index 1bcf0409ae6..e3f3a48cc46 100644
--- a/question/tests/behat/question_categories_idnumber.feature
+++ b/question/tests/behat/question_categories_idnumber.feature
@@ -26,7 +26,7 @@ Feature: A teacher can put questions with idnumbers in categories in the questio
| questioncategory | qtype | name | questiontext | idnumber |
| Used category | essay | Test question 1 | Write about whatever you want | q1 |
| Used category | essay | Test question 2 | Write about whatever you want | q2 |
- And I navigate to "Question bank > Questions" in current page administration
+ And I navigate to "Question bank" in current page administration
And I choose "Edit question" action for "Test question 2" in the question bank
And I set the field "ID number" to "q1"
And I press "submitbutton"
@@ -41,7 +41,7 @@ Feature: A teacher can put questions with idnumbers in categories in the questio
And the following "questions" exist:
| questioncategory | qtype | name | questiontext | idnumber |
| Used category | essay | Test question 1 | Write about whatever you want | q1 |
- And I navigate to "Question bank > Questions" in current page administration
+ And I navigate to "Question bank" in current page administration
And I choose "Edit question" action for "Test question 1" in the question bank
And I press "Save changes"
Then I should not see "This ID number is already in use"
@@ -56,7 +56,7 @@ Feature: A teacher can put questions with idnumbers in categories in the questio
| questioncategory | qtype | name | questiontext | idnumber |
| Category 1 | essay | Question to edit | Write about whatever you want | q1 |
| Category 2 | essay | Other question | Write about whatever you want | q2 |
- And I navigate to "Question bank > Questions" in current page administration
+ And I navigate to "Question bank" in current page administration
And I choose "Edit question" action for "Question to edit" in the question bank
And I set the following fields to these values:
| Use this category | 0 |
@@ -77,7 +77,7 @@ Feature: A teacher can put questions with idnumbers in categories in the questio
| Used category | essay | Test question 1 | Write about whatever you want | q1 |
| Used category | essay | Test question 2 | Write about whatever you want | q2 |
| Subcategory | essay | Test question 3 | Write about whatever you want | q3 |
- When I navigate to "Question bank > Questions" in current page administration
+ When I navigate to "Question bank" in current page administration
And I choose "Edit question" action for "Test question 3" in the question bank
# The q1 idnumber is allowed for this question while it is in the Subcategory.
And I set the field "ID number" to "q1"
diff --git a/question/tests/behat/select_questions.feature b/question/tests/behat/select_questions.feature
index 90ff84c6432..0bf38944537 100644
--- a/question/tests/behat/select_questions.feature
+++ b/question/tests/behat/select_questions.feature
@@ -24,7 +24,7 @@ Feature: The questions in the question bank can be selected in various ways
| Test questions | numerical | C question 3 name | teacher1 | Question 3 text |
And I log in as "teacher1"
And I am on "Course 1" course homepage
- And I navigate to "Question bank > Questions" in current page administration
+ And I navigate to "Question bank" in current page administration
@javascript
Scenario: The question text can be chosen all in the list of questions
diff --git a/question/tests/behat/sort_questions.feature b/question/tests/behat/sort_questions.feature
index af57ff9660e..4da9c7965cb 100644
--- a/question/tests/behat/sort_questions.feature
+++ b/question/tests/behat/sort_questions.feature
@@ -24,7 +24,7 @@ Feature: The questions in the question bank can be sorted in various ways
| Test questions | numerical | C question 3 name | teacher1 | Question 3 text | numidnum Questions" in current page administration
+ And I navigate to "Question bank" in current page administration
@javascript
Scenario: The questions are sorted by type by default
diff --git a/question/type/essay/tests/behat/backup_and_restore.feature b/question/type/essay/tests/behat/backup_and_restore.feature
index e16bbf2ff73..fa540062cdb 100644
--- a/question/type/essay/tests/behat/backup_and_restore.feature
+++ b/question/type/essay/tests/behat/backup_and_restore.feature
@@ -1,5 +1,5 @@
@qtype @qtype_essay
-Feature: Test duplicating a quiz containing an Assay question
+Feature: Test duplicating a quiz containing an Essay question
As a teacher
In order re-use my courses containing Essay questions
I need to be able to backup and restore them
diff --git a/report/competency/tests/behat/breakdown_by_activity.feature b/report/competency/tests/behat/breakdown_by_activity.feature
index 38783fabf88..f4d078d0940 100644
--- a/report/competency/tests/behat/breakdown_by_activity.feature
+++ b/report/competency/tests/behat/breakdown_by_activity.feature
@@ -32,7 +32,7 @@ Feature: See the competencies for an activity
And I log in as "admin"
And I am on site homepage
And I follow "Course 1"
- And I follow "Competencies"
+ And I navigate to "Competencies" in current page administration
And I press "Add competencies to course"
And "Competency picker" "dialogue" should be visible
And I select "Test-Comp1" of the competency tree
@@ -48,7 +48,8 @@ Feature: See the competencies for an activity
@javascript
Scenario: Go to the competency breakdown report
- When I navigate to "Reports > Competency breakdown" in current page administration
+ When I navigate to "Reports" in current page administration
+ And I select "Competency breakdown" from the "Report type" singleselect
And I set the field "Filter competencies by resource or activity" to "PageName1"
Then I should see "Test-Comp1"
And I should not see "Test-Comp2"
diff --git a/report/competency/tests/behat/course_report_competency.feature b/report/competency/tests/behat/course_report_competency.feature
index ee19183d6fe..1cc0226ce18 100644
--- a/report/competency/tests/behat/course_report_competency.feature
+++ b/report/competency/tests/behat/course_report_competency.feature
@@ -20,7 +20,8 @@ Feature: In a course administration page, navigate through report page, test for
Scenario: Selector should be available in the course competency page
Given I log in as "admin"
And I am on "Course 1" course homepage
- When I navigate to "Reports > Competency breakdown" in current page administration
+ When I navigate to "Reports" in current page administration
+ And I select "Competency breakdown" from the "Report type" singleselect
Then "Report" "field" should exist
And the "Report" select box should contain "Competency breakdown"
And the field "Report" matches value "Competency breakdown"
diff --git a/report/completion/tests/behat/completion_report.feature b/report/completion/tests/behat/completion_report.feature
index 0f2af7b930a..aa1503259d4 100644
--- a/report/completion/tests/behat/completion_report.feature
+++ b/report/completion/tests/behat/completion_report.feature
@@ -33,5 +33,6 @@ Feature: See the completion for items in a course
| Page - PageName1 | 1 |
And I press "Save changes"
And I am on "Course 1" course homepage
- When I navigate to "Reports > Course completion" in current page administration
+ When I navigate to "Reports" in current page administration
+ And I select "Course completion" from the "Report type" singleselect
Then I should see "Ann, Jill, Grainne, Beauchamp"
diff --git a/report/completion/tests/behat/course_report_completion.feature b/report/completion/tests/behat/course_report_completion.feature
index fd8b9a6b876..a5647d5de5b 100644
--- a/report/completion/tests/behat/course_report_completion.feature
+++ b/report/completion/tests/behat/course_report_completion.feature
@@ -26,7 +26,8 @@ Feature: In a course administration page, navigate through report page, test for
| id_criteria_self | 1 |
And I press "Save changes"
And I am on "Course 1" course homepage
- When I navigate to "Reports > Course completion" in current page administration
+ When I navigate to "Reports" in current page administration
+ And I select "Course completion" from the "Report type" singleselect
Then "Report" "field" should exist
And the "Report" select box should contain "Course completion"
And the field "Report" matches value "Course completion"
diff --git a/report/log/tests/behat/course_report_log.feature b/report/log/tests/behat/course_report_log.feature
index 22d100e0f52..435df1b3ef4 100644
--- a/report/log/tests/behat/course_report_log.feature
+++ b/report/log/tests/behat/course_report_log.feature
@@ -20,7 +20,8 @@ Feature: In a course administration page, navigate through report page, test for
Scenario: Report selector should be available in the report log page
Given I log in as "admin"
And I am on "Course 1" course homepage
- When I navigate to "Reports > Logs" in current page administration
+ When I navigate to "Reports" in current page administration
+ And I select "Logs" from the "Report type" singleselect
Then "Report" "field" should exist
And the "Report" select box should contain "Logs"
And the field "Report" matches value "Logs"
diff --git a/report/log/tests/behat/user_log.feature b/report/log/tests/behat/user_log.feature
index b55a8ae203e..b499be9a4ba 100644
--- a/report/log/tests/behat/user_log.feature
+++ b/report/log/tests/behat/user_log.feature
@@ -59,6 +59,8 @@ Feature: User can view activity log.
And I follow "Ann, Jill, Grainne, Beauchamp"
When I follow "Today's logs"
And I should see "No log reader enabled"
+ And I am on "Course 1" course homepage
+ And I navigate to course participants
And I follow "Ann, Jill, Grainne, Beauchamp"
And I follow "All logs"
Then I should see "No log reader enabled"
@@ -66,7 +68,8 @@ Feature: User can view activity log.
Scenario: View Todays' log report for user through Course log report
Given I log in as "teacher1"
And I am on "Course 1" course homepage
- And I navigate to "Reports > Logs" in current page administration
+ And I navigate to "Reports" in current page administration
+ And I select "Logs" from the "Report type" singleselect
And I set the field with xpath "//select[@name='user']" to "Ann, Jill, Grainne, Beauchamp"
When I click on "Get these logs" "button"
Then I should see "Ann, Jill, Grainne, Beauchamp"
diff --git a/report/loglive/tests/behat/course_report_loglive.feature b/report/loglive/tests/behat/course_report_loglive.feature
index 90f08b95f83..f623e4c1d76 100644
--- a/report/loglive/tests/behat/course_report_loglive.feature
+++ b/report/loglive/tests/behat/course_report_loglive.feature
@@ -20,7 +20,8 @@ Feature: In a course administration page, navigate through report page, test for
Scenario: Selector should be available in live logs page
Given I log in as "admin"
And I am on "Course 1" course homepage
- When I navigate to "Reports > Live logs" in current page administration
+ When I navigate to "Reports" in current page administration
+ And I select "Live logs" from the "Report type" singleselect
Then "Report" "field" should exist
And the "Report" select box should contain "Live logs"
And the field "Report" matches value "Live logs"
diff --git a/report/loglive/tests/behat/loglive_report.feature b/report/loglive/tests/behat/loglive_report.feature
index 9b231d0da8b..1d10cb0ce65 100644
--- a/report/loglive/tests/behat/loglive_report.feature
+++ b/report/loglive/tests/behat/loglive_report.feature
@@ -48,6 +48,8 @@ Feature: In a report, admin can see loglive data
And I follow "Course module created"
And I switch to "action" window
And I am on "Course 1" course homepage
+ And I change window size to "large"
+ And I reload the page
And I add a "Database" to section "3" and I fill the form with:
| Name | Test name2 |
| Description | Test database description |
@@ -69,6 +71,8 @@ Feature: In a report, admin can see loglive data
And I follow "course_add mod"
And I switch to "action" window
And I am on "Course 1" course homepage
+ And I change window size to "large"
+ And I reload the page
And I add a "Database" to section "3" and I fill the form with:
| Name | Test name2 |
| Description | Test database description |
diff --git a/report/outline/tests/behat/course_report_outline.feature b/report/outline/tests/behat/course_report_outline.feature
index 3da3cb7f8c8..72f995b4ac7 100644
--- a/report/outline/tests/behat/course_report_outline.feature
+++ b/report/outline/tests/behat/course_report_outline.feature
@@ -20,7 +20,8 @@ Feature: In a course administration page, navigate through report page, test for
Scenario: Selector should be available in course activiy report page
Given I log in as "admin"
And I am on "Course 1" course homepage
- When I navigate to "Reports > Activity report" in current page administration
+ When I navigate to "Reports" in current page administration
+ And I select "Activity report" from the "Report type" singleselect
Then "Report" "field" should exist
And the "Report" select box should contain "Activity report"
And the field "Report" matches value "Activity report"
diff --git a/report/outline/tests/behat/filter.feature b/report/outline/tests/behat/filter.feature
index bc6d355b91c..5cde5088c38 100644
--- a/report/outline/tests/behat/filter.feature
+++ b/report/outline/tests/behat/filter.feature
@@ -45,7 +45,8 @@ Feature: Filter an outline report
And I log out
And I log in as "admin"
And I am on "Course 1" course homepage
- And I navigate to "Reports > Activity report" in current page administration
+ And I navigate to "Reports" in current page administration
+ And I select "Activity report" from the "Report type" singleselect
And I should see "2 views by 2 users" in the "Book name" "table_row"
And I should see "1 views by 1 users" in the "Forum name" "table_row"
When I set the following fields to these values:
@@ -77,7 +78,8 @@ Feature: Filter an outline report
And I log out
And I log in as "admin"
And I am on "Course 1" course homepage
- And I navigate to "Reports > Activity report" in current page administration
+ And I navigate to "Reports" in current page administration
+ And I select "Activity report" from the "Report type" singleselect
And I should see "2 views by 2 users" in the "Book name" "table_row"
And I should see "1 views by 1 users" in the "Forum name" "table_row"
When I set the following fields to these values:
diff --git a/report/outline/tests/behat/outline.feature b/report/outline/tests/behat/outline.feature
index 9d47dc58e43..8e6de50a98b 100644
--- a/report/outline/tests/behat/outline.feature
+++ b/report/outline/tests/behat/outline.feature
@@ -44,7 +44,8 @@ Feature: View an outline report
And I log out
And I log in as "teacher1"
And I am on "Course 1" course homepage
- When I navigate to "Reports > Activity report" in current page administration
+ When I navigate to "Reports" in current page administration
+ And I select "Activity report" from the "Report type" singleselect
Then I should see "2 views by 2 users" in the "Book name" "table_row"
And I should see "1 views by 1 users" in the "Forum name" "table_row"
@@ -65,7 +66,8 @@ Feature: View an outline report
And I log out
And I log in as "admin"
And I am on "Course 1" course homepage
- When I navigate to "Reports > Activity report" in current page administration
+ When I navigate to "Reports" in current page administration
+ And I select "Activity report" from the "Report type" singleselect
Then I should see "2 views by 2 users" in the "Book name" "table_row"
And I should see "1 views by 1 users" in the "Forum name" "table_row"
@@ -88,7 +90,8 @@ Feature: View an outline report
And I log out
And I log in as "teacher1"
And I am on "Course 1" course homepage
- When I navigate to "Reports > Activity report" in current page administration
+ When I navigate to "Reports" in current page administration
+ And I select "Activity report" from the "Report type" singleselect
Then I should see "2 views by 2 users" in the "Book name" "table_row"
And I should see "1 views by 1 users" in the "Forum name" "table_row"
@@ -97,7 +100,8 @@ Feature: View an outline report
And "Enable" "link" should exist in the "Legacy log" "table_row"
And I click on "Disable" "link" in the "Standard log" "table_row"
And I am on "Course 1" course homepage
- When I navigate to "Reports > Activity report" in current page administration
+ When I navigate to "Reports" in current page administration
+ And I select "Activity report" from the "Report type" singleselect
Then I should see "No log reader enabled"
Scenario: Multiple views from a single user are identified as not distinct
@@ -113,7 +117,8 @@ Feature: View an outline report
And I log out
When I log in as "teacher1"
And I am on "Course 1" course homepage
- And I navigate to "Reports > Activity report" in current page administration
+ And I navigate to "Reports" in current page administration
+ And I select "Activity report" from the "Report type" singleselect
Then I should see "3 views by 1 users" in the "Forum name" "table_row"
And I should see "-" in the "Book name" "table_row"
@@ -139,7 +144,8 @@ Feature: View an outline report
And I log out
When I log in as "teacher1"
And I am on "Course 1" course homepage
- And I navigate to "Reports > Activity report" in current page administration
+ And I navigate to "Reports" in current page administration
+ And I select "Activity report" from the "Report type" singleselect
Then I should see "6 views by 2 users" in the "Forum name" "table_row"
And I should see "-" in the "Book name" "table_row"
@@ -147,6 +153,7 @@ Feature: View an outline report
Given I log out
When I log in as "teacher1"
And I am on "Course 1" course homepage
- And I navigate to "Reports > Activity report" in current page administration
+ And I navigate to "Reports" in current page administration
+ And I select "Activity report" from the "Report type" singleselect
Then I should see "-" in the "Forum name" "table_row"
And I should see "-" in the "Book name" "table_row"
diff --git a/report/outline/tests/behat/user.feature b/report/outline/tests/behat/user.feature
index dbeac31bf9f..2a0d968f6b4 100644
--- a/report/outline/tests/behat/user.feature
+++ b/report/outline/tests/behat/user.feature
@@ -120,8 +120,8 @@ Feature: View the user page for the outline report
When I follow "Participants"
And I follow "Student 1"
And I follow "Outline report"
- Then I should see "Outline report"
+ Then I should see "forum1"
When I follow "Participants"
And I follow "Student 1"
And I follow "Complete report"
- Then I should see "Complete report"
+ Then I should see "No posts"
diff --git a/report/participation/tests/behat/course_report_participation.feature b/report/participation/tests/behat/course_report_participation.feature
index ec3564e0a1a..df57b743aa2 100644
--- a/report/participation/tests/behat/course_report_participation.feature
+++ b/report/participation/tests/behat/course_report_participation.feature
@@ -20,7 +20,8 @@ Feature: In a course administration page, navigate through report page, test for
Scenario: Selector should be available in the course participation page
Given I log in as "admin"
And I am on "Course 1" course homepage
- When I navigate to "Reports > Course participation" in current page administration
+ When I navigate to "Reports" in current page administration
+ And I select "Course participation" from the "Report type" singleselect
Then "Report" "field" should exist
And the "Report" select box should contain "Course participation"
And the field "Report" matches value "Course participation"
diff --git a/report/participation/tests/behat/filter_participation.feature b/report/participation/tests/behat/filter_participation.feature
index dbabdf9c03b..1d175d85b3d 100644
--- a/report/participation/tests/behat/filter_participation.feature
+++ b/report/participation/tests/behat/filter_participation.feature
@@ -42,7 +42,8 @@ Feature: In a participation report, admin can filter student actions
And I log out
When I am on the "Course 1" course page logged in as admin
- When I navigate to "Reports > Course participation" in current page administration
+ When I navigate to "Reports" in current page administration
+ And I select "Course participation" from the "Report type" singleselect
And I set the field "instanceid" to "Test book name"
And I set the field "roleid" to "Student"
And I press "Go"
@@ -71,7 +72,8 @@ Feature: In a participation report, admin can filter student actions
And I log in as "admin"
And I am on "Course 1" course homepage
- When I navigate to "Reports > Course participation" in current page administration
+ When I navigate to "Reports" in current page administration
+ And I select "Course participation" from the "Report type" singleselect
And I set the field "instanceid" to "Test book name"
And I set the field "roleid" to "Student"
And I press "Go"
@@ -84,7 +86,8 @@ Feature: In a participation report, admin can filter student actions
And I log in as "admin"
And I am on "Course 1" course homepage
- When I navigate to "Reports > Course participation" in current page administration
+ And I navigate to "Reports" in current page administration
+ And I select "Course participation" from the "Report type" singleselect
And I set the field "instanceid" to "Test book name"
And I set the field "roleid" to "Student"
And I press "Go"
diff --git a/report/participation/tests/behat/message_participants.feature b/report/participation/tests/behat/message_participants.feature
index 4b376aa4848..495a98140cd 100644
--- a/report/participation/tests/behat/message_participants.feature
+++ b/report/participation/tests/behat/message_participants.feature
@@ -33,7 +33,8 @@ Feature: Use the particiaption report to message groups of students
Scenario: Message all students from the participation report
Given I log in as "teacher1"
And I am on "Course 1" course homepage
- And I navigate to "Reports > Course participation" in current page administration
+ And I navigate to "Reports" in current page administration
+ And I select "Course participation" from the "Report type" singleselect
And I set the field "instanceid" to "Test book name"
And I set the field "roleid" to "Student"
And I press "Go"
@@ -47,7 +48,8 @@ Feature: Use the particiaption report to message groups of students
Scenario: Message students who have not participated in book
Given I log in as "teacher1"
And I am on "Course 1" course homepage
- And I navigate to "Reports > Course participation" in current page administration
+ And I navigate to "Reports" in current page administration
+ And I select "Course participation" from the "Report type" singleselect
And I set the field "instanceid" to "Test book name"
And I set the field "roleid" to "Student"
And I press "Go"
@@ -66,7 +68,8 @@ Feature: Use the particiaption report to message groups of students
| messaging | 0 |
And I log in as "teacher1"
And I am on "Course 1" course homepage
- And I navigate to "Reports > Course participation" in current page administration
+ And I navigate to "Reports" in current page administration
+ And I select "Course participation" from the "Report type" singleselect
When I set the field "instanceid" to "Test book name"
And I set the field "roleid" to "Student"
And I press "Go"
diff --git a/report/progress/tests/behat/activity_completion_report.feature b/report/progress/tests/behat/activity_completion_report.feature
index 3757ebd2d83..c693ffe968b 100644
--- a/report/progress/tests/behat/activity_completion_report.feature
+++ b/report/progress/tests/behat/activity_completion_report.feature
@@ -41,7 +41,8 @@ Feature: Teacher can view and override users' activity completion data via the p
# Teacher overrides the activity completion statuses to incomplete.
When I am on the "Course 1" course page logged in as teacher1
- And I navigate to "Reports > Activity completion" in current page administration
+ And I navigate to "Reports" in current page administration
+ And I select "Activity completion" from the "Report type" singleselect
And "Ann, Jill, Grainne, Beauchamp, my assignment: Completed" "icon" should exist in the "Ann, Jill, Grainne, Beauchamp" "table_row"
And "Ann, Jill, Grainne, Beauchamp, my assignment 2: Completed" "icon" should exist in the "Ann, Jill, Grainne, Beauchamp" "table_row"
And I click on "my assignment" "link" in the "Ann, Jill, Grainne, Beauchamp" "table_row"
@@ -66,7 +67,8 @@ Feature: Teacher can view and override users' activity completion data via the p
# And the activity completion report should show the same.
And I am on the "Course 1" Course page logged in as teacher1
- And I navigate to "Reports > Activity completion" in current page administration
+ And I navigate to "Reports" in current page administration
+ And I select "Activity completion" from the "Report type" singleselect
And "Ann, Jill, Grainne, Beauchamp, my assignment: Completed" "icon" should exist in the "Ann, Jill, Grainne, Beauchamp" "table_row"
And "Ann, Jill, Grainne, Beauchamp, my assignment 2: Completed" "icon" should exist in the "Ann, Jill, Grainne, Beauchamp" "table_row"
@@ -77,7 +79,8 @@ Feature: Teacher can view and override users' activity completion data via the p
Scenario: Given the status has been overridden to complete, when a student triggers completion updates, the status remains fixed.
# When the teacher overrides the activity completion statuses to complete.
When I am on the "Course 1" Course page logged in as teacher1
- And I navigate to "Reports > Activity completion" in current page administration
+ And I navigate to "Reports" in current page administration
+ And I select "Activity completion" from the "Report type" singleselect
And "Ann, Jill, Grainne, Beauchamp, my assignment: Not completed" "icon" should exist in the "Ann, Jill, Grainne, Beauchamp" "table_row"
And "Ann, Jill, Grainne, Beauchamp, my assignment 3: Not completed" "icon" should exist in the "Ann, Jill, Grainne, Beauchamp" "table_row"
And I click on "my assignment" "link" in the "Ann, Jill, Grainne, Beauchamp" "table_row"
diff --git a/report/progress/tests/behat/activity_completion_report_filter.feature b/report/progress/tests/behat/activity_completion_report_filter.feature
index 4f80079c3a5..f6260825b44 100644
--- a/report/progress/tests/behat/activity_completion_report_filter.feature
+++ b/report/progress/tests/behat/activity_completion_report_filter.feature
@@ -36,7 +36,8 @@ Feature: Teacher can view and filter activity completion data by group and activ
Scenario: Teacher can view the activity completion report using filtering and sorting options.
When I log in as "teacher1"
And I am on "Course 1" course homepage
- And I navigate to "Reports > Activity completion" in current page administration
+ And I navigate to "Reports" in current page administration
+ And I select "Activity completion" from the "Report type" singleselect
Then "My quiz B" "link" should appear before "My quiz A" "link"
And I should see "My assignment"
And I should see "My page"
diff --git a/report/progress/tests/behat/course_report_progress.feature b/report/progress/tests/behat/course_report_progress.feature
index 0bd6fc33c29..efe49b4c21e 100644
--- a/report/progress/tests/behat/course_report_progress.feature
+++ b/report/progress/tests/behat/course_report_progress.feature
@@ -26,7 +26,8 @@ Feature: In a course administration page, navigate through report page, test for
Scenario: Selector should be available in the course acitivity completion page
Given I log in as "admin"
And I am on "Course 1" course homepage
- When I navigate to "Reports > Activity completion" in current page administration
+ When I navigate to "Reports" in current page administration
+ And I select "Activity completion" from the "Report type" singleselect
Then "Report" "field" should exist
And the "Report" select box should contain "Activity completion"
And the field "Report" matches value "Activity completion"
@@ -44,6 +45,7 @@ Feature: In a course administration page, navigate through report page, test for
And the following config values are set as admin:
| showuseridentity | email,profile_field_frog |
When I am on the "C1" "Course" page logged in as "admin"
- And I navigate to "Reports > Activity completion" in current page administration
+ And I navigate to "Reports" in current page administration
+ And I select "Activity completion" from the "Report type" singleselect
Then I should see "Favourite frog"
Then I should see "Kermit" in the "Student Two" "table_row"
diff --git a/theme/boost/layout/columns2.php b/theme/boost/layout/columns2.php
index 314345a1679..e56733a730d 100644
--- a/theme/boost/layout/columns2.php
+++ b/theme/boost/layout/columns2.php
@@ -27,36 +27,44 @@ defined('MOODLE_INTERNAL') || die();
user_preference_allow_ajax_update('drawer-open-nav', PARAM_ALPHA);
require_once($CFG->libdir . '/behat/lib.php');
-if (isloggedin()) {
- $navdraweropen = (get_user_preferences('drawer-open-nav', 'true') == 'true');
-} else {
- $navdraweropen = false;
+// Add-a-block in editing mode.
+if (isset($PAGE->theme->addblockposition) &&
+ $PAGE->user_is_editing() &&
+ $PAGE->user_can_edit_blocks() &&
+ $PAGE->pagelayout !== 'mycourses'
+) {
+ $url = new moodle_url($PAGE->url, ['bui_addblock' => '', 'sesskey' => sesskey()]);
+
+ $block = new block_contents;
+ $block->content = $OUTPUT->render_from_template('core/add_block_button',
+ [
+ 'link' => $url->out(false),
+ 'escapedlink' => "?{$url->get_query_string(false)}",
+ 'pageType' => $PAGE->pagetype,
+ 'pageLayout' => $PAGE->pagelayout,
+ ]
+ );
+
+ $PAGE->blocks->add_fake_block($block, BLOCK_POS_RIGHT);
}
+
$extraclasses = [];
-if ($navdraweropen) {
- $extraclasses[] = 'drawer-open-left';
-}
$bodyattributes = $OUTPUT->body_attributes($extraclasses);
$blockshtml = $OUTPUT->blocks('side-pre');
$hasblocks = strpos($blockshtml, 'data-block=') !== false;
-$buildregionmainsettings = !$PAGE->include_region_main_settings_in_header_actions();
-// If the settings menu will be included in the header then don't add it here.
-$regionmainsettingsmenu = $buildregionmainsettings ? $OUTPUT->region_main_settings_menu() : false;
$secondarynavigation = false;
-if (!defined('BEHAT_SITE_RUNNING')) {
- $buildsecondarynavigation = $PAGE->has_secondary_navigation();
- if ($buildsecondarynavigation) {
- $moremenu = new \core\navigation\output\more_menu($PAGE->secondarynav, 'nav-tabs');
- $secondarynavigation = $moremenu->export_for_template($OUTPUT);
- }
-} else {
- $buildsecondarynavigation = $PAGE->has_secondary_navigation_setter(false);
+if ($PAGE->has_secondary_navigation()) {
+ $moremenu = new \core\navigation\output\more_menu($PAGE->secondarynav, 'nav-tabs');
+ $secondarynavigation = $moremenu->export_for_template($OUTPUT);
}
$primary = new core\navigation\output\primary($PAGE);
$renderer = $PAGE->get_renderer('core');
$primarymenu = $primary->export_for_template($renderer);
+$buildregionmainsettings = !$PAGE->include_region_main_settings_in_header_actions() && !$PAGE->has_secondary_navigation();
+// If the settings menu will be included in the header then don't add it here.
+$regionmainsettingsmenu = $buildregionmainsettings ? $OUTPUT->region_main_settings_menu() : false;
$templatecontext = [
'sitename' => format_string($SITE->shortname, true, ['context' => context_course::instance(SITEID), "escape" => false]),
@@ -64,16 +72,14 @@ $templatecontext = [
'sidepreblocks' => $blockshtml,
'hasblocks' => $hasblocks,
'bodyattributes' => $bodyattributes,
- 'navdraweropen' => $navdraweropen,
- 'regionmainsettingsmenu' => $regionmainsettingsmenu,
- 'hasregionmainsettingsmenu' => !empty($regionmainsettingsmenu),
'primarymoremenu' => $primarymenu['moremenu'],
- 'secondarymoremenu' => $secondarynavigation,
+ 'secondarymoremenu' => $secondarynavigation ?: false,
'mobileprimarynav' => $primarymenu['mobileprimarynav'],
'usermenu' => $primarymenu['user'],
'langmenu' => $primarymenu['lang'],
+ 'regionmainsettingsmenu' => $regionmainsettingsmenu,
+ 'hasregionmainsettingsmenu' => !empty($regionmainsettingsmenu),
];
$nav = $PAGE->flatnav;
-$templatecontext['flatnavigation'] = $nav;
$templatecontext['firstcollectionlabel'] = $nav->get_collectionlabel();
echo $OUTPUT->render_from_template('theme_boost/columns2', $templatecontext);
diff --git a/theme/boost/layout/drawers.php b/theme/boost/layout/drawers.php
index 65d818d87f5..d2a52a6c9c9 100644
--- a/theme/boost/layout/drawers.php
+++ b/theme/boost/layout/drawers.php
@@ -27,16 +27,31 @@ defined('MOODLE_INTERNAL') || die();
require_once($CFG->libdir . '/behat/lib.php');
require_once($CFG->dirroot . '/course/lib.php');
+// Add-a-block in editing mode.
+if (isset($PAGE->theme->addblockposition) && $PAGE->user_is_editing() && $PAGE->user_can_edit_blocks()) {
+ $url = new moodle_url($PAGE->url, ['bui_addblock' => '', 'sesskey' => sesskey()]);
+
+ $block = new block_contents;
+ $block->content = $OUTPUT->render_from_template('core/add_block_button',
+ [
+ 'link' => $url->out(false),
+ 'escapedlink' => "?{$url->get_query_string(false)}",
+ 'pageType' => $PAGE->pagetype,
+ 'pageLayout' => $PAGE->pagelayout,
+ ]
+ );
+
+ $PAGE->blocks->add_fake_block($block, BLOCK_POS_RIGHT);
+}
+
user_preference_allow_ajax_update('drawer-open-nav', PARAM_ALPHA);
user_preference_allow_ajax_update('drawer-open-index', PARAM_BOOL);
user_preference_allow_ajax_update('drawer-open-block', PARAM_BOOL);
if (isloggedin()) {
- $navdraweropen = (get_user_preferences('drawer-open-nav', 'true') == 'true');
$courseindexopen = (get_user_preferences('drawer-open-index') == true);
$blockdraweropen = (get_user_preferences('drawer-open-block') == true);
} else {
- $navdraweropen = false;
$courseindexopen = false;
$blockdraweropen = false;
}
@@ -46,9 +61,6 @@ if (defined('BEHAT_SITE_RUNNING')) {
}
$extraclasses = ['uses-drawers'];
-if ($navdraweropen) {
- $extraclasses[] = 'drawer-open-left';
-}
if ($courseindexopen) {
$extraclasses[] = 'drawer-open-index';
}
@@ -66,32 +78,18 @@ if (!$courseindex) {
$bodyattributes = $OUTPUT->body_attributes($extraclasses);
$forceblockdraweropen = $OUTPUT->firstview_fakeblocks();
-$buildregionmainsettings = !$PAGE->include_region_main_settings_in_header_actions();
-// If the settings menu will be included in the header then don't add it here.
-$regionmainsettingsmenu = $buildregionmainsettings ? $OUTPUT->region_main_settings_menu() : false;
-
$secondarynavigation = false;
-$overflow = false;
-if (!defined('BEHAT_SITE_RUNNING')) {
- $buildsecondarynavigation = $PAGE->has_secondary_navigation();
- if ($buildsecondarynavigation) {
- $secondary = $PAGE->secondarynav;
- $moremenu = new \core\navigation\output\more_menu($secondary, 'nav-tabs');
- $secondarynavigation = $moremenu->export_for_template($OUTPUT);
-
- // Get the pre-content stuff.
- $overflowdata = $secondary->get_overflow_menu_data();
- if (!is_null($overflowdata)) {
- $overflow = $overflowdata->export_for_template($OUTPUT);
- }
- }
-} else {
- $buildsecondarynavigation = $PAGE->has_secondary_navigation_setter(false);
+if ($PAGE->has_secondary_navigation()) {
+ $moremenu = new \core\navigation\output\more_menu($PAGE->secondarynav, 'nav-tabs');
+ $secondarynavigation = $moremenu->export_for_template($OUTPUT);
}
$primary = new core\navigation\output\primary($PAGE);
$renderer = $PAGE->get_renderer('core');
$primarymenu = $primary->export_for_template($renderer);
+$buildregionmainsettings = !$PAGE->include_region_main_settings_in_header_actions() && !$PAGE->has_secondary_navigation();
+// If the settings menu will be included in the header then don't add it here.
+$regionmainsettingsmenu = $buildregionmainsettings ? $OUTPUT->region_main_settings_menu() : false;
$templatecontext = [
'sitename' => format_string($SITE->shortname, true, ['context' => context_course::instance(SITEID), "escape" => false]),
@@ -99,23 +97,20 @@ $templatecontext = [
'sidepreblocks' => $blockshtml,
'hasblocks' => $hasblocks,
'bodyattributes' => $bodyattributes,
- 'navdraweropen' => $navdraweropen,
'courseindexopen' => $courseindexopen,
'blockdraweropen' => $blockdraweropen,
- 'regionmainsettingsmenu' => $regionmainsettingsmenu,
'courseindex' => $courseindex,
- 'hasregionmainsettingsmenu' => !empty($regionmainsettingsmenu),
'primarymoremenu' => $primarymenu['moremenu'],
- 'secondarymoremenu' => $secondarynavigation,
+ 'secondarymoremenu' => $secondarynavigation ?: false,
'mobileprimarynav' => $primarymenu['mobileprimarynav'],
'usermenu' => $primarymenu['user'],
'langmenu' => $primarymenu['lang'],
'forceblockdraweropen' => $forceblockdraweropen,
- 'overflow' => $overflow
+ 'regionmainsettingsmenu' => $regionmainsettingsmenu,
+ 'hasregionmainsettingsmenu' => !empty($regionmainsettingsmenu),
];
$nav = $PAGE->flatnav;
-$templatecontext['flatnavigation'] = $nav;
$templatecontext['firstcollectionlabel'] = $nav->get_collectionlabel();
echo $OUTPUT->render_from_template('theme_boost/drawers', $templatecontext);
diff --git a/theme/boost/scss/moodle/buttons.scss b/theme/boost/scss/moodle/buttons.scss
index a3ddda2c06d..65620fc5de5 100644
--- a/theme/boost/scss/moodle/buttons.scss
+++ b/theme/boost/scss/moodle/buttons.scss
@@ -79,4 +79,4 @@ p.arrow_button {
.btn-outline-#{$color} {
@include button-focus($value, $gray-800);
}
-}
\ No newline at end of file
+}
diff --git a/theme/boost/scss/moodle/course.scss b/theme/boost/scss/moodle/course.scss
index 833d2b77df4..a5395d145e0 100644
--- a/theme/boost/scss/moodle/course.scss
+++ b/theme/boost/scss/moodle/course.scss
@@ -1290,23 +1290,20 @@ span.editinstructions {
}
}
-$activity-item-background: theme-color-level('primary', -12) !default;
-$activity-item-border: theme-color-level('primary', -2) !default;
-$activity-item-color: $body-color;
-$activity-item-hover: theme-color-level('primary', -10) !default;
-.activity-add {
+.activity-add,
+.block-add {
@if $enable-rounded {
@include border-radius($card-border-radius);
}
- @include alert-variant($activity-item-background, $activity-item-border, $activity-item-border);
+ @include alert-variant($primary-light-background, $primary-light-border, $primary-light-border);
border-width: $border-width;
border-style: dashed;
.pluscontainer {
- border: $border-width solid $activity-item-border;
+ border: $border-width solid $primary-light-border;
}
&:hover {
cursor: pointer;
- background-color: $activity-item-hover;
+ background-color: $primary-light-hover;
}
width: 100%;
border-radius: 4px;
diff --git a/theme/boost/scss/moodle/variables.scss b/theme/boost/scss/moodle/variables.scss
index ece503c2331..92f47cf14d1 100644
--- a/theme/boost/scss/moodle/variables.scss
+++ b/theme/boost/scss/moodle/variables.scss
@@ -29,3 +29,8 @@ $box-shadow-drawer-left: -0.25rem .25rem .8rem rgba($black, .025) !default;
$box-shadow-drawer-right: 0 .25rem .8rem rgba($black, .025) !default;
$moremenu-height: 60px !default;
+
+$primary-light-background: theme-color-level('primary', -12) !default;
+$primary-light-border: theme-color-level('primary', -2) !default;
+$primary-light-color: $body-color;
+$primary-light-hover: theme-color-level('primary', -10) !default;
diff --git a/theme/boost/style/moodle.css b/theme/boost/style/moodle.css
index ea23727337f..5f16ec115bc 100644
--- a/theme/boost/style/moodle.css
+++ b/theme/boost/style/moodle.css
@@ -14603,7 +14603,8 @@ span.editinstructions {
.automatic-completion-conditions .badge {
font-size: 100%; }
-.activity-add {
+.activity-add,
+.block-add {
border-radius: 0.25rem;
color: #3584c9;
background-color: #f5f9fc;
@@ -14612,13 +14613,17 @@ span.editinstructions {
border-style: dashed;
width: 100%;
border-radius: 4px; }
- .activity-add hr {
+ .activity-add hr,
+ .block-add hr {
border-top-color: #3077b5; }
- .activity-add .alert-link {
+ .activity-add .alert-link,
+ .block-add .alert-link {
color: #2a69a1; }
- .activity-add .pluscontainer {
+ .activity-add .pluscontainer,
+ .block-add .pluscontainer {
border: 1px solid #3584c9; }
- .activity-add:hover {
+ .activity-add:hover,
+ .block-add:hover {
cursor: pointer;
background-color: #cfe2f2; }
diff --git a/theme/boost/templates/columns2.mustache b/theme/boost/templates/columns2.mustache
index 16235c57be1..04dfab3044b 100644
--- a/theme/boost/templates/columns2.mustache
+++ b/theme/boost/templates/columns2.mustache
@@ -58,7 +58,6 @@
{{{ output.standard_top_of_body_html }}}
{{> theme_boost/navbar }}
- {{> theme_boost/nav-drawer }}