diff --git a/admin/tests/behat/display_short_names.feature b/admin/tests/behat/display_short_names.feature index 864b73379c5..1a128ca9d1e 100644 --- a/admin/tests/behat/display_short_names.feature +++ b/admin/tests/behat/display_short_names.feature @@ -16,8 +16,7 @@ Feature: Display extended course names And I should not see "C_shortname Course fullname" Scenario: Courses list with extended course names - Given I expand "Site administration" node - And I click on "Courses" "link" in the "//div[@id='settingsnav']/descendant::li[contains(concat(' ', normalize-space(@class), ' '), ' type_setting ')][contains(., 'Appearance')]" "xpath_element" + Given I navigate to "Appearance > Courses" in site administration And I set the field "Display extended course names" to "1" When I press "Save changes" And I am on site homepage diff --git a/admin/tests/behat/filter_users.feature b/admin/tests/behat/filter_users.feature index f8b930dd822..b9a03e5ee7b 100644 --- a/admin/tests/behat/filter_users.feature +++ b/admin/tests/behat/filter_users.feature @@ -25,7 +25,7 @@ Feature: An administrator can filter user accounts by role, cohort and other pro And I log in as "admin" And I add "User Two (two@example.com)" user to "CH1" cohort members And I add "User Three (three@example.com)" user to "CH1" cohort members - And I follow "Browse list of users" + And I navigate to "Users > Accounts > Browse list of users" in site administration Scenario: Filter user accounts by role and cohort When I set the following fields to these values: diff --git a/admin/tool/availabilityconditions/tests/behat/manage_conditions.feature b/admin/tool/availabilityconditions/tests/behat/manage_conditions.feature index 65b0b4a398b..b028da9fcad 100644 --- a/admin/tool/availabilityconditions/tests/behat/manage_conditions.feature +++ b/admin/tool/availabilityconditions/tests/behat/manage_conditions.feature @@ -8,6 +8,8 @@ Feature: Manage availability conditions Scenario: Display list of availability conditions # Check the report doesn't show when not enabled. Given I log in as "admin" + And I press "Customise this page" + And I add the "Administration" block if not present And the following config values are set as admin: | enableavailability | 0 | And I expand "Site administration" node diff --git a/admin/tool/behat/tests/behat/data_generators.feature b/admin/tool/behat/tests/behat/data_generators.feature index 051dd86ca23..5560c833be8 100644 --- a/admin/tool/behat/tests/behat/data_generators.feature +++ b/admin/tool/behat/tests/behat/data_generators.feature @@ -59,8 +59,7 @@ Feature: Set up contextual data for tests When I log in as "admin" And I am on site homepage And I follow "Course 1" - And I expand "Users" node - And I follow "Groups" + And I navigate to "Users > Groups" in current page administration Then I should see "Group 1" And I should see "Group 2" And I follow "Groupings" @@ -90,8 +89,7 @@ Feature: Set up contextual data for tests When I log in as "admin" And I am on site homepage And I follow "Course 1" - And I expand "Users" node - And I follow "Permissions" + And I navigate to "Users > Permissions" in current page administration And I set the field "Advanced role override" to "Student (1)" Then "mod/forum:editanypost" capability has "Allow" permission And I press "Cancel" @@ -134,30 +132,31 @@ Feature: Set up contextual data for tests And the following "course enrolments" exist: | user | course | role | | user4 | C1 | custom1 | + | user2 | C1 | student | + | user3 | C1 | editingteacher | And the following "role assigns" exist: | user | role | contextlevel | reference | | user1 | manager | System | | | user2 | editingteacher | Category | CAT1 | - | user3 | editingteacher | Course | C1 | | user5 | custom2 | System | | When I log in as "user1" And I am on site homepage - Then I should see "Front page settings" + Then "Edit settings" "link" should exist in current page administration And I log out And I log in as "user2" And I am on site homepage And I follow "Course 1" - And I should see "Turn editing on" + And "Turn editing on" "link" should exist in current page administration And I log out And I log in as "user3" And I am on site homepage And I follow "Course 1" - And I should see "Turn editing on" + And "Turn editing on" "link" should exist in current page administration And I log out And I log in as "user4" And I am on site homepage And I follow "Course 1" - And I should see "Turn editing on" + And "Turn editing on" "link" should exist in current page administration And I log out And I log in as "user5" And I should see "You are logged in as" @@ -264,8 +263,7 @@ Feature: Set up contextual data for tests When I log in as "admin" And I am on site homepage And I follow "Course 1" - And I expand "Users" node - And I follow "Groups" + And I navigate to "Users > Groups" in current page administration Then the "groups" select box should contain "Group 1 (1)" And the "groups" select box should contain "Group 2 (1)" And I set the field "groups" to "Group 1 (1)" @@ -302,7 +300,7 @@ Feature: Set up contextual data for tests | System cohort A | 1 | | System cohort B | 2 | And I should not see "Cohort in category" - And I follow "Courses" + And I am on course index And I follow "Cat 1" And I follow "Cohorts" And I should not see "System cohort" @@ -322,10 +320,9 @@ Feature: Set up contextual data for tests | fullname | course | gradecategory | | Grade sub category 2 | C1 | Grade category 1 | When I log in as "admin" - And I am on site homepage - And I follow "Courses" + And I am on course index And I follow "Course 1" - And I go to "View > Grader report" in the course gradebook + And I navigate to "View > Grader report" in the course gradebook Then I should see "Grade category 1" And I should see "Grade sub category 2" @@ -349,7 +346,7 @@ Feature: Set up contextual data for tests When I log in as "admin" And I am on site homepage And I follow "Course 1" - And I go to "Setup > Gradebook setup" in the course gradebook + And I navigate to "Setup > Gradebook setup" in the course gradebook Then I should see "Test Grade Item 1" And I follow "Edit Test Grade Item 1" And I expand all fieldsets @@ -378,7 +375,7 @@ Feature: Set up contextual data for tests When I log in as "admin" And I am on site homepage And I follow "Course 1" - And I go to "Scales" in the course gradebook + And I navigate to "Scales" in the course gradebook Then I should see "Test Scale 1" And I should see "Disappointing, Good, Very good, Excellent" @@ -429,7 +426,7 @@ Feature: Set up contextual data for tests When I log in as "admin" And I am on site homepage And I follow "Course 1" - And I go to "Setup > Gradebook setup" in the course gradebook + And I navigate to "Setup > Gradebook setup" in the course gradebook Then I should see "Test Outcome Grade Item 1" And I follow "Edit Test Outcome Grade Item 1" And the field "Outcome" matches value "Grade outcome 1" diff --git a/admin/tool/behat/tests/behat/edit_permissions.feature b/admin/tool/behat/tests/behat/edit_permissions.feature index b07c1218bcb..c0e7cc045f6 100644 --- a/admin/tool/behat/tests/behat/edit_permissions.feature +++ b/admin/tool/behat/tests/behat/edit_permissions.feature @@ -32,8 +32,7 @@ Feature: Edit capabilities Scenario: Course capabilities overrides Given I log in as "teacher1" And I follow "Course 1" - And I expand "Users" node - And I follow "Permissions" + And I navigate to "Users > Permissions" in current page administration And I override the system permissions of "Student" role with: | mod/forum:deleteanypost | Prohibit | | mod/forum:editanypost | Prevent | @@ -52,7 +51,7 @@ Feature: Edit capabilities | Forum name | I'm the name | | Description | I'm the introduction | And I follow "I'm the name" - And I navigate to "Permissions" node in "Forum administration" + And I navigate to "Permissions" in current page administration And I override the system permissions of "Student" role with: | mod/forum:deleteanypost | Prohibit | | mod/forum:editanypost | Prevent | diff --git a/admin/tool/behat/tests/behat/get_and_set_fields.feature b/admin/tool/behat/tests/behat/get_and_set_fields.feature index b867c582c51..f9ac3a15070 100644 --- a/admin/tool/behat/tests/behat/get_and_set_fields.feature +++ b/admin/tool/behat/tests/behat/get_and_set_fields.feature @@ -33,8 +33,6 @@ Feature: Verify that all form fields values can be get and set | activity | course | idnumber | name | intro | firstpagetitle | wikimode | visible | | wiki | C1 | wiki1 | Test this one | Test this one | Test this one | collaborative | 0 | And I log in as "admin" - And I expand "Site administration" node - And I expand "Appearance" node And I am on site homepage And I follow "Course 1" And I navigate to "Reset" node in "Course administration" @@ -60,9 +58,8 @@ Feature: Verify that all form fields values can be get and set | HTML format | Student page contents | And I press "Save" Then I should see "Student page contents" in the "region-main" "region" - And I click on "Edit" "link" in the "Administration" "block" # Select (multi-select) - Checking "I set the field". - And I click on "Edit settings" "link" in the "Administration" "block" + And I navigate to "Edit settings" in current page administration And I expand all fieldsets # Checkbox - Checking "I set the field". And I set the field "Display description on course page" to "1" @@ -75,7 +72,7 @@ Feature: Verify that all form fields values can be get and set And I press "Save and return to course" And I should see "Test this one" And I follow "Test this one" - And I click on "Edit settings" "link" in the "Administration" "block" + And I navigate to "Edit settings" in current page administration # Checkbox - Checking "the field matches value" and "the following fields match these values". And the following fields match these values: | Display description on course page | 1 | @@ -91,7 +88,7 @@ Feature: Verify that all form fields values can be get and set # Select (simple) - Checking "I set the field". And I set the field "Group mode" to "Separate groups" And I press "Save and display" - And I click on "Edit settings" "link" in the "Administration" "block" + And I navigate to "Edit settings" in current page administration And the following fields match these values: | Default format | NWiki | | Group mode | Separate groups | @@ -134,8 +131,7 @@ Feature: Verify that all form fields values can be get and set @javascript Scenario: with JS enabled all form fields getters and setters works as expected Then I follow "Course 1" - And I expand "Users" node - And I follow "Groups" + And I navigate to "Users > Groups" in current page administration # Select (multi-select & AJAX) - Checking "I set the field" and "select box should contain". And I set the field "groups" to "Group 2" And the "members" select box should contain "Student 2" @@ -158,7 +154,7 @@ Feature: Verify that all form fields values can be get and set And the "available[day]" "field" should be enabled And the field "deadline[enabled]" matches value "1" And I press "Save and display" - And I click on "Edit settings" "link" in the "Administration" "block" + And I navigate to "Edit settings" in current page administration And the field "available[enabled]" matches value "1" And the "available[day]" "field" should be enabled And the field "deadline[enabled]" matches value "1" diff --git a/admin/tool/customlang/db/upgrade.php b/admin/tool/customlang/db/upgrade.php index b63626f97d1..60bce5a37fe 100644 --- a/admin/tool/customlang/db/upgrade.php +++ b/admin/tool/customlang/db/upgrade.php @@ -41,5 +41,8 @@ function xmldb_tool_customlang_upgrade($oldversion) { // Moodle v3.1.0 release upgrade line. // Put any upgrade step following this. + // Automatically generated Moodle v3.2.0 release upgrade line. + // Put any upgrade step following this. + return true; } diff --git a/admin/tool/log/db/upgrade.php b/admin/tool/log/db/upgrade.php index 042ed972bba..8590d90ddff 100644 --- a/admin/tool/log/db/upgrade.php +++ b/admin/tool/log/db/upgrade.php @@ -45,5 +45,8 @@ function xmldb_tool_log_upgrade($oldversion) { // Moodle v3.1.0 release upgrade line. // Put any upgrade step following this. + // Automatically generated Moodle v3.2.0 release upgrade line. + // Put any upgrade step following this. + return true; } diff --git a/admin/tool/log/store/database/db/upgrade.php b/admin/tool/log/store/database/db/upgrade.php index 21e34e09af6..ec98e955af6 100644 --- a/admin/tool/log/store/database/db/upgrade.php +++ b/admin/tool/log/store/database/db/upgrade.php @@ -39,5 +39,8 @@ function xmldb_logstore_database_upgrade($oldversion) { // Moodle v3.1.0 release upgrade line. // Put any upgrade step following this. + // Automatically generated Moodle v3.2.0 release upgrade line. + // Put any upgrade step following this. + return true; } diff --git a/admin/tool/log/store/standard/db/upgrade.php b/admin/tool/log/store/standard/db/upgrade.php index 4834535f2c5..3313749db77 100644 --- a/admin/tool/log/store/standard/db/upgrade.php +++ b/admin/tool/log/store/standard/db/upgrade.php @@ -56,5 +56,8 @@ function xmldb_logstore_standard_upgrade($oldversion) { // Moodle v3.1.0 release upgrade line. // Put any upgrade step following this. + // Automatically generated Moodle v3.2.0 release upgrade line. + // Put any upgrade step following this. + return true; } diff --git a/admin/tool/lp/tests/behat/framework_crud.feature b/admin/tool/lp/tests/behat/framework_crud.feature index 27b6f95ddbb..bccf5f76722 100644 --- a/admin/tool/lp/tests/behat/framework_crud.feature +++ b/admin/tool/lp/tests/behat/framework_crud.feature @@ -7,12 +7,9 @@ Feature: Manage competency frameworks Background: Given I log in as "admin" And I am on site homepage - And I expand "Site administration" node - When I expand "Competencies" node - Then I should see "Competency frameworks" Scenario: Create a new framework - Given I follow "Competency frameworks" + Given I navigate to "Competencies > Competency frameworks" in site administration And I should see "List of competency frameworks" And I click on "Add new competency framework" "button" And I should see "General" @@ -34,7 +31,7 @@ Feature: Manage competency frameworks Given the following lp "frameworks" exist: | shortname | idnumber | | Science Year-2 | sc-y-2 | - And I follow "Competency frameworks" + And I navigate to "Competencies > Competency frameworks" in site administration And I should see "Science Year-2" When I click on "Science Year-2" "link" Then I should see "Science Year-2" @@ -43,7 +40,7 @@ Feature: Manage competency frameworks Given the following lp "frameworks" exist: | shortname | idnumber | | Science Year-3 | sc-y-3 | - And I follow "Competency frameworks" + And I navigate to "Competencies > Competency frameworks" in site administration And I should see "Science Year-3" And I click on "Edit" of edit menu in the "Science Year-3" row And the field "Name" matches value "Science Year-3 " @@ -57,7 +54,7 @@ Feature: Manage competency frameworks Given the following lp "frameworks" exist: | shortname | idnumber | | Science Year-4 | sc-y-4 | - And I follow "Competency frameworks" + And I navigate to "Competencies > Competency frameworks" in site administration And I should see "Science Year-4" And I should see "sc-y-4" And I click on "Delete" of edit menu in the "Science Year-4" row @@ -90,7 +87,7 @@ Scenario: Edit a framework with competencies in user competency | user | competency | | admin | Comp1 | | admin | Comp2 | - And I follow "Competency frameworks" + And I navigate to "Competencies > Competency frameworks" in site administration And I should see "Science Year-5" And I click on "Edit" of edit menu in the "Science Year-5" row And the field "Name" matches value "Science Year-5 " @@ -120,7 +117,7 @@ Scenario: Edit a framework with competencies in user competency plan | user | competency | plan | | admin | Comp1 | Plan Science-6 | | admin | Comp2 | Plan Science-6 | - And I follow "Competency frameworks" + And I navigate to "Competencies > Competency frameworks" in site administration And I should see "Science Year-6" And I click on "Edit" of edit menu in the "Science Year-6" row And the field "Name" matches value "Science Year-6 " diff --git a/admin/tool/lp/tests/behat/plan_crud.feature b/admin/tool/lp/tests/behat/plan_crud.feature index a03113dcc2c..71086f3a886 100644 --- a/admin/tool/lp/tests/behat/plan_crud.feature +++ b/admin/tool/lp/tests/behat/plan_crud.feature @@ -26,9 +26,7 @@ Feature: Manage plearning plan | shortname | description | | Science template | science template description | And I follow "Home" - And I expand "Site administration" node - And I expand "Competencies" node - And I follow "Learning plan templates" + And I navigate to "Competencies > Learning plan templates" in site administration And I click on ".template-userplans" "css_element" in the "Science template" "table_row" And I click on ".form-autocomplete-downarrow" "css_element" And I click on "Admin" item in the autocomplete list @@ -52,9 +50,7 @@ Feature: Manage plearning plan | student-plan1 | COHORTPLAN | | student-plan2 | COHORTPLAN | And I follow "Home" - And I expand "Site administration" node - And I expand "Competencies" node - And I follow "Learning plan templates" + And I navigate to "Competencies > Learning plan templates" in site administration And I click on ".template-cohorts" "css_element" in the "Science template cohort" "table_row" And I click on ".form-autocomplete-downarrow" "css_element" And I click on "cohort plan" item in the autocomplete list diff --git a/admin/tool/lp/tests/behat/plan_workflow.feature b/admin/tool/lp/tests/behat/plan_workflow.feature index 8a3a4386262..bfaf1e0307a 100644 --- a/admin/tool/lp/tests/behat/plan_workflow.feature +++ b/admin/tool/lp/tests/behat/plan_workflow.feature @@ -145,10 +145,7 @@ Feature: Manage plan workflow | Test-Plan3 | user1 | Description of plan 3 for user 1 | active | manager1 | | Test-Plan4 | user1 | Description of plan 4 for user 1 | active | manager1 | And I log in as "manager1" - And I expand "Site administration" node - And I expand "Users" node - And I expand "Accounts" node - And I follow "Browse list of users" + And I navigate to "Users > Accounts > Browse list of users" in site administration And I follow "User 1" And I follow "Learning plans" And I should see "List of learning plans" @@ -167,10 +164,7 @@ Feature: Manage plan workflow | Test-Plan3 | user1 | Description of plan 3 for user 1 | active | manager1 | | Test-Plan4 | user1 | Description of plan 4 for user 1 | active | manager1 | And I log in as "manager1" - And I expand "Site administration" node - And I expand "Users" node - And I expand "Accounts" node - And I follow "Browse list of users" + And I navigate to "Users > Accounts > Browse list of users" in site administration And I follow "User 1" And I follow "Learning plans" And I should see "List of learning plans" @@ -191,10 +185,7 @@ Scenario: Manager reopen a complete learning plan | Test-Plan3 | user1 | Description of plan 3 for user 1 | complete | manager1 | | Test-Plan4 | user1 | Description of plan 4 for user 1 | complete | manager1 | And I log in as "manager1" - And I expand "Site administration" node - And I expand "Users" node - And I expand "Accounts" node - And I follow "Browse list of users" + And I navigate to "Users > Accounts > Browse list of users" in site administration And I follow "User 1" And I follow "Learning plans" And I should see "List of learning plans" diff --git a/admin/tool/lp/tests/behat/template_crud.feature b/admin/tool/lp/tests/behat/template_crud.feature index 268651701d0..1479fcfbcd8 100644 --- a/admin/tool/lp/tests/behat/template_crud.feature +++ b/admin/tool/lp/tests/behat/template_crud.feature @@ -7,12 +7,9 @@ Feature: Manage plearning plan templates Background: Given I log in as "admin" And I am on site homepage - And I expand "Site administration" node - When I expand "Competencies" node - Then I should see "Learning plan templates" Scenario: Create a new learning plan template - Given I follow "Learning plan templates" + Given I navigate to "Competencies > Learning plan templates" in site administration And I should see "List of learning plan templates" And I click on "Add new learning plan template" "button" And I should see "Add new learning plan template" @@ -26,7 +23,7 @@ Feature: Manage plearning plan templates Given the following lp "templates" exist: | shortname | description | | Science template Year-2 | science template description | - And I follow "Learning plan templates" + And I navigate to "Competencies > Learning plan templates" in site administration And I should see "Science template Year-2" When I click on "Science template Year-2" "link" Then I should see "Science template Year-2" @@ -36,7 +33,7 @@ Feature: Manage plearning plan templates Given the following lp "templates" exist: | shortname | description | | Science template Year-3 | science template description | - And I follow "Learning plan templates" + And I navigate to "Competencies > Learning plan templates" in site administration And I should see "Science template Year-3" And I click on "Edit" of edit menu in the "Science template Year-3" row And the field "Name" matches value "Science template Year-3" @@ -49,7 +46,7 @@ Feature: Manage plearning plan templates Given the following lp "templates" exist: | shortname | description | | Science template Year-4 | science template description | - And I follow "Learning plan templates" + And I navigate to "Competencies > Learning plan templates" in site administration And I should see "Science template Year-4" And I click on "Delete" of edit menu in the "Science template Year-4" row And "Confirm" "dialogue" should be visible diff --git a/admin/tool/monitor/db/upgrade.php b/admin/tool/monitor/db/upgrade.php index aaea29a1503..b96b1056220 100644 --- a/admin/tool/monitor/db/upgrade.php +++ b/admin/tool/monitor/db/upgrade.php @@ -77,5 +77,8 @@ function xmldb_tool_monitor_upgrade($oldversion) { upgrade_plugin_savepoint(true, 2016052305, 'tool', 'monitor'); } + // Automatically generated Moodle v3.2.0 release upgrade line. + // Put any upgrade step following this. + return true; } diff --git a/admin/tool/recyclebin/tests/behat/backup_user_data.feature b/admin/tool/recyclebin/tests/behat/backup_user_data.feature index 9f18cbd5ade..31065d0ae95 100644 --- a/admin/tool/recyclebin/tests/behat/backup_user_data.feature +++ b/admin/tool/recyclebin/tests/behat/backup_user_data.feature @@ -65,6 +65,6 @@ Feature: Backup user data And I log out And I log in as "student1" And I follow "Course 1" - When I go to "User report" in the course gradebook + When I navigate to "User report" in the course gradebook Then "Quiz 1" row "Grade" column of "user-grade" table should contain "5" And "Quiz 1" row "Percentage" column of "user-grade" table should contain "50" diff --git a/admin/tool/recyclebin/tests/behat/basic_functionality.feature b/admin/tool/recyclebin/tests/behat/basic_functionality.feature index b10af91f9e4..c806b7fc3bd 100644 --- a/admin/tool/recyclebin/tests/behat/basic_functionality.feature +++ b/admin/tool/recyclebin/tests/behat/basic_functionality.feature @@ -42,6 +42,10 @@ Feature: Basic recycle bin functionality And I should see "Test assign" in the "Topic 1" "section" Scenario: Restore a deleted course + # TODO MDL-57250 remove extra category. + Given the following "categories" exist: + | name | idnumber | + | There is a bug with navigation and we need an extra category | CAT1 | Given I log in as "admin" And I go to the courses management page And I click on "delete" action for "Course 2" in management course listing @@ -49,9 +53,10 @@ Feature: Basic recycle bin functionality And I should see "Deleting C2" And I should see "C2 has been completely deleted" And I press "Continue" - And I go to the courses management page - And I should not see "Course 2" in the "#course-listing" "css_element" - When I navigate to "Recycle bin" node in "Category: Miscellaneous" + And I am on course index + And I follow "Miscellaneous" + And I should not see "Course 2" + When I navigate to "Recycle bin" in current page administration Then I should see "Course 2" And I should see "Contents will be permanently deleted after 14 days" And I click on "Restore" "link" in the "region-main" "region" diff --git a/admin/tool/spamcleaner/index.php b/admin/tool/spamcleaner/index.php index 27da1b66e36..63d3485e5dd 100644 --- a/admin/tool/spamcleaner/index.php +++ b/admin/tool/spamcleaner/index.php @@ -75,7 +75,7 @@ if (!empty($delall) && confirm_sesskey()) { exit; } -if (!empty($ignore)) { +if (!empty($ignore) && confirm_sesskey()) { unset($SESSION->users_result[$id]); echo json_encode(true); exit; diff --git a/admin/tool/uploaduser/tests/behat/upload_users.feature b/admin/tool/uploaduser/tests/behat/upload_users.feature index 32aa9631c35..7ee6235889f 100644 --- a/admin/tool/uploaduser/tests/behat/upload_users.feature +++ b/admin/tool/uploaduser/tests/behat/upload_users.feature @@ -29,14 +29,13 @@ Feature: Upload users And I should see "Section 1" And I press "Upload users" And I press "Continue" - And I follow "Browse list of users" + And I navigate to "Users > Accounts > Browse list of users" in site administration And I should see "Tom Jones" And I should see "Trent Reznor" And I should see "reznor@example.com" And I am on site homepage And I follow "Maths" - And I expand "Users" node - And I follow "Groups" + And I navigate to "Users > Groups" in current page administration And I set the field "groups" to "Section 1 (1)" And the "members" select box should contain "Tom Jones" diff --git a/admin/tool/usertours/db/upgrade.php b/admin/tool/usertours/db/upgrade.php index fdf92d61320..aa235b13b0c 100644 --- a/admin/tool/usertours/db/upgrade.php +++ b/admin/tool/usertours/db/upgrade.php @@ -42,5 +42,8 @@ function xmldb_tool_usertours_upgrade($oldversion) { upgrade_plugin_savepoint(true, 2016120501, 'tool', 'usertours'); } + // Automatically generated Moodle v3.2.0 release upgrade line. + // Put any upgrade step following this. + return true; } diff --git a/admin/tool/usertours/tests/behat/create_tour.feature b/admin/tool/usertours/tests/behat/create_tour.feature index 8e967bd1975..33c7db7cc77 100644 --- a/admin/tool/usertours/tests/behat/create_tour.feature +++ b/admin/tool/usertours/tests/behat/create_tour.feature @@ -25,7 +25,7 @@ Feature: Add a new user tour And I add steps to the "First tour" tour: | targettype | targetvalue_selector | Title | Content | | Selector | .usermenu | User menu | This is your personal user menu. You'll find your personal preferences and your user profile here. | - When I click on "Dashboard" "link" in the "Navigation" "block" + When I am on homepage Then I should see "Welcome to your personal learning space. We'd like to give you a quick tour to show you some of the areas you may find helpful" And I press "Next" And I should see "This area shows you what's happening in some of your courses" @@ -38,7 +38,7 @@ Feature: Add a new user tour And I should see "This area shows you what's happening in some of your courses" And I press "End tour" And I should not see "This area shows you what's happening in some of your courses" - And I click on "Dashboard" "link" in the "Navigation" "block" + And I am on homepage And I should not see "Welcome to your personal learning space. We'd like to give you a quick tour to show you some of the areas you may find helpful" And I should not see "This area shows you what's happening in some of your courses" And I follow "Reset user tour on this page" @@ -58,7 +58,7 @@ Feature: Add a new user tour And I add steps to the "First tour" tour: | targettype | Title | Content | | Display in middle of page | Welcome | Welcome to your personal learning space. We'd like to give you a quick tour to show you some of the areas you may find helpful | - When I click on "Dashboard" "link" in the "Navigation" "block" + When I am on homepage Then I should not see "Welcome to your personal learning space. We'd like to give you a quick tour to show you some of the areas you may find helpful" @javascript @@ -77,5 +77,5 @@ Feature: Add a new user tour | Display in middle of page | Welcome | Welcome to your personal learning space. We'd like to give you a quick tour to show you some of the areas you may find helpful | And I open the User tour settings page When I click on "Enable" "link" in the "My first tour" "table_row" - And I click on "Dashboard" "link" in the "Navigation" "block" + And I am on homepage Then I should see "Welcome to your personal learning space. We'd like to give you a quick tour to show you some of the areas you may find helpful" diff --git a/admin/tool/usertours/tests/behat/tour_filter.feature b/admin/tool/usertours/tests/behat/tour_filter.feature index ebcb2b208c6..a0104d454be 100644 --- a/admin/tool/usertours/tests/behat/tour_filter.feature +++ b/admin/tool/usertours/tests/behat/tour_filter.feature @@ -16,7 +16,7 @@ Feature: Apply tour filters to a tour And I add steps to the "First tour" tour: | targettype | Title | Content | | Display in middle of page | Welcome | Welcome to your personal learning space. We'd like to give you a quick tour to show you some of the areas you may find helpful | - When I click on "Dashboard" "link" in the "Navigation" "block" + When I am on homepage Then I should not see "Welcome to your personal learning space. We'd like to give you a quick tour to show you some of the areas you may find helpful" @javascript diff --git a/auth/cas/db/upgrade.php b/auth/cas/db/upgrade.php index 22fcb7b6ec8..81eefd028b7 100644 --- a/auth/cas/db/upgrade.php +++ b/auth/cas/db/upgrade.php @@ -55,5 +55,8 @@ function xmldb_auth_cas_upgrade($oldversion) { // Moodle v3.1.0 release upgrade line. // Put any upgrade step following this. + // Automatically generated Moodle v3.2.0 release upgrade line. + // Put any upgrade step following this. + return true; } diff --git a/auth/ldap/db/upgrade.php b/auth/ldap/db/upgrade.php index 3526ffcadb0..c72b48fe6c9 100644 --- a/auth/ldap/db/upgrade.php +++ b/auth/ldap/db/upgrade.php @@ -55,5 +55,8 @@ function xmldb_auth_ldap_upgrade($oldversion) { // Moodle v3.1.0 release upgrade line. // Put any upgrade step following this. + // Automatically generated Moodle v3.2.0 release upgrade line. + // Put any upgrade step following this. + return true; } diff --git a/auth/manual/db/upgrade.php b/auth/manual/db/upgrade.php index d9b32b2684c..f56e33708e4 100644 --- a/auth/manual/db/upgrade.php +++ b/auth/manual/db/upgrade.php @@ -43,5 +43,8 @@ function xmldb_auth_manual_upgrade($oldversion) { // Moodle v3.1.0 release upgrade line. // Put any upgrade step following this. + // Automatically generated Moodle v3.2.0 release upgrade line. + // Put any upgrade step following this. + return true; } diff --git a/auth/mnet/db/upgrade.php b/auth/mnet/db/upgrade.php index 2daae51bdb4..3d93aa2eadd 100644 --- a/auth/mnet/db/upgrade.php +++ b/auth/mnet/db/upgrade.php @@ -43,5 +43,8 @@ function xmldb_auth_mnet_upgrade($oldversion) { // Moodle v3.1.0 release upgrade line. // Put any upgrade step following this. + // Automatically generated Moodle v3.2.0 release upgrade line. + // Put any upgrade step following this. + return true; } diff --git a/availability/condition/grade/tests/behat/availability_grade.feature b/availability/condition/grade/tests/behat/availability_grade.feature index df3340e9fa1..60f79208996 100644 --- a/availability/condition/grade/tests/behat/availability_grade.feature +++ b/availability/condition/grade/tests/behat/availability_grade.feature @@ -115,7 +115,7 @@ Feature: availability_grade # Give the assignment 40%. And I follow "A1" - And I click on "View all submissions" "link" in the "Administration" "block" + And I navigate to "View all submissions" in current page administration # Pick the grade link in the row that has s@example.com in it. And I click on "Grade" "link" in the "s@example.com" "table_row" And I set the field "Grade out of 100" to "40" diff --git a/availability/condition/profile/tests/behat/availability_profile.feature b/availability/condition/profile/tests/behat/availability_profile.feature index 2222fb7b74d..8e324bb1c21 100644 --- a/availability/condition/profile/tests/behat/availability_profile.feature +++ b/availability/condition/profile/tests/behat/availability_profile.feature @@ -101,7 +101,7 @@ Feature: availability_profile # Edit it again and check the setting still works. When I follow "P1" - And I navigate to "Edit settings" node in "Page module administration" + And I navigate to "Edit settings" in current page administration And I expand all fieldsets Then the field "User profile field" matches value "Super field" And the field "Value to compare against" matches value "Bananaman" diff --git a/availability/tests/behat/edit_availability.feature b/availability/tests/behat/edit_availability.feature index 08a6f70c696..7193088a9b4 100644 --- a/availability/tests/behat/edit_availability.feature +++ b/availability/tests/behat/edit_availability.feature @@ -216,7 +216,7 @@ Feature: edit_availability # Check the button still works after saving and editing. And I press "Save and display" - And I navigate to "Edit settings" node in "Forum administration" + And I navigate to "Edit settings" in current page administration And I expand all fieldsets And the "Add group/grouping access restriction" "button" should be disabled And I should see "Grouping" in the "Restrict access" "fieldset" diff --git a/backup/util/ui/tests/behat/restore_moodle2_courses.feature b/backup/util/ui/tests/behat/restore_moodle2_courses.feature index 1fa38f17d1f..32c1cd7e7f1 100644 --- a/backup/util/ui/tests/behat/restore_moodle2_courses.feature +++ b/backup/util/ui/tests/behat/restore_moodle2_courses.feature @@ -41,7 +41,7 @@ Feature: Restore Moodle 2 course backups Then I should see "Course 1 restored in a new course" And I should see "Community finder" in the "Community finder" "block" And I should see "Test forum name" - And I click on "Edit settings" "link" in the "Administration" "block" + And I navigate to "Edit settings" node in "Course administration" And I expand all fieldsets And the field "id_format" matches value "Topics format" And the field "Number of sections" matches value "15" @@ -83,7 +83,7 @@ Feature: Restore Moodle 2 course backups When I restore "test_backup.mbz" backup into a new course using this options: Then I should see "Topic 1" And I should see "Test forum name" - And I click on "Edit settings" "link" in the "Administration" "block" + And I navigate to "Edit settings" node in "Course administration" And I expand all fieldsets And the field "id_format" matches value "Topics format" And I set the following fields to these values: @@ -95,14 +95,14 @@ Feature: Restore Moodle 2 course backups And I press "Save and display" And I should see "1 January - 7 January" And I should see "Test forum name" - And I click on "Edit settings" "link" in the "Administration" "block" + And I navigate to "Edit settings" node in "Course administration" And I expand all fieldsets And the field "id_format" matches value "Weekly format" And I set the following fields to these values: | id_format | Social format | And I press "Save and display" And I should see "An open forum for chatting about anything you want to" - And I click on "Edit settings" "link" in the "Administration" "block" + And I navigate to "Edit settings" node in "Course administration" And I expand all fieldsets And the field "id_format" matches value "Social format" And I press "Cancel" @@ -119,7 +119,7 @@ Feature: Restore Moodle 2 course backups | Confirmation | Filename | test_backup.mbz | And I restore "test_backup.mbz" backup into "Course 2" course using this options: | Schema | Overwrite course configuration | Yes | - And I click on "Edit settings" "link" in the "Administration" "block" + And I navigate to "Edit settings" node in "Course administration" And I expand all fieldsets Then the field "id_format" matches value "Topics format" And the field "Number of sections" matches value "15" diff --git a/badges/tests/behat/add_badge.feature b/badges/tests/behat/add_badge.feature index cafe6710c52..e0399fa3007 100644 --- a/badges/tests/behat/add_badge.feature +++ b/badges/tests/behat/add_badge.feature @@ -14,12 +14,16 @@ Feature: Add badges to the system And I set the field "Default badge issuer name" to "Test Badge Site" And I set the field "Default badge issuer contact details" to "testuser@example.com" And I press "Save changes" + And I follow "Badges" When I follow "Add a new badge" Then the field "issuercontact" matches value "testuser@example.com" And the field "issuername" matches value "Test Badge Site" @javascript Scenario: Accessing the badges + And I press "Customise this page" + # TODO MDL-57120 site "Badges" link not accessible without navigation block. + And I add the "Navigation" block if not present Given I navigate to "Site badges" node in "Site pages" Then I should see "There are no badges available." diff --git a/blocks/activity_modules/tests/behat/block_activity_modules.feature b/blocks/activity_modules/tests/behat/block_activity_modules.feature index b57d54d1110..462ef805ccb 100644 --- a/blocks/activity_modules/tests/behat/block_activity_modules.feature +++ b/blocks/activity_modules/tests/behat/block_activity_modules.feature @@ -109,7 +109,7 @@ Feature: Block activity modules | workshop | Test workshop name | Test workshop description | C1 | workshop1 | When I log in as "admin" - And I follow "Courses" + And I am on course index And I follow "Course 1" And I turn editing mode on And I add the "Activities" block diff --git a/blocks/activity_results/tests/behat/addblockinactivity.feature b/blocks/activity_results/tests/behat/addblockinactivity.feature index ef51f1eb85b..7af21b1a1c1 100644 --- a/blocks/activity_results/tests/behat/addblockinactivity.feature +++ b/blocks/activity_results/tests/behat/addblockinactivity.feature @@ -50,7 +50,7 @@ Feature: The activity results block displays student scores And I press "Save and return to course" And I follow "Course 1" And I should see "Test page name" - And I go to "View > Grader report" in the course gradebook + And I navigate to "View > Grader report" in the course gradebook And I turn editing mode on And I give the grade "90.00" to the user "Student 1" for the grade item "Test assignment 1" And I give the grade "80.00" to the user "Student 2" for the grade item "Test assignment 1" diff --git a/blocks/activity_results/tests/behat/addunsupportedactivity.feature b/blocks/activity_results/tests/behat/addunsupportedactivity.feature index 012549ea5e5..3aa10b9f65d 100644 --- a/blocks/activity_results/tests/behat/addunsupportedactivity.feature +++ b/blocks/activity_results/tests/behat/addunsupportedactivity.feature @@ -33,7 +33,7 @@ Feature: The activity results block displays student scores | id_config_nameformat | Display full names | And I press "Save changes" When I follow "Test assignment" - And I click on "Edit settings" "link" in the "Administration" "block" + And I navigate to "Edit settings" in current page administration And I set the following fields to these values: | id_grade_modgrade_type | None | And I press "Save and return to course" diff --git a/blocks/activity_results/tests/behat/highscoreswithoutgroups.feature b/blocks/activity_results/tests/behat/highscoreswithoutgroups.feature index b99eba42b5a..4a2a8bc5826 100644 --- a/blocks/activity_results/tests/behat/highscoreswithoutgroups.feature +++ b/blocks/activity_results/tests/behat/highscoreswithoutgroups.feature @@ -32,7 +32,7 @@ Feature: The activity results block displays student scores | Description | Offline text | | assignsubmission_file_enabled | 0 | And I follow "Course 1" - And I go to "View > Grader report" in the course gradebook + And I navigate to "View > Grader report" in the course gradebook And I turn editing mode on And I give the grade "90.00" to the user "Student 1" for the grade item "Test assignment" And I give the grade "80.00" to the user "Student 2" for the grade item "Test assignment" diff --git a/blocks/activity_results/tests/behat/highscoreswithscales.feature b/blocks/activity_results/tests/behat/highscoreswithscales.feature index 451c12980af..86dee32ce06 100644 --- a/blocks/activity_results/tests/behat/highscoreswithscales.feature +++ b/blocks/activity_results/tests/behat/highscoreswithscales.feature @@ -26,7 +26,7 @@ Feature: The activity results block displays student scores as scales | student5 | C1 | student | And I log in as "teacher1" And I follow "Course 1" - And I go to "Scales" in the course gradebook + And I navigate to "Scales" in the course gradebook And I press "Add a new scale" And I set the following fields to these values: | Name | My Scale | @@ -41,7 +41,7 @@ Feature: The activity results block displays student scores as scales | id_grade_modgrade_type | Scale | | id_grade_modgrade_scale | My Scale | And I follow "Course 1" - And I go to "View > Grader report" in the course gradebook + And I navigate to "View > Grader report" in the course gradebook And I turn editing mode on And I give the grade "Excellent!" to the user "Student 1" for the grade item "Test assignment" And I give the grade "Very good" to the user "Student 2" for the grade item "Test assignment" diff --git a/blocks/activity_results/tests/behat/highscoreswithscalesandgroups.feature b/blocks/activity_results/tests/behat/highscoreswithscalesandgroups.feature index e1f85aafacb..536a00ecec7 100644 --- a/blocks/activity_results/tests/behat/highscoreswithscalesandgroups.feature +++ b/blocks/activity_results/tests/behat/highscoreswithscalesandgroups.feature @@ -43,7 +43,7 @@ Feature: The activity results block displays student scores as scales | student6 | G3 | And I log in as "teacher1" And I follow "Course 1" - And I go to "Scales" in the course gradebook + And I navigate to "Scales" in the course gradebook And I press "Add a new scale" And I set the following fields to these values: | Name | My Scale | @@ -59,7 +59,7 @@ Feature: The activity results block displays student scores as scales | id_grade_modgrade_scale | My Scale | | Group mode | Separate groups | And I follow "Course 1" - And I go to "View > Grader report" in the course gradebook + And I navigate to "View > Grader report" in the course gradebook And I turn editing mode on And I give the grade "Excellent!" to the user "Student 1" for the grade item "Test assignment" And I give the grade "Very good" to the user "Student 2" for the grade item "Test assignment" diff --git a/blocks/activity_results/tests/behat/highscoreswithseperategroups.feature b/blocks/activity_results/tests/behat/highscoreswithseperategroups.feature index e0b81c0d852..c764e806222 100644 --- a/blocks/activity_results/tests/behat/highscoreswithseperategroups.feature +++ b/blocks/activity_results/tests/behat/highscoreswithseperategroups.feature @@ -50,7 +50,7 @@ Feature: The activity results block displays student scores | assignsubmission_file_enabled | 0 | | Group mode | Separate groups | And I follow "Course 1" - And I go to "View > Grader report" in the course gradebook + And I navigate to "View > Grader report" in the course gradebook And I turn editing mode on And I give the grade "100.00" to the user "Student 1" for the grade item "Test assignment" And I give the grade "90.00" to the user "Student 2" for the grade item "Test assignment" diff --git a/blocks/activity_results/tests/behat/highscoreswithvisiblegroups.feature b/blocks/activity_results/tests/behat/highscoreswithvisiblegroups.feature index 4abf7216c1e..bf10d7943b0 100644 --- a/blocks/activity_results/tests/behat/highscoreswithvisiblegroups.feature +++ b/blocks/activity_results/tests/behat/highscoreswithvisiblegroups.feature @@ -50,7 +50,7 @@ Feature: The activity results block displays student scores | assignsubmission_file_enabled | 0 | | Group mode | Visible groups | And I follow "Course 1" - And I go to "View > Grader report" in the course gradebook + And I navigate to "View > Grader report" in the course gradebook And I turn editing mode on And I give the grade "100.00" to the user "Student 1" for the grade item "Test assignment" And I give the grade "90.00" to the user "Student 2" for the grade item "Test assignment" diff --git a/blocks/activity_results/tests/behat/lowscoreswithoutgroups.feature b/blocks/activity_results/tests/behat/lowscoreswithoutgroups.feature index 8e153e68180..a1496c6e29e 100644 --- a/blocks/activity_results/tests/behat/lowscoreswithoutgroups.feature +++ b/blocks/activity_results/tests/behat/lowscoreswithoutgroups.feature @@ -32,7 +32,7 @@ Feature: The activity results block displays student scores | Description | Offline text | | assignsubmission_file_enabled | 0 | And I follow "Course 1" - And I go to "View > Grader report" in the course gradebook + And I navigate to "View > Grader report" in the course gradebook And I turn editing mode on And I give the grade "90.00" to the user "Student 1" for the grade item "Test assignment" And I give the grade "80.00" to the user "Student 2" for the grade item "Test assignment" diff --git a/blocks/activity_results/tests/behat/lowscoreswithscales.feature b/blocks/activity_results/tests/behat/lowscoreswithscales.feature index b13cd8d991b..587f863a53d 100644 --- a/blocks/activity_results/tests/behat/lowscoreswithscales.feature +++ b/blocks/activity_results/tests/behat/lowscoreswithscales.feature @@ -26,7 +26,7 @@ Feature: The activity results block displays student scores as scales | student5 | C1 | student | And I log in as "teacher1" And I follow "Course 1" - And I go to "Scales" in the course gradebook + And I navigate to "Scales" in the course gradebook And I press "Add a new scale" And I set the following fields to these values: | Name | My Scale | @@ -41,7 +41,7 @@ Feature: The activity results block displays student scores as scales | id_grade_modgrade_type | Scale | | id_grade_modgrade_scale | My Scale | And I follow "Course 1" - And I go to "View > Grader report" in the course gradebook + And I navigate to "View > Grader report" in the course gradebook And I turn editing mode on And I give the grade "Excellent!" to the user "Student 1" for the grade item "Test assignment" And I give the grade "Very good" to the user "Student 2" for the grade item "Test assignment" diff --git a/blocks/activity_results/tests/behat/lowscoreswithscalesandgroups.feature b/blocks/activity_results/tests/behat/lowscoreswithscalesandgroups.feature index 54e72a987ec..f43348e814a 100644 --- a/blocks/activity_results/tests/behat/lowscoreswithscalesandgroups.feature +++ b/blocks/activity_results/tests/behat/lowscoreswithscalesandgroups.feature @@ -43,7 +43,7 @@ Feature: The activity results block displays student scores as scales | student6 | G3 | And I log in as "teacher1" And I follow "Course 1" - And I go to "Scales" in the course gradebook + And I navigate to "Scales" in the course gradebook And I press "Add a new scale" And I set the following fields to these values: | Name | My Scale | @@ -59,7 +59,7 @@ Feature: The activity results block displays student scores as scales | id_grade_modgrade_scale | My Scale | | Group mode | Separate groups | And I follow "Course 1" - And I go to "View > Grader report" in the course gradebook + And I navigate to "View > Grader report" in the course gradebook And I turn editing mode on And I give the grade "Excellent!" to the user "Student 1" for the grade item "Test assignment" And I give the grade "Very good" to the user "Student 2" for the grade item "Test assignment" diff --git a/blocks/activity_results/tests/behat/lowscoreswithseperategroups.feature b/blocks/activity_results/tests/behat/lowscoreswithseperategroups.feature index 1c8451b7789..640517edb93 100644 --- a/blocks/activity_results/tests/behat/lowscoreswithseperategroups.feature +++ b/blocks/activity_results/tests/behat/lowscoreswithseperategroups.feature @@ -50,7 +50,7 @@ Feature: The activity results block displays student scores | assignsubmission_file_enabled | 0 | | Group mode | Separate groups | And I follow "Course 1" - And I go to "View > Grader report" in the course gradebook + And I navigate to "View > Grader report" in the course gradebook And I turn editing mode on And I give the grade "100.00" to the user "Student 1" for the grade item "Test assignment" And I give the grade "90.00" to the user "Student 2" for the grade item "Test assignment" diff --git a/blocks/activity_results/tests/behat/lowscoreswithvisiblegroups.feature b/blocks/activity_results/tests/behat/lowscoreswithvisiblegroups.feature index 4d53ab6f866..2010dcddcf9 100644 --- a/blocks/activity_results/tests/behat/lowscoreswithvisiblegroups.feature +++ b/blocks/activity_results/tests/behat/lowscoreswithvisiblegroups.feature @@ -50,7 +50,7 @@ Feature: The activity results block displays student scores | assignsubmission_file_enabled | 0 | | Group mode | Visible groups | And I follow "Course 1" - And I go to "View > Grader report" in the course gradebook + And I navigate to "View > Grader report" in the course gradebook And I turn editing mode on And I give the grade "100.00" to the user "Student 1" for the grade item "Test assignment" And I give the grade "90.00" to the user "Student 2" for the grade item "Test assignment" diff --git a/blocks/badges/db/upgrade.php b/blocks/badges/db/upgrade.php index e62f9b8861f..09ca0778e6d 100644 --- a/blocks/badges/db/upgrade.php +++ b/blocks/badges/db/upgrade.php @@ -85,5 +85,8 @@ function xmldb_block_badges_upgrade($oldversion, $block) { // Moodle v3.1.0 release upgrade line. // Put any upgrade step following this. + // Automatically generated Moodle v3.2.0 release upgrade line. + // Put any upgrade step following this. + return true; } diff --git a/blocks/badges/tests/behat/block_badges_dashboard.feature b/blocks/badges/tests/behat/block_badges_dashboard.feature index 7a39ed12405..3f87995725e 100644 --- a/blocks/badges/tests/behat/block_badges_dashboard.feature +++ b/blocks/badges/tests/behat/block_badges_dashboard.feature @@ -35,5 +35,4 @@ Feature: Enable Block Badges on the dashboard and view awarded badges And I press "Award badge" And I log out When I log in as "teacher1" - And I click on "Dashboard" "link" in the "Navigation" "block" Then I should see "Badge 1" in the "Latest badges" "block" diff --git a/blocks/blog_recent/tests/behat/block_blog_recent_frontpage.feature b/blocks/blog_recent/tests/behat/block_blog_recent_frontpage.feature index 2f5a7d5e787..3b838dfa2ed 100644 --- a/blocks/blog_recent/tests/behat/block_blog_recent_frontpage.feature +++ b/blocks/blog_recent/tests/behat/block_blog_recent_frontpage.feature @@ -12,6 +12,8 @@ Feature: Feature: Students can use the recent blog entries block to view recent And I am on site homepage And I navigate to "Turn editing on" node in "Front page settings" And I add the "Recent blog entries" block + # TODO MDL-57120 site "Blogs" link not accessible without navigation block. + And I add the "Navigation" block if not present And I log out Scenario: Students use the recent blog entries block to view blogs diff --git a/blocks/blog_tags/tests/behat/blogtag.feature b/blocks/blog_tags/tests/behat/blogtag.feature index 597cbe781d6..60572e16a7f 100644 --- a/blocks/blog_tags/tests/behat/blogtag.feature +++ b/blocks/blog_tags/tests/behat/blogtag.feature @@ -24,8 +24,11 @@ Feature: Adding blog tag block And I follow "Course 1" And I turn editing mode on And I add the "Blog tags" block + # TODO MDL-57120 site "Blogs" link not accessible without navigation block. + And I add the "Navigation" block if not present - And I navigate to "Course blogs" node in "My courses > c1 > Participants" + And I navigate to course participants + And I click on "Course blogs" "link" in the "Navigation" "block" And I follow "Blog about this Course" And I set the following fields to these values: | Entry title | Blog post from teacher | @@ -35,7 +38,8 @@ Feature: Adding blog tag block And I log out And I log in as "student1" And I follow "Course 1" - And I navigate to "Course blogs" node in "My courses > c1 > Participants" + And I navigate to course participants + And I click on "Course blogs" "link" in the "Navigation" "block" And I follow "Blog about this Course" And I set the following fields to these values: | Entry title | Blog post from student | diff --git a/blocks/calendar_month/db/upgrade.php b/blocks/calendar_month/db/upgrade.php index df1c06829d6..f1c1a521ddd 100644 --- a/blocks/calendar_month/db/upgrade.php +++ b/blocks/calendar_month/db/upgrade.php @@ -85,5 +85,8 @@ function xmldb_block_calendar_month_upgrade($oldversion, $block) { // Moodle v3.1.0 release upgrade line. // Put any upgrade step following this. + // Automatically generated Moodle v3.2.0 release upgrade line. + // Put any upgrade step following this. + return true; } diff --git a/blocks/calendar_month/tests/behat/block_calendar_month.feature b/blocks/calendar_month/tests/behat/block_calendar_month.feature index 1dd28e99c81..e4952e8829f 100644 --- a/blocks/calendar_month/tests/behat/block_calendar_month.feature +++ b/blocks/calendar_month/tests/behat/block_calendar_month.feature @@ -86,7 +86,7 @@ Feature: Enable the calendar block in a course and test it's functionality And I create a calendar event with form data: | id_eventtype | User | | id_name | User Event | - When I click on "Dashboard" "link" in the "Navigation" "block" + When I am on homepage And I follow "Course 1" And I follow "Hide course events" And I hover over today in the calendar @@ -102,7 +102,7 @@ Feature: Enable the calendar block in a course and test it's functionality And I create a calendar event with form data: | id_eventtype | User | | id_name | User Event | - When I click on "Dashboard" "link" in the "Navigation" "block" + When I am on homepage And I follow "Course 1" And I hover over today in the calendar Then I should see "User Event" @@ -120,7 +120,7 @@ Feature: Enable the calendar block in a course and test it's functionality And I create a calendar event with form data: | id_eventtype | User | | id_name | User Event | - When I click on "Dashboard" "link" in the "Navigation" "block" + When I am on homepage And I follow "Course 1" And I follow "Hide user events" And I hover over today in the calendar diff --git a/blocks/calendar_upcoming/db/upgrade.php b/blocks/calendar_upcoming/db/upgrade.php index 8d57d38ae27..7a207541a44 100644 --- a/blocks/calendar_upcoming/db/upgrade.php +++ b/blocks/calendar_upcoming/db/upgrade.php @@ -85,5 +85,8 @@ function xmldb_block_calendar_upcoming_upgrade($oldversion, $block) { // Moodle v3.1.0 release upgrade line. // Put any upgrade step following this. + // Automatically generated Moodle v3.2.0 release upgrade line. + // Put any upgrade step following this. + return true; } diff --git a/blocks/community/db/upgrade.php b/blocks/community/db/upgrade.php index e4e537f1951..cbdb471e17a 100644 --- a/blocks/community/db/upgrade.php +++ b/blocks/community/db/upgrade.php @@ -58,5 +58,8 @@ function xmldb_block_community_upgrade($oldversion) { // Moodle v3.1.0 release upgrade line. // Put any upgrade step following this. + // Automatically generated Moodle v3.2.0 release upgrade line. + // Put any upgrade step following this. + return true; } diff --git a/blocks/completionstatus/db/upgrade.php b/blocks/completionstatus/db/upgrade.php index 9767c51dfee..ec79d8a910e 100644 --- a/blocks/completionstatus/db/upgrade.php +++ b/blocks/completionstatus/db/upgrade.php @@ -60,5 +60,8 @@ function xmldb_block_completionstatus_upgrade($oldversion, $block) { // Moodle v3.1.0 release upgrade line. // Put any upgrade step following this. + // Automatically generated Moodle v3.2.0 release upgrade line. + // Put any upgrade step following this. + return true; } diff --git a/blocks/completionstatus/tests/behat/block_completionstatus.feature b/blocks/completionstatus/tests/behat/block_completionstatus.feature index 58b7cc74a90..9fd829510aa 100644 --- a/blocks/completionstatus/tests/behat/block_completionstatus.feature +++ b/blocks/completionstatus/tests/behat/block_completionstatus.feature @@ -43,7 +43,7 @@ Feature: Enable Block Completion in a course And I follow "Course 1" And I turn editing mode on And I follow "Test page name" - And I navigate to "Edit settings" node in "Page module administration" + And I navigate to "Edit settings" in current page administration And I set the following fields to these values: | Completion tracking | Show activity as complete when conditions are met | | Require view | 1 | diff --git a/blocks/completionstatus/tests/behat/block_completionstatus_activity_completion.feature b/blocks/completionstatus/tests/behat/block_completionstatus_activity_completion.feature index 7d3285f761a..0a31bb7bb36 100644 --- a/blocks/completionstatus/tests/behat/block_completionstatus_activity_completion.feature +++ b/blocks/completionstatus/tests/behat/block_completionstatus_activity_completion.feature @@ -25,7 +25,7 @@ Feature: Enable Block Completion in a course using activity completion And I follow "Course 1" And I turn editing mode on And I follow "Test page name" - And I navigate to "Edit settings" node in "Page module administration" + And I navigate to "Edit settings" in current page administration And I set the following fields to these values: | Completion tracking | Show activity as complete when conditions are met | | Require view | 1 | @@ -47,7 +47,7 @@ Feature: Enable Block Completion in a course using activity completion And I follow "Course 1" And I turn editing mode on And I follow "Test page name" - And I navigate to "Edit settings" node in "Page module administration" + And I navigate to "Edit settings" in current page administration And I set the following fields to these values: | Completion tracking | Show activity as complete when conditions are met | | Require view | 1 | diff --git a/blocks/course_overview/tests/behat/block_course_overview.feature b/blocks/course_overview/tests/behat/block_course_overview.feature index 90b8c364d85..389b6c5353b 100644 --- a/blocks/course_overview/tests/behat/block_course_overview.feature +++ b/blocks/course_overview/tests/behat/block_course_overview.feature @@ -153,7 +153,6 @@ Feature: View the course overview block on the dashboard and test it's functiona And I click on "Enable" "link" in the "Course meta link" "table_row" And I am on site homepage And I follow "Course 2" - And I navigate to "Enrolment methods" node in "Course administration > Users" And I add "Course meta link" enrolment method with: | Link course | C1 | And I log out diff --git a/blocks/course_summary/db/upgrade.php b/blocks/course_summary/db/upgrade.php index 2905aaead7f..3613226929c 100644 --- a/blocks/course_summary/db/upgrade.php +++ b/blocks/course_summary/db/upgrade.php @@ -60,5 +60,8 @@ function xmldb_block_course_summary_upgrade($oldversion, $block) { // Moodle v3.1.0 release upgrade line. // Put any upgrade step following this. + // Automatically generated Moodle v3.2.0 release upgrade line. + // Put any upgrade step following this. + return true; } diff --git a/blocks/glossary_random/tests/behat/glossary_random_frontpage.feature b/blocks/glossary_random/tests/behat/glossary_random_frontpage.feature index 001814381a1..fc6f19caa9d 100644 --- a/blocks/glossary_random/tests/behat/glossary_random_frontpage.feature +++ b/blocks/glossary_random/tests/behat/glossary_random_frontpage.feature @@ -10,7 +10,7 @@ Scenario: Admin can add random glossary block to the frontpage | glossary | Tips and Tricks | Frontpage glossary description | Acceptance test site | glossary0 | And I log in as "admin" And I am on site homepage - And I click on "Turn editing on" "link" in the "Administration" "block" + And I turn editing mode on And I add the "Random glossary entry" block And I configure the "block_glossary_random" block And I set the following fields to these values: diff --git a/blocks/html/db/upgrade.php b/blocks/html/db/upgrade.php index 7f27cf1fb4f..3e57de18718 100644 --- a/blocks/html/db/upgrade.php +++ b/blocks/html/db/upgrade.php @@ -45,5 +45,8 @@ function xmldb_block_html_upgrade($oldversion) { // Moodle v3.1.0 release upgrade line. // Put any upgrade step following this. + // Automatically generated Moodle v3.2.0 release upgrade line. + // Put any upgrade step following this. + return true; } diff --git a/blocks/html/tests/behat/configuring_html_block.feature b/blocks/html/tests/behat/configuring_html_block.feature index 5c696d8373e..b4865e7f9ef 100644 --- a/blocks/html/tests/behat/configuring_html_block.feature +++ b/blocks/html/tests/behat/configuring_html_block.feature @@ -8,7 +8,7 @@ Feature: Adding and configuring HTML blocks Scenario: Configuring the HTML block with Javascript on Given I log in as "admin" And I am on site homepage - When I click on "Turn editing on" "link" in the "Administration" "block" + When I turn editing mode on And I add the "HTML" block And I configure the "(new HTML block)" block And I set the field "Content" to "Static text without a header" @@ -25,7 +25,7 @@ Feature: Adding and configuring HTML blocks Scenario: Configuring the HTML block with Javascript off Given I log in as "admin" And I am on site homepage - When I click on "Turn editing on" "link" in the "Administration" "block" + When I turn editing mode on And I add the "HTML" block And I configure the "(new HTML block)" block And I set the field "Content" to "Static text without a header" diff --git a/blocks/html/tests/behat/multiple_instances.feature b/blocks/html/tests/behat/multiple_instances.feature index 564c0b28dc0..93b58de8fd9 100644 --- a/blocks/html/tests/behat/multiple_instances.feature +++ b/blocks/html/tests/behat/multiple_instances.feature @@ -7,7 +7,7 @@ Feature: Adding and configuring HTML blocks Background: Given I log in as "admin" And I am on site homepage - When I click on "Turn editing on" "link" in the "Administration" "block" + When I turn editing mode on And I add the "HTML" block Scenario: Other users can not see HTML block that has not been configured diff --git a/blocks/navigation/db/upgrade.php b/blocks/navigation/db/upgrade.php index f137d380fc4..3de8a6b83ec 100644 --- a/blocks/navigation/db/upgrade.php +++ b/blocks/navigation/db/upgrade.php @@ -67,5 +67,8 @@ function xmldb_block_navigation_upgrade($oldversion, $block) { // Moodle v3.1.0 release upgrade line. // Put any upgrade step following this. + // Automatically generated Moodle v3.2.0 release upgrade line. + // Put any upgrade step following this. + return true; } diff --git a/blocks/navigation/tests/behat/expand_courses_node.feature b/blocks/navigation/tests/behat/expand_courses_node.feature index 4e99a94e358..56c85bf877d 100644 --- a/blocks/navigation/tests/behat/expand_courses_node.feature +++ b/blocks/navigation/tests/behat/expand_courses_node.feature @@ -38,6 +38,13 @@ Feature: Expand the courses nodes within the navigation block | navshowallcourses | 1 | And I log in as "admin" And I am on site homepage + And I turn editing mode on + And I add the "Navigation" block if not present + And I configure the "Navigation" block + And I set the following fields to these values: + | Page contexts | Display throughout the entire site | + And I press "Save changes" + And I turn editing mode off And I follow "Course 2" And I navigate to "Enrolment methods" node in "Course administration > Users" And I click on "Edit" "link" in the "Guest access" "table_row" diff --git a/blocks/navigation/tests/behat/participants_link.feature b/blocks/navigation/tests/behat/participants_link.feature index 5b2f4d6afba..76533c9e935 100644 --- a/blocks/navigation/tests/behat/participants_link.feature +++ b/blocks/navigation/tests/behat/participants_link.feature @@ -15,13 +15,22 @@ Feature: Displaying the link to the Participants page And the following "course enrolments" exist: | user | course | role | | student1 | C1 | student | + And I log in as "admin" + And I am on site homepage + And I turn editing mode on + And I add the "Navigation" block if not present + And I configure the "Navigation" block + And I set the following fields to these values: + | Page contexts | Display throughout the entire site | + And I press "Save changes" + And I log out @javascript Scenario: Course participants link is displayed to enrolled students after expanding the course node When I log in as "student1" And I expand "C1" node Then "Participants" "link" should exist in the "Navigation" "block" - And I navigate to "Participants" node in "My courses > C1" + And I click on "Participants" "link" in the "Navigation" "block" And I should see "Participants" And "Student One" "link" should exist And "Student Two" "link" should not exist @@ -29,7 +38,7 @@ Feature: Displaying the link to the Participants page Scenario: Site participants link is displayed to admins When I log in as "admin" Then "Participants" "link" should exist in the "Navigation" "block" - And I navigate to "Participants" node in "Site pages" + And I click on "Participants" "link" in the "Navigation" "block" And I should see "Participants" And "Student One" "link" should exist And "Student Two" "link" should exist diff --git a/blocks/navigation/tests/behat/view_my_courses.feature b/blocks/navigation/tests/behat/view_my_courses.feature index bed47677dcd..2b086ce7445 100644 --- a/blocks/navigation/tests/behat/view_my_courses.feature +++ b/blocks/navigation/tests/behat/view_my_courses.feature @@ -29,6 +29,15 @@ Feature: View my courses in navigation block | student1 | c1 | student | | student1 | c31 | student | | student1 | c331 | student | + And I log in as "admin" + And I am on site homepage + And I turn editing mode on + And I add the "Navigation" block if not present + And I configure the "Navigation" block + And I set the following fields to these values: + | Page contexts | Display throughout the entire site | + And I press "Save changes" + And I log out @javascript Scenario: The plain list of enrolled courses is shown diff --git a/blocks/news_items/tests/behat/display_news.feature b/blocks/news_items/tests/behat/display_news.feature index a899073dc5b..ada6a9e1866 100644 --- a/blocks/news_items/tests/behat/display_news.feature +++ b/blocks/news_items/tests/behat/display_news.feature @@ -34,14 +34,14 @@ Feature: Latest announcements block displays the course latest news Then I should see "Discussion One" in the "Latest announcements" "block" And I should see "Discussion Two" in the "Latest announcements" "block" And I should see "Discussion Three" in the "Latest announcements" "block" - And I click on "Edit settings" "link" in the "Administration" "block" + And I navigate to "Edit settings" in current page administration And I set the following fields to these values: | News items to show | 2 | And I press "Save and display" And I should not see "Discussion One" in the "Latest announcements" "block" And I should see "Discussion Two" in the "Latest announcements" "block" And I should see "Discussion Three" in the "Latest announcements" "block" - And I click on "Edit settings" "link" in the "Administration" "block" + And I navigate to "Edit settings" in current page administration And I set the following fields to these values: | News items to show | 0 | And I press "Save and display" diff --git a/blocks/quiz_results/db/upgrade.php b/blocks/quiz_results/db/upgrade.php index 129ecc9e4d4..32ae28c4c28 100644 --- a/blocks/quiz_results/db/upgrade.php +++ b/blocks/quiz_results/db/upgrade.php @@ -110,5 +110,8 @@ function xmldb_block_quiz_results_upgrade($oldversion, $block) { // Moodle v3.1.0 release upgrade line. // Put any upgrade step following this. + // Automatically generated Moodle v3.2.0 release upgrade line. + // Put any upgrade step following this. + return true; } \ No newline at end of file diff --git a/blocks/recent_activity/db/upgrade.php b/blocks/recent_activity/db/upgrade.php index e2c919342de..45b9d65bc05 100644 --- a/blocks/recent_activity/db/upgrade.php +++ b/blocks/recent_activity/db/upgrade.php @@ -59,5 +59,8 @@ function xmldb_block_recent_activity_upgrade($oldversion, $block) { // Moodle v3.1.0 release upgrade line. // Put any upgrade step following this. + // Automatically generated Moodle v3.2.0 release upgrade line. + // Put any upgrade step following this. + return true; } diff --git a/blocks/recent_activity/tests/behat/structural_changes.feature b/blocks/recent_activity/tests/behat/structural_changes.feature index 5914281d57b..067b5730dad 100644 --- a/blocks/recent_activity/tests/behat/structural_changes.feature +++ b/blocks/recent_activity/tests/behat/structural_changes.feature @@ -165,7 +165,7 @@ Feature: View structural changes in recent activity block And I log in as "teacher1" And I follow "Course 1" And I follow "ForumNew" - And I click on "Edit settings" "link" in the "Administration" "block" + And I navigate to "Edit settings" in current page administration And I set the following fields to these values: | name | ForumUpdated | And I press "Save and return to course" diff --git a/blocks/rss_client/db/upgrade.php b/blocks/rss_client/db/upgrade.php index b8487d926fa..845a93cb5e5 100644 --- a/blocks/rss_client/db/upgrade.php +++ b/blocks/rss_client/db/upgrade.php @@ -56,5 +56,8 @@ function xmldb_block_rss_client_upgrade($oldversion) { // Moodle v3.1.0 release upgrade line. // Put any upgrade step following this. + // Automatically generated Moodle v3.2.0 release upgrade line. + // Put any upgrade step following this. + return true; } diff --git a/blocks/search_forums/tests/behat/block_search_forums_course.feature b/blocks/search_forums/tests/behat/block_search_forums_course.feature index 0f54b4b4dab..a52b9ad5690 100644 --- a/blocks/search_forums/tests/behat/block_search_forums_course.feature +++ b/blocks/search_forums/tests/behat/block_search_forums_course.feature @@ -43,7 +43,7 @@ Feature: The search forums block allows users to search for forum posts And I follow "Course 1" And I turn editing mode on And I follow "Announcements" - And I navigate to "Edit settings" node in "Forum administration" + And I navigate to "Edit settings" in current page administration And I expand all fieldsets And I set the field "id_visible" to "0" And I press "Save and return to course" diff --git a/blocks/section_links/db/upgrade.php b/blocks/section_links/db/upgrade.php index d5707160649..6363ae02214 100644 --- a/blocks/section_links/db/upgrade.php +++ b/blocks/section_links/db/upgrade.php @@ -61,5 +61,8 @@ function xmldb_block_section_links_upgrade($oldversion, $block) { // Moodle v3.1.0 release upgrade line. // Put any upgrade step following this. + // Automatically generated Moodle v3.2.0 release upgrade line. + // Put any upgrade step following this. + return true; } diff --git a/blocks/selfcompletion/db/upgrade.php b/blocks/selfcompletion/db/upgrade.php index 374ea53fcd4..0f23a91773a 100644 --- a/blocks/selfcompletion/db/upgrade.php +++ b/blocks/selfcompletion/db/upgrade.php @@ -60,5 +60,8 @@ function xmldb_block_selfcompletion_upgrade($oldversion, $block) { // Moodle v3.1.0 release upgrade line. // Put any upgrade step following this. + // Automatically generated Moodle v3.2.0 release upgrade line. + // Put any upgrade step following this. + return true; } diff --git a/blocks/settings/db/upgrade.php b/blocks/settings/db/upgrade.php index c435ed78bc6..98bbed2f6e2 100644 --- a/blocks/settings/db/upgrade.php +++ b/blocks/settings/db/upgrade.php @@ -67,5 +67,8 @@ function xmldb_block_settings_upgrade($oldversion, $block) { // Moodle v3.1.0 release upgrade line. // Put any upgrade step following this. + // Automatically generated Moodle v3.2.0 release upgrade line. + // Put any upgrade step following this. + return true; } diff --git a/blocks/tests/behat/behat_blocks.php b/blocks/tests/behat/behat_blocks.php index c90c6972f9a..a5a1652e00e 100644 --- a/blocks/tests/behat/behat_blocks.php +++ b/blocks/tests/behat/behat_blocks.php @@ -25,6 +25,8 @@ // NOTE: no MOODLE_INTERNAL test here, this file may be required by behat before including /config.php. +use Behat\Mink\Exception\ElementNotFoundException as ElementNotFoundException; + require_once(__DIR__ . '/../../../lib/behat/behat_base.php'); /** @@ -56,6 +58,20 @@ class behat_blocks extends behat_base { } } + /** + * Adds the selected block if it is not already present. Editing mode must be previously enabled. + * + * @Given /^I add the "(?P(?:[^"]|\\")*)" block if not present$/ + * @param string $blockname + */ + public function i_add_the_block_if_not_present($blockname) { + try { + $this->get_text_selector_node('block', $blockname); + } catch (ElementNotFoundException $e) { + $this->execute('behat_blocks::i_add_the_block', [$blockname]); + } + } + /** * Docks a block. Editing mode should be previously enabled. * diff --git a/blocks/tests/behat/configure_block_throughout_site.feature b/blocks/tests/behat/configure_block_throughout_site.feature index db03ce2107b..a9d31d7af1b 100644 --- a/blocks/tests/behat/configure_block_throughout_site.feature +++ b/blocks/tests/behat/configure_block_throughout_site.feature @@ -50,9 +50,8 @@ Feature: Add and configure blocks throughout the site Scenario: Blocks on the dashboard page can have roles assigned to them Given I log in as "manager1" - And I click on "Dashboard" "link" in the "Navigation" "block" When I press "Customise this page" - Then I should see "Assign roles in Navigation block" + Then I should see "Assign roles in Private files block" Scenario: Blocks on courses can have roles assigned to them Given I log in as "teacher1" @@ -64,7 +63,7 @@ Feature: Add and configure blocks throughout the site @javascript Scenario: Blocks can safely be customised Given I log in as "admin" - And I click on "Dashboard" "link" in the "Navigation" "block" + And I am on homepage And I press "Customise this page" And I add the "HTML" block And I configure the "(new HTML block)" block diff --git a/blocks/tests/behat/restrict_available_blocks.feature b/blocks/tests/behat/restrict_available_blocks.feature index 10068dcb8ed..6a5c2a11ff2 100644 --- a/blocks/tests/behat/restrict_available_blocks.feature +++ b/blocks/tests/behat/restrict_available_blocks.feature @@ -30,8 +30,7 @@ Feature: Allowed blocks controls | block/activity_modules:addinstance | Prohibit | And I am on site homepage And I follow "Course 1" - And I expand "Users" node - And I follow "Permissions" + And I navigate to "Users > Permissions" in current page administration And I override the system permissions of "Teacher" role with: | block/completionstatus:addinstance | Prohibit | And I log out diff --git a/blocks/tests/behat/return_block_original_state.feature b/blocks/tests/behat/return_block_original_state.feature index 931eb3fab48..98226cdffaa 100644 --- a/blocks/tests/behat/return_block_original_state.feature +++ b/blocks/tests/behat/return_block_original_state.feature @@ -14,7 +14,7 @@ Feature: The context of a block can always be returned to it's original state. And I follow "Turn editing on" And I add the "Tags" block Then I should see "Tags" in the "Tags" "block" - And I click on "Participants" "link" in the "//li[p/a[contains(normalize-space(string(.)), 'Courses')]]" "xpath_element" + And I navigate to course participants And I configure the "Tags" block And I set the following fields to these values: | Display on page types | Any page | @@ -31,7 +31,7 @@ Feature: The context of a block can always be returned to it's original state. And I should see "Tags" in the "Tags" "block" And I follow "Course 1" And "Tags" "block" should not exist - And I navigate to "Participants" node in "Courses > C1" + And I navigate to course participants And "Tags" "block" should not exist And I follow "Course 1" And I add a "Assignment" to section "1" and I fill the form with: @@ -45,5 +45,5 @@ Feature: The context of a block can always be returned to it's original state. And I press "Save changes" And I follow "Course 1" And I should see "Tags" in the "Tags" "block" - And I navigate to "Participants" node in "Courses > C1" + And I navigate to course participants And I should see "Tags" in the "Tags" "block" diff --git a/blog/tests/behat/blog_visibility.feature b/blog/tests/behat/blog_visibility.feature index dfb5c8f74c2..e1356810731 100644 --- a/blog/tests/behat/blog_visibility.feature +++ b/blog/tests/behat/blog_visibility.feature @@ -27,7 +27,7 @@ Feature: Blogs can be set to be only visible by the author. Scenario: A student can not see another student's blog entries. Given I log in as "testuser" And I follow "Course 1" - And I follow "Participants" + And I navigate to course participants And I follow "Test2 User2" And I should see "Miscellaneous" Then I should not see "Blog entries" diff --git a/blog/tests/behat/comment.feature b/blog/tests/behat/comment.feature index 182f2e88c31..86099b009c1 100644 --- a/blog/tests/behat/comment.feature +++ b/blog/tests/behat/comment.feature @@ -9,9 +9,18 @@ Feature: Comment on a blog entry | username | firstname | lastname | email | | testuser | Test | User | moodle@example.com | | testuser2 | Test2 | User2 | moodle2@example.com | + And I log in as "admin" + And I am on site homepage + And I turn editing mode on + # TODO MDL-57120 "Site blogs" link not accessible without navigation block. + And I add the "Navigation" block if not present + And I configure the "Navigation" block + And I set the following fields to these values: + | Page contexts | Display throughout the entire site | + And I press "Save changes" + And I log out And I log in as "testuser" - And I expand "Site pages" node - And I follow "Site blogs" + And I navigate to "Site blogs" node in "Site pages" And I follow "Add a new entry" And I set the following fields to these values: | Entry title | Blog post from user 1 | @@ -23,8 +32,7 @@ Feature: Comment on a blog entry Scenario: Commenting on my own blog entry Given I am on site homepage And I log in as "testuser" - And I expand "Site pages" node - And I follow "Site blogs" + And I navigate to "Site blogs" node in "Site pages" And I follow "Blog post from user 1" And I should see "User 1 blog post content" And I follow "Comments (0)" @@ -39,8 +47,7 @@ Feature: Comment on a blog entry Scenario: Deleting my own comment Given I am on site homepage And I log in as "testuser" - And I expand "Site pages" node - And I follow "Site blogs" + And I navigate to "Site blogs" node in "Site pages" And I follow "Blog post from user 1" And I should see "User 1 blog post content" And I follow "Comments (0)" @@ -60,8 +67,7 @@ Feature: Comment on a blog entry Given I am on site homepage And I log in as "testuser2" And I am on site homepage - And I expand "Site pages" node - And I follow "Site blogs" + And I navigate to "Site blogs" node in "Site pages" And I follow "Blog post from user 1" When I follow "Comments (0)" And I set the field "content" to "$My own >nasty< \"string\"!" diff --git a/blog/tests/behat/delete.feature b/blog/tests/behat/delete.feature index cd1dd5b4f45..d41e9decb0a 100644 --- a/blog/tests/behat/delete.feature +++ b/blog/tests/behat/delete.feature @@ -8,9 +8,18 @@ Feature: Delete a blog entry Given the following "users" exist: | username | firstname | lastname | email | | testuser | Test | User | moodle@example.com | + And I log in as "admin" + And I am on site homepage + And I turn editing mode on + # TODO MDL-57120 "Site blogs" link not accessible without navigation block. + And I add the "Navigation" block if not present + And I configure the "Navigation" block + And I set the following fields to these values: + | Page contexts | Display throughout the entire site | + And I press "Save changes" + And I log out And I log in as "testuser" - And I expand "Site pages" node - And I follow "Site blogs" + And I navigate to "Site blogs" node in "Site pages" And I follow "Add a new entry" And I set the following fields to these values: | Entry title | Blog post one | @@ -22,8 +31,7 @@ Feature: Delete a blog entry | Blog entry body | User 1 blog post content | And I press "Save changes" And I am on site homepage - And I expand "Site pages" node - And I follow "Site blogs" + And I navigate to "Site blogs" node in "Site pages" Scenario: Delete blog post results in post deleted Given I follow "Blog post one" diff --git a/cohort/tests/behat/access_visible_cohorts.feature b/cohort/tests/behat/access_visible_cohorts.feature index 8f5dc510454..899ec2c4f4d 100644 --- a/cohort/tests/behat/access_visible_cohorts.feature +++ b/cohort/tests/behat/access_visible_cohorts.feature @@ -58,8 +58,10 @@ Feature: Access visible and hidden cohorts And the "Cohort" select box should contain "System empty cohort" And I set the field "Cohort" to "System cohort" And I press "Add method" + And I follow "Course 1" And I navigate to "Enrolled users" node in "Course administration > Users" And I should see "student@example.com" + And I follow "Course 1" And I navigate to "Groups" node in "Course administration > Users" And I press "Auto-create groups" And the "Select members from cohort" select box should contain "Cohort in category 1" diff --git a/cohort/tests/behat/add_cohort.feature b/cohort/tests/behat/add_cohort.feature index 3d89faf90b4..7d21b9877bf 100644 --- a/cohort/tests/behat/add_cohort.feature +++ b/cohort/tests/behat/add_cohort.feature @@ -38,7 +38,8 @@ Feature: Add cohorts of users And the "Current users" select box should not contain "Forth User (forth@example.com)" Scenario: Add users to a cohort using a bulk user action - When I follow "Bulk user actions" + When I follow "Accounts" + And I follow "Bulk user actions" And I set the field "Available" to "Third User" And I press "Add to selection" And I set the field "Available" to "Forth User" @@ -47,6 +48,7 @@ Feature: Add cohorts of users And I press "Go" And I set the field "Cohort" to "Test cohort name [333]" And I press "Add to cohort" + And I follow "Accounts" And I follow "Cohorts" Then I should see "2" in the "#cohorts" "css_element" And I click on "Assign" "link" in the "Test cohort name" "table_row" diff --git a/cohort/tests/behat/upload_cohort_users.feature b/cohort/tests/behat/upload_cohort_users.feature index 702107ef11a..68adda85f83 100644 --- a/cohort/tests/behat/upload_cohort_users.feature +++ b/cohort/tests/behat/upload_cohort_users.feature @@ -28,7 +28,7 @@ Feature: Upload users to a cohort And I press "Upload users" And I press "Upload users" And I press "Continue" - And I follow "Cohorts" + And I navigate to "Users > Accounts > Cohorts" in site administration And I click on "Assign" "link" in the "Cohort 1" "table_row" Then the "Current users" select box should contain "Tom Jones (tomjones@example.com)" And the "Current users" select box should contain "Bob Jones (bobjones@example.com)" @@ -38,15 +38,13 @@ Feature: Upload users to a cohort And the "Current users" select box should contain "Alice Smith (alicesmith@example.com)" And I am on site homepage And I follow "Course 1" - And I expand "Users" node - And I follow "Enrolled users" + And I navigate to "Users > Enrolled users" in current page administration And I should see "Tom Jones" And I should see "Bob Jones" And I should not see "Mary Smith" And I am on site homepage And I follow "Course 2" - And I expand "Users" node - And I follow "Enrolled users" + And I navigate to "Users > Enrolled users" in current page administration And I should see "Mary Smith" And I should see "Alice Smith" And I should not see "Tom Jones" diff --git a/cohort/tests/behat/upload_cohorts.feature b/cohort/tests/behat/upload_cohorts.feature index 822fa60d223..a400b019f3a 100644 --- a/cohort/tests/behat/upload_cohorts.feature +++ b/cohort/tests/behat/upload_cohorts.feature @@ -90,9 +90,9 @@ Feature: A privileged user can create cohorts using a CSV file | user | role | contextlevel | reference | | user1 | manager | Category | CAT1 | When I log in as "user1" - And I follow "Courses" + And I am on course index And I follow "Cat 1" - And I navigate to "Cohorts" node in "Category: Cat 1" + And I navigate to "Cohorts" in current page administration And I follow "Upload cohorts" And I upload "cohort/tests/fixtures/uploadcohorts1.csv" file to "File" filemanager And I click on "Preview" "button" diff --git a/cohort/tests/behat/view_cohorts.feature b/cohort/tests/behat/view_cohorts.feature index 8e7a742e9d1..f9707017aaf 100644 --- a/cohort/tests/behat/view_cohorts.feature +++ b/cohort/tests/behat/view_cohorts.feature @@ -53,7 +53,7 @@ Feature: View cohort list Scenario: Manager in category can see cohorts in the category When I log in as "user2" - And I follow "Courses" + And I am on course index And I follow "Cat 1" And I follow "Cohorts" And I should not see "All cohorts" diff --git a/competency/classes/external/exporter.php b/competency/classes/external/exporter.php index 1f8f7f72b10..d54c6c6cf8b 100644 --- a/competency/classes/external/exporter.php +++ b/competency/classes/external/exporter.php @@ -158,7 +158,7 @@ abstract class exporter { } else if ($definition['type'] === PARAM_TEXT) { if (!empty($definition['multiple'])) { foreach ($data->$property as $key => $value) { - $data->$property[$key] = external_format_string($value, $context->id); + $data->{$property}[$key] = external_format_string($value, $context->id); } } else { $data->$property = external_format_string($data->$property, $context->id); diff --git a/competency/tests/exporter_test.php b/competency/tests/exporter_test.php index 101e1b46e66..a2d2c90ce9d 100644 --- a/competency/tests/exporter_test.php +++ b/competency/tests/exporter_test.php @@ -111,6 +111,9 @@ class core_competency_exporter_testcase extends advanced_testcase { $output = $PAGE->get_renderer('tool_lp'); $result = $exporter->export($output); + + $this->assertSame('Another string', $result->otherstring); + $this->assertSame(array('String a', 'String b'), $result->otherstrings); } } @@ -130,8 +133,8 @@ class core_competency_testable_exporter extends \core_competency\external\export protected function get_other_values(renderer_base $output) { return array( - 'otherstring' => 'An other string', - 'otherstrings' => array('String a', 'String b') + 'otherstring' => 'Another string', + 'otherstrings' => array('String a', 'String b') ); } diff --git a/completion/tests/behat/enable_manual_complete_mark.feature b/completion/tests/behat/enable_manual_complete_mark.feature index 75a11a2f0c0..c7aeb270ae6 100644 --- a/completion/tests/behat/enable_manual_complete_mark.feature +++ b/completion/tests/behat/enable_manual_complete_mark.feature @@ -21,7 +21,7 @@ Feature: Allow students to manually mark an activity as complete And I am on site homepage And I follow "Course 1" And I turn editing mode on - And I click on "Edit settings" "link" in the "Administration" "block" + And I navigate to "Edit settings" in current page administration And I set the following fields to these values: | Enable completion tracking | Yes | And I press "Save and display" @@ -38,6 +38,5 @@ Feature: Allow students to manually mark an activity as complete And I log in as "teacher1" And I am on site homepage And I follow "Course 1" - And I expand "Reports" node - And I follow "Activity completion" + And I navigate to "Reports > Activity completion" in current page administration And "Student First" user has completed "Test forum name" activity diff --git a/completion/tests/behat/restrict_activity_by_grade.feature b/completion/tests/behat/restrict_activity_by_grade.feature index a42b23c3ec8..040bf16b1d9 100644 --- a/completion/tests/behat/restrict_activity_by_grade.feature +++ b/completion/tests/behat/restrict_activity_by_grade.feature @@ -56,7 +56,7 @@ Feature: Restrict activity availability through grade conditions And I am on site homepage And I follow "Course 1" And I follow "Grade assignment" - And I click on "View all submissions" "link" in the "Administration" "block" + And I navigate to "View all submissions" in current page administration And I click on "Grade" "link" in the "Student First" "table_row" And I set the following fields to these values: | Grade | 21 | diff --git a/completion/tests/behat/restrict_section_availability.feature b/completion/tests/behat/restrict_section_availability.feature index 5090562e99e..c538bb2cd38 100644 --- a/completion/tests/behat/restrict_section_availability.feature +++ b/completion/tests/behat/restrict_section_availability.feature @@ -23,7 +23,7 @@ Feature: Restrict sections availability through completion or grade conditions And I am on site homepage And I follow "Course 1" And I turn editing mode on - And I click on "Edit settings" "link" in the "Administration" "block" + And I navigate to "Edit settings" in current page administration And I set the following fields to these values: | Enable completion tracking | Yes | And I press "Save and display" @@ -93,7 +93,7 @@ Feature: Restrict sections availability through completion or grade conditions And I am on site homepage And I follow "Course 1" And I follow "Grade assignment" - And I click on "View all submissions" "link" in the "Administration" "block" + And I navigate to "View all submissions" in current page administration And I click on "Grade" "link" in the "Student First" "table_row" And I set the following fields to these values: | Grade | 21 | diff --git a/course/format/social/tests/behat/social_adjust_discussion_count.feature b/course/format/social/tests/behat/social_adjust_discussion_count.feature index 92bc5e9bae4..2f474b2f6a1 100644 --- a/course/format/social/tests/behat/social_adjust_discussion_count.feature +++ b/course/format/social/tests/behat/social_adjust_discussion_count.feature @@ -97,7 +97,7 @@ Background: And I follow "Course 1" Scenario: When number of discussions is decreased fewer discussions appear - Given I click on "Edit settings" "link" in the "Administration" "block" + Given I navigate to "Edit settings" in current page administration And I set the following fields to these values: | numdiscussions | 5 | When I press "Save and display" @@ -106,7 +106,7 @@ Scenario: When number of discussions is decreased fewer discussions appear And I should not see "This is forum post six" Scenario: When number of discussions is decreased to less than 1 only 1 discussion should appear - Given I click on "Edit settings" "link" in the "Administration" "block" + Given I navigate to "Edit settings" in current page administration And I set the following fields to these values: | numdiscussions | -1 | When I press "Save and display" @@ -115,7 +115,7 @@ Scenario: When number of discussions is decreased to less than 1 only 1 discussi And I should not see "This is forum post ten" Scenario: When number of discussions is increased more discussions appear - Given I click on "Edit settings" "link" in the "Administration" "block" + Given I navigate to "Edit settings" in current page administration And I set the following fields to these values: | numdiscussions | 9 | When I press "Save and display" diff --git a/course/lib.php b/course/lib.php index 699ec42e6d9..22627111e2e 100644 --- a/course/lib.php +++ b/course/lib.php @@ -3791,7 +3791,7 @@ function course_get_user_administration_options($course, $context) { $options->reports = has_capability('moodle/site:viewreports', $context); $options->backup = has_capability('moodle/backup:backupcourse', $context); $options->restore = has_capability('moodle/restore:restorecourse', $context); - $options->files = $course->legacyfiles == 2 and has_capability('moodle/course:managefiles', $context); + $options->files = ($course->legacyfiles == 2 && has_capability('moodle/course:managefiles', $context)); if (!$isfrontpage) { $options->tags = has_capability('moodle/course:tag', $context); diff --git a/course/modlib.php b/course/modlib.php index 1eaa8f9d107..24385b868b1 100644 --- a/course/modlib.php +++ b/course/modlib.php @@ -145,6 +145,9 @@ function add_moduleinfo($moduleinfo, $course, $mform = null) { // Update embedded links and save files. $modcontext = context_module::instance($moduleinfo->coursemodule); if (!empty($introeditor)) { + // This will respect a module that has set a value for intro in it's modname_add_instance() function. + $introeditor['text'] = $moduleinfo->intro; + $moduleinfo->intro = file_save_draft_area_files($introeditor['itemid'], $modcontext->id, 'mod_'.$moduleinfo->modulename, 'intro', 0, array('subdirs'=>true), $introeditor['text']); diff --git a/course/tests/behat/activities_edit_completion.feature b/course/tests/behat/activities_edit_completion.feature index 1eb0f5f2b2f..c4f44b7b959 100644 --- a/course/tests/behat/activities_edit_completion.feature +++ b/course/tests/behat/activities_edit_completion.feature @@ -35,24 +35,24 @@ Feature: Edit completion settings of an activity @javascript Scenario: Pressing the unlock button allows the user to edit completion settings Given I follow "TestPage" - When I click on "Edit settings" "link" in the "Administration" "block" + When I navigate to "Edit settings" in current page administration And I expand all fieldsets And I press "Unlock completion options" Then I should see "Completion options unlocked" And I set the field "Completion tracking" to "Students can manually mark the activity as completed" And I press "Save and display" - And I click on "Edit settings" "link" in the "Administration" "block" + And I navigate to "Edit settings" in current page administration And I expand all fieldsets Then the field "Completion tracking" matches value "Students can manually mark the activity as completed" @javascript Scenario: Even when completion is locked, the user can still set the date Given I follow "TestPage" - When I click on "Edit settings" "link" in the "Administration" "block" + When I navigate to "Edit settings" in current page administration And I expand all fieldsets When I click on "id_completionexpected_enabled" "checkbox" And I set the field "id_completionexpected_year" to "2013" And I press "Save and display" - And I click on "Edit settings" "link" in the "Administration" "block" + And I navigate to "Edit settings" in current page administration And I expand all fieldsets Then the field "id_completionexpected_year" matches value "2013" diff --git a/course/tests/behat/activities_group_icons.feature b/course/tests/behat/activities_group_icons.feature index f65116277ab..dbb26da63e6 100644 --- a/course/tests/behat/activities_group_icons.feature +++ b/course/tests/behat/activities_group_icons.feature @@ -21,7 +21,7 @@ Feature: Toggle activities groups mode from the course page And I add a "Forum" to section "1" and I fill the form with: | Forum name | Test forum name | | Description | Test forum description | - And I click on "Edit settings" "link" in the "Administration" "block" + And I navigate to "Edit settings" in current page administration And I set the following fields to these values: | Group mode | No groups | | Force group mode | No | diff --git a/course/tests/behat/add_activities.feature b/course/tests/behat/add_activities.feature index 662a3c54861..b318d8046d0 100644 --- a/course/tests/behat/add_activities.feature +++ b/course/tests/behat/add_activities.feature @@ -30,8 +30,9 @@ Feature: Add activities to courses | Allow comments on entries | Yes | And I turn editing mode off Then I should not see "Adding a new" - And I follow "Test name" - And I click on "Edit settings" "link" in the "Administration" "block" + And I turn editing mode on + And I open "Test name" actions menu + And I click on "Edit settings" "link" in the "Test name" activity And I expand all fieldsets And the field "Name" matches value "Test name" And the field "Entries required for completion" matches value "9" diff --git a/course/tests/behat/behat_course.php b/course/tests/behat/behat_course.php index 759b3427791..df95cce26ff 100644 --- a/course/tests/behat/behat_course.php +++ b/course/tests/behat/behat_course.php @@ -51,7 +51,7 @@ class behat_course extends behat_base { try { $this->execute("behat_forms::press_button", get_string('turneditingon')); } catch (Exception $e) { - $this->execute("behat_general::i_click_on_in_the", [get_string('turneditingon'), 'link', 'Administration', 'block']); + $this->execute("behat_navigation::i_navigate_to_in_current_page_administration", [get_string('turneditingon')]); } } @@ -64,7 +64,7 @@ class behat_course extends behat_base { try { $this->execute("behat_forms::press_button", get_string('turneditingoff')); } catch (Exception $e) { - $this->execute("behat_general::i_click_on_in_the", [get_string('turneditingoff'), 'link', 'Administration', 'block']); + $this->execute("behat_navigation::i_navigate_to_in_current_page_administration", [get_string('turneditingoff')]); } } @@ -1728,4 +1728,16 @@ class behat_course extends behat_base { $node = $this->get_management_category_listing_node_by_name($name); $node->find('css', 'a.categoryname')->click(); } + + /** + * Go to the course participants + * + * @Given /^I navigate to course participants$/ + */ + public function i_navigate_to_course_participants() { + $coursestr = behat_context_helper::escape(get_string('courses')); + $mycoursestr = behat_context_helper::escape(get_string('mycourses')); + $xpath = "//div[contains(@class,'block')]//li[p/*[string(.)=$coursestr or string(.)=$mycoursestr]]"; + $this->execute('behat_general::i_click_on_in_the', [get_string('participants'), 'link', $xpath, 'xpath_element']); + } } diff --git a/course/tests/behat/category_management.feature b/course/tests/behat/category_management.feature index f08fb222f4b..5a68d138656 100644 --- a/course/tests/behat/category_management.feature +++ b/course/tests/behat/category_management.feature @@ -340,9 +340,7 @@ Feature: Test category management actions | name | category | idnumber | | Cat 1 | 0 | CAT1 | And I log in as "admin" - And I expand "Site administration" node - And I expand "Courses" node - And I follow "Add a category" + And I navigate to "Courses > Add a category" in site administration And I set the following fields to these values: | Category name | Test duplicate | | Category ID number | CAT1 | diff --git a/course/tests/behat/category_role_assignment.feature b/course/tests/behat/category_role_assignment.feature index 9d9dc77350a..3dfe02cf855 100644 --- a/course/tests/behat/category_role_assignment.feature +++ b/course/tests/behat/category_role_assignment.feature @@ -16,16 +16,15 @@ Feature: Role assignments can be made at the category level | manager | manager | Category | CAT1 | And I log in as "admin" - @javascript Scenario: A user with a category role can assign roles Given I define the allowed role assignments for the "Manager" role as: | Teacher | Assignable | And I log out And I log in as "manager" - And I follow "Courses" + And I am on course index When I follow "Cat 1" - Then I should see "Assign roles" + Then "Assign roles" "link" should exist in current page administration @javascript Scenario: A user with a category role cannot assign roles if there are no roles to assign @@ -37,6 +36,6 @@ Feature: Role assignments can be made at the category level | Student | Not assignable | And I log out And I log in as "manager" - And I follow "Courses" + And I am on course index When I follow "Cat 1" - Then I should not see "Assign roles" + Then "Assign roles" "link" should not exist in current page administration diff --git a/course/tests/behat/course_creation.feature b/course/tests/behat/course_creation.feature index f8c945c9065..8b6c46c58bc 100644 --- a/course/tests/behat/course_creation.feature +++ b/course/tests/behat/course_creation.feature @@ -5,7 +5,7 @@ Feature: Managers can create courses I need to create courses and set default values on them @javascript - Scenario: Courses are created with the default forum and blocks + Scenario: Courses are created with the default announcements forum Given the following "users" exist: | username | firstname | lastname | email | | teacher1 | Teacher | 1 | teacher1@example.com | @@ -24,13 +24,14 @@ Feature: Managers can create courses Then "Latest announcements" "block" should exist And I follow "Announcements" And "Add a new topic" "button" should exist - And "Forced subscription" "link" should not exist + And "Subscription mode > Forced subscription" "link" should not exist in current page administration + And "Subscription mode > Forced subscription" "text" should exist in current page administration And I log out And I log in as "student1" And I follow "Course 1" And I follow "Announcements" And "Add a new topic" "button" should not exist - And I should see "Forced subscription" in the "Administration" "block" + And "Forced subscription" "text" should exist in current page administration Scenario: Create a course from the management interface and return to it Given the following "courses" exist: diff --git a/course/tests/behat/coursetags.feature b/course/tests/behat/coursetags.feature index b330e80b8a5..fe1d331bc0b 100644 --- a/course/tests/behat/coursetags.feature +++ b/course/tests/behat/coursetags.feature @@ -25,7 +25,7 @@ Feature: Tagging courses | teacher2 | c2 | teacher | And I log in as "teacher1" And I follow "Course 1" - And I click on "Edit settings" "link" in the "Administration" "block" + And I navigate to "Edit settings" in current page administration And I set the following fields to these values: | Tags | Mathematics | And I press "Save and display" @@ -34,21 +34,23 @@ Feature: Tagging courses Scenario: Set course tags using the course edit form When I log in as "teacher1" And I follow "Course 1" - And "Course tags" "link" should not exist in the "Administration" "block" - And I click on "Edit settings" "link" in the "Administration" "block" + And I navigate to "Edit settings" node in "Course administration" And I expand all fieldsets Then I should see "Mathematics" in the ".form-autocomplete-selection" "css_element" And I set the following fields to these values: | Tags | Algebra | And I press "Save and display" - And I click on "Dashboard" "link" in the "Navigation" "block" + And I am on homepage And I follow "Course 2" - And I click on "Edit settings" "link" in the "Administration" "block" + And I navigate to "Edit settings" node in "Course administration" And I set the following fields to these values: | Tags | Mathematics, Geometry | And I press "Save and display" And I log out And I log in as "user1" + And I press "Customise this page" + # TODO MDL-57120 "Tags" link not accessible without navigation block. + And I add the "Navigation" block if not present And I navigate to "Tags" node in "Site pages" And I follow "Mathematics" Then I should see "Course 1" @@ -70,20 +72,22 @@ Feature: Tagging courses And I log out When I log in as "teacher2" And I follow "Course 1" - And "Edit settings" "link" should not exist in the "Administration" "block" - And I click on "Course tags" "link" in the "Administration" "block" + And I navigate to "Course tags" in current page administration Then I should see "Mathematics" in the ".form-autocomplete-selection" "css_element" And I set the following fields to these values: | Tags | Algebra | And I press "Save changes" - And I click on "Dashboard" "link" in the "Navigation" "block" + And I am on homepage And I follow "Course 2" - And I click on "Course tags" "link" in the "Administration" "block" + And I navigate to "Course tags" in current page administration And I set the following fields to these values: | Tags | Mathematics, Geometry | And I press "Save changes" And I log out And I log in as "user1" + And I press "Customise this page" + # TODO MDL-57120 "Tags" link not accessible without navigation block. + And I add the "Navigation" block if not present And I navigate to "Tags" node in "Site pages" And I follow "Mathematics" Then I should see "Course 1" diff --git a/course/tests/behat/edit_settings.feature b/course/tests/behat/edit_settings.feature index 572d1a94562..1ef2c67cb64 100644 --- a/course/tests/behat/edit_settings.feature +++ b/course/tests/behat/edit_settings.feature @@ -17,7 +17,7 @@ Feature: Edit course settings | teacher1 | C1 | editingteacher | And I log in as "teacher1" And I follow "Course 1" - When I click on "Edit settings" "link" in the "Administration" "block" + When I navigate to "Edit settings" in current page administration And I set the following fields to these values: | Course full name | Edited course fullname | | Course short name | Edited course shortname | @@ -28,7 +28,7 @@ Feature: Edit course settings And I should not see "C1" And I should see "Edited course fullname" And I should see "Edited course shortname" - And I click on "Edit settings" "link" in the "Administration" "block" + And I navigate to "Edit settings" in current page administration And the field "Course full name" matches value "Edited course fullname" And the field "Course short name" matches value "Edited course shortname" And the field "Course summary" matches value "Edited course summary" diff --git a/course/tests/behat/force_group_mode.feature b/course/tests/behat/force_group_mode.feature index 185d69ed0c5..07333d132f2 100644 --- a/course/tests/behat/force_group_mode.feature +++ b/course/tests/behat/force_group_mode.feature @@ -20,7 +20,7 @@ Feature: Force group mode in a course And I add a "Chat" to section "1" and I fill the form with: | Name of this chat room | Chat room | | Description | Chat description | - And I click on "Edit settings" "link" in the "Administration" "block" + And I navigate to "Edit settings" in current page administration @javascript Scenario: Forced group mode using separate groups diff --git a/course/tests/behat/move_activities.feature b/course/tests/behat/move_activities.feature index 1c81efd6ee0..ba900d446bf 100644 --- a/course/tests/behat/move_activities.feature +++ b/course/tests/behat/move_activities.feature @@ -20,10 +20,6 @@ Feature: Activities can be moved between sections And I add the "Recent activity" block And I follow "Delete Recent activity block" And I press "Yes" - And I follow "Configure Navigation block" - And I set the following fields to these values: - | Visible | Yes | - And I press "Save changes" And I add a "Forum" to section "1" and I fill the form with: | Forum name | Test forum name | | Description | Test forum description | @@ -34,7 +30,7 @@ Feature: Activities can be moved between sections And I should not see "Test forum name" in the "Topic 1" "section" Scenario: Move activities in the course home with Javascript disabled using paged mode - Given I click on "Edit settings" "link" in the "Administration" "block" + Given I navigate to "Edit settings" in current page administration And I set the following fields to these values: | Course layout | Show one section per page | And I press "Save and display" @@ -43,7 +39,7 @@ Feature: Activities can be moved between sections And I should not see "Test forum name" in the "Topic 1" "section" Scenario: Move activities in a course section with Javascript disabled using paged mode - Given I click on "Edit settings" "link" in the "Administration" "block" + Given I navigate to "Edit settings" in current page administration And I set the following fields to these values: | Course layout | Show one section per page | And I press "Save and display" diff --git a/course/tests/behat/move_sections.feature b/course/tests/behat/move_sections.feature index c3bd269812a..d1efdde9dd1 100644 --- a/course/tests/behat/move_sections.feature +++ b/course/tests/behat/move_sections.feature @@ -28,7 +28,7 @@ Feature: Sections can be moved And I should see "Test forum name" in the "Topic 1" "section" Scenario: Move up and down a section with Javascript disabled in the course home of a course using paged mode - Given I click on "Edit settings" "link" in the "Administration" "block" + Given I navigate to "Edit settings" in current page administration And I set the following fields to these values: | Course layout | Show one section per page | And I press "Save and display" @@ -41,7 +41,7 @@ Feature: Sections can be moved And I should see "Test forum name" in the "Topic 1" "section" Scenario: Sections can not be moved with Javascript disabled in a section page of a course using paged mode - Given I click on "Edit settings" "link" in the "Administration" "block" + Given I navigate to "Edit settings" in current page administration And I set the following fields to these values: | Course layout | Show one section per page | And I press "Save and display" diff --git a/course/tests/behat/navigate_course_list.feature b/course/tests/behat/navigate_course_list.feature index d2bb13075da..41dc9b1aaf6 100644 --- a/course/tests/behat/navigate_course_list.feature +++ b/course/tests/behat/navigate_course_list.feature @@ -19,7 +19,7 @@ Feature: Browse course list and return back from enrolment page Scenario: A user can return to the category page from enrolment page When I log in as "user2" - And I click on "Courses" "link" in the "Navigation" "block" + And I am on course index And I follow "Miscellaneous" And I follow "Sample course" And I press "Continue" @@ -32,6 +32,15 @@ Feature: Browse course list and return back from enrolment page @javascript Scenario: A user can return to the previous page from enrolment page by clicking navigation links + Given I log in as "admin" + And I am on site homepage + And I turn editing mode on + And I add the "Navigation" block if not present + And I configure the "Navigation" block + And I set the following fields to these values: + | Page contexts | Display throughout the entire site | + And I press "Save changes" + And I log out When I log in as "user2" And I follow "Preferences" in the user menu And I click on "Edit profile" "link" in the "region-main" "region" @@ -57,7 +66,7 @@ Feature: Browse course list and return back from enrolment page | moodle/course:view | Allow | And I log out When I log in as "user1" - And I click on "Courses" "link" in the "Navigation" "block" + And I am on course index And I follow "Miscellaneous" And I follow "Sample course" And I follow "Test choice" diff --git a/course/tests/behat/rename_roles.feature b/course/tests/behat/rename_roles.feature index e5dce429c02..253aebdb49c 100644 --- a/course/tests/behat/rename_roles.feature +++ b/course/tests/behat/rename_roles.feature @@ -21,7 +21,7 @@ Feature: Rename roles within a course | student1 | C1 | student | And I log in as "teacher1" And I follow "Course 1" - When I click on "Edit settings" "link" in the "Administration" "block" + When I navigate to "Edit settings" in current page administration And I set the following fields to these values: | Your word for 'Non-editing teacher' | Tutor | | Your word for 'Student' | Learner | @@ -29,11 +29,12 @@ Feature: Rename roles within a course And I follow "Switch role to..." in the user menu Then "Tutor" "button" should exist And "Learner" "button" should exist - And I follow "Participants" + And I navigate to course participants And the "roleid" select box should contain "Tutor" And the "roleid" select box should contain "Learner" And the "roleid" select box should not contain "Student" - And I click on "Edit settings" "link" in the "Administration" "block" + And I follow "Course 1" + And I navigate to "Edit settings" in current page administration And I set the following fields to these values: | Your word for 'Non-editing teacher' | | | Your word for 'Student' | | @@ -42,6 +43,6 @@ Feature: Rename roles within a course And I should see "Teacher" And "Student" "button" should exist And "Learner" "button" should not exist - And I follow "Participants" + And I navigate to course participants And the "roleid" select box should contain "Non-editing teacher" And the "roleid" select box should contain "Student" diff --git a/course/tests/behat/restrict_available_activities.feature b/course/tests/behat/restrict_available_activities.feature index 6d8485d22ad..dc240de8048 100644 --- a/course/tests/behat/restrict_available_activities.feature +++ b/course/tests/behat/restrict_available_activities.feature @@ -35,8 +35,7 @@ Feature: Restrict activities availability | mod/chat:addinstance | Prohibit | And I am on site homepage And I follow "Course 1" - And I expand "Users" node - And I follow "Permissions" + And I navigate to "Users > Permissions" in current page administration And I override the system permissions of "Teacher" role with: | mod/glossary:addinstance | Prohibit | And I log out diff --git a/course/tests/behat/role_renaming.feature b/course/tests/behat/role_renaming.feature index 7384c4c9cbd..31012650357 100644 --- a/course/tests/behat/role_renaming.feature +++ b/course/tests/behat/role_renaming.feature @@ -20,7 +20,7 @@ Feature: Rename roles in a course Scenario: Teacher can rename roles Given I log in as "teacher1" And I follow "Course 1" - And I click on "Edit settings" "link" in the "Administration" "block" + And I navigate to "Edit settings" in current page administration And I should see "Role renaming" When I set the following fields to these values: | Your word for 'Teacher' | Lecturer | @@ -38,6 +38,6 @@ Feature: Rename roles in a course And I follow "Log out" When I log in as "teacher1" And I follow "Course 1" - And I click on "Edit settings" "link" in the "Administration" "block" + And I navigate to "Edit settings" in current page administration Then I should not see "Role renaming" And I should not see "Your word for 'Teacher'" diff --git a/course/tests/behat/view_subfolders_inline.feature b/course/tests/behat/view_subfolders_inline.feature index 08404751d98..9730e539c18 100644 --- a/course/tests/behat/view_subfolders_inline.feature +++ b/course/tests/behat/view_subfolders_inline.feature @@ -53,7 +53,7 @@ Feature: View subfolders in a course in-line And I click on "button.fp-dlg-butcreate" "css_element" in the "div.fp-mkdir-dlg" "css_element" And I press "Save changes" And I should see "Test sub subfolder" - And I navigate to "Edit settings" node in "Folder administration" + And I navigate to "Edit settings" in current page administration And I set the field "Display folder contents" to "Inline on a course page" And I set the field "Show subfolders expanded" to "" And I press "Save and return to course" diff --git a/enrol/database/db/upgrade.php b/enrol/database/db/upgrade.php index 5a44fd78a2d..05180a6e13b 100644 --- a/enrol/database/db/upgrade.php +++ b/enrol/database/db/upgrade.php @@ -39,5 +39,8 @@ function xmldb_enrol_database_upgrade($oldversion) { // Moodle v3.1.0 release upgrade line. // Put any upgrade step following this. + // Automatically generated Moodle v3.2.0 release upgrade line. + // Put any upgrade step following this. + return true; } diff --git a/enrol/flatfile/db/upgrade.php b/enrol/flatfile/db/upgrade.php index 8660e338f94..c2abcd975b1 100644 --- a/enrol/flatfile/db/upgrade.php +++ b/enrol/flatfile/db/upgrade.php @@ -39,5 +39,8 @@ function xmldb_enrol_flatfile_upgrade($oldversion) { // Moodle v3.1.0 release upgrade line. // Put any upgrade step following this. + // Automatically generated Moodle v3.2.0 release upgrade line. + // Put any upgrade step following this. + return true; } diff --git a/enrol/guest/db/upgrade.php b/enrol/guest/db/upgrade.php index 4f44dbea82f..414d60eafcb 100644 --- a/enrol/guest/db/upgrade.php +++ b/enrol/guest/db/upgrade.php @@ -39,5 +39,8 @@ function xmldb_enrol_guest_upgrade($oldversion) { // Moodle v3.1.0 release upgrade line. // Put any upgrade step following this. + // Automatically generated Moodle v3.2.0 release upgrade line. + // Put any upgrade step following this. + return true; } diff --git a/enrol/imsenterprise/db/upgrade.php b/enrol/imsenterprise/db/upgrade.php index 1a7a9ad2930..ab0a72d5b54 100644 --- a/enrol/imsenterprise/db/upgrade.php +++ b/enrol/imsenterprise/db/upgrade.php @@ -45,5 +45,8 @@ function xmldb_enrol_imsenterprise_upgrade($oldversion) { // Moodle v3.1.0 release upgrade line. // Put any upgrade step following this. + // Automatically generated Moodle v3.2.0 release upgrade line. + // Put any upgrade step following this. + return true; } diff --git a/enrol/lti/db/upgrade.php b/enrol/lti/db/upgrade.php index 4f4ba4c44b4..94a90cc9763 100644 --- a/enrol/lti/db/upgrade.php +++ b/enrol/lti/db/upgrade.php @@ -242,5 +242,8 @@ function xmldb_enrol_lti_upgrade($oldversion) { upgrade_plugin_savepoint(true, 2016052304, 'enrol', 'lti'); } + // Automatically generated Moodle v3.2.0 release upgrade line. + // Put any upgrade step following this. + return true; } diff --git a/enrol/manual/db/upgrade.php b/enrol/manual/db/upgrade.php index 8207e81d7e0..b414037b15a 100644 --- a/enrol/manual/db/upgrade.php +++ b/enrol/manual/db/upgrade.php @@ -45,5 +45,8 @@ function xmldb_enrol_manual_upgrade($oldversion) { // Moodle v3.1.0 release upgrade line. // Put any upgrade step following this. + // Automatically generated Moodle v3.2.0 release upgrade line. + // Put any upgrade step following this. + return true; } diff --git a/enrol/manual/yui/quickenrolment/assets/skins/sam/quickenrolment.css b/enrol/manual/yui/quickenrolment/assets/skins/sam/quickenrolment.css index 8cfa708b1da..53cb56c6907 100644 --- a/enrol/manual/yui/quickenrolment/assets/skins/sam/quickenrolment.css +++ b/enrol/manual/yui/quickenrolment/assets/skins/sam/quickenrolment.css @@ -74,13 +74,19 @@ Structure of the user enroller panel float: left; margin: 3px; } - +/* Note this file isn't auto flipped, so we need dir-rtl rules*/ +.dir-rtl .user-enroller-panel .uep-search-results .user .picture { + float: right; +} .user-enroller-panel .uep-search-results .user .details { width: 180px; float: left; margin: 3px; } - +/* Note this file isn't auto flipped, so we need dir-rtl rules*/ +.dir-rtl .user-enroller-panel .uep-search-results .user .details { + float: right; +} .user-enroller-panel .uep-search-results .user .options { padding-right: 7px; margin: 3px; @@ -91,6 +97,10 @@ Structure of the user enroller panel float: right; cursor: pointer; } +/* Note this file isn't auto flipped, so we need dir-rtl rules*/ +.dir-rtl .user-enroller-panel .uep-search-results .user .options .enrol { + float: left; +} .user-enroller-panel .uep-search-results .cohort { width: 100%; diff --git a/enrol/meta/tests/behat/enrol_meta.feature b/enrol/meta/tests/behat/enrol_meta.feature index c5df107038e..e28b005e25a 100644 --- a/enrol/meta/tests/behat/enrol_meta.feature +++ b/enrol/meta/tests/behat/enrol_meta.feature @@ -31,8 +31,7 @@ Feature: Enrolments are synchronised with meta courses And I log in as "admin" And I navigate to "Manage enrol plugins" node in "Site administration > Plugins > Enrolments" And I click on "Enable" "link" in the "Course meta link" "table_row" - And I am on homepage - And I follow "Courses" + And I am on course index Scenario: Add meta enrolment instance without groups When I follow "Course 3" @@ -94,8 +93,7 @@ Feature: Enrolments are synchronised with meta courses And I press "Next" And I press "Perform restore" And I trigger cron - And I am on homepage - And I follow "Courses" + And I am on course index And I follow "Course 4" And I navigate to "Enrolment methods" node in "Course administration > Users" Then I should see "Course meta link (Course 1)" diff --git a/enrol/mnet/db/upgrade.php b/enrol/mnet/db/upgrade.php index b96eb18b948..9a6370eca18 100644 --- a/enrol/mnet/db/upgrade.php +++ b/enrol/mnet/db/upgrade.php @@ -39,5 +39,8 @@ function xmldb_enrol_mnet_upgrade($oldversion) { // Moodle v3.1.0 release upgrade line. // Put any upgrade step following this. + // Automatically generated Moodle v3.2.0 release upgrade line. + // Put any upgrade step following this. + return true; } diff --git a/enrol/paypal/db/upgrade.php b/enrol/paypal/db/upgrade.php index 8fab0c7f60f..e3860296c32 100644 --- a/enrol/paypal/db/upgrade.php +++ b/enrol/paypal/db/upgrade.php @@ -57,5 +57,8 @@ function xmldb_enrol_paypal_upgrade($oldversion) { // Moodle v3.1.0 release upgrade line. // Put any upgrade step following this. + // Automatically generated Moodle v3.2.0 release upgrade line. + // Put any upgrade step following this. + return true; } diff --git a/enrol/self/db/upgrade.php b/enrol/self/db/upgrade.php index 581de7a5c95..7575ed93008 100644 --- a/enrol/self/db/upgrade.php +++ b/enrol/self/db/upgrade.php @@ -39,9 +39,6 @@ function xmldb_enrol_self_upgrade($oldversion) { // Moodle v3.1.0 release upgrade line. // Put any upgrade step following this. - // Moodle v3.2.0 release upgrade line. - // Put any upgrade step following this. - if ($oldversion < 2016052301) { global $DB; // Get roles with manager archetype. @@ -58,5 +55,8 @@ function xmldb_enrol_self_upgrade($oldversion) { upgrade_plugin_savepoint(true, 2016052301, 'enrol', 'self'); } + // Automatically generated Moodle v3.2.0 release upgrade line. + // Put any upgrade step following this. + return true; } diff --git a/enrol/self/tests/behat/self_enrolment.feature b/enrol/self/tests/behat/self_enrolment.feature index c60f0ed7408..a0c53dd7dde 100644 --- a/enrol/self/tests/behat/self_enrolment.feature +++ b/enrol/self/tests/behat/self_enrolment.feature @@ -74,7 +74,8 @@ Feature: Users can auto-enrol themself in courses where self enrolment is allowe | Custom instance name | Test student enrolment | | Enrolment key | moodle_rules | | Use group enrolment keys | Yes | - And I follow "Groups" + And I follow "Course 1" + And I navigate to "Users > Groups" in current page administration And I press "Create group" And I set the following fields to these values: | Group name | Group 1 | diff --git a/enrol/tests/behat/enrol_user.feature b/enrol/tests/behat/enrol_user.feature index 9166d584ed9..94a80c55196 100644 --- a/enrol/tests/behat/enrol_user.feature +++ b/enrol/tests/behat/enrol_user.feature @@ -12,7 +12,7 @@ Feature: User can be enrolled into a course | fullname | shortname | | Course 001 | C001 | And I log in as "admin" - And I follow "Courses" + And I am on course index And I follow "Course 001" Scenario: User can be enrolled without javascript diff --git a/enrol/tests/behat/manage_enrolments_from_participants.feature b/enrol/tests/behat/manage_enrolments_from_participants.feature index 7a4bbd9868c..d50bde399d8 100644 --- a/enrol/tests/behat/manage_enrolments_from_participants.feature +++ b/enrol/tests/behat/manage_enrolments_from_participants.feature @@ -20,7 +20,7 @@ Feature: Manage enrollments from participants page | teacher1 | C1 | editingteacher | And I log in as "teacher1" And I follow "Course 1" - And I navigate to "Participants" node in "My courses > C1" + And I navigate to course participants Scenario: Check the participants link when "All partipants" selected Given I select "All participants" from the "roleid" singleselect diff --git a/files/tests/behat/course_files.feature b/files/tests/behat/course_files.feature index c610bfabde2..af9f65ab038 100644 --- a/files/tests/behat/course_files.feature +++ b/files/tests/behat/course_files.feature @@ -15,7 +15,7 @@ Feature: Course files When I log in as "admin" And I am on site homepage And I follow "Course 1" - Then I should see "Legacy course files" + Then "Legacy course files" "link" should exist in current page administration And I navigate to "Legacy course files" node in "Course administration" And I press "Edit legacy course files" And "Add..." "link" should be visible @@ -32,7 +32,7 @@ Feature: Course files When I log in as "admin" And I am on site homepage And I follow "Course 1" - Then I should see "Legacy course files" + Then "Legacy course files" "link" should exist in current page administration And I navigate to "Legacy course files" node in "Course administration" And I press "Edit legacy course files" And "Add..." "link" should not be visible diff --git a/filter/mathjaxloader/db/upgrade.php b/filter/mathjaxloader/db/upgrade.php index affcc5a7498..cfc9ea79e47 100644 --- a/filter/mathjaxloader/db/upgrade.php +++ b/filter/mathjaxloader/db/upgrade.php @@ -155,5 +155,8 @@ MathJax.Hub.Config({ } upgrade_plugin_savepoint(true, 2016102500, 'filter', 'mathjaxloader'); } + // Automatically generated Moodle v3.2.0 release upgrade line. + // Put any upgrade step following this. + return true; } diff --git a/filter/mediaplugin/db/upgrade.php b/filter/mediaplugin/db/upgrade.php index 0e05041de36..9f9a5aa2b2e 100644 --- a/filter/mediaplugin/db/upgrade.php +++ b/filter/mediaplugin/db/upgrade.php @@ -44,5 +44,8 @@ function xmldb_filter_mediaplugin_upgrade($oldversion) { // Moodle v3.1.0 release upgrade line. // Put any upgrade step following this. + // Automatically generated Moodle v3.2.0 release upgrade line. + // Put any upgrade step following this. + return true; } diff --git a/filter/tex/db/upgrade.php b/filter/tex/db/upgrade.php index f8320d70a80..321ba733830 100644 --- a/filter/tex/db/upgrade.php +++ b/filter/tex/db/upgrade.php @@ -44,5 +44,8 @@ function xmldb_filter_tex_upgrade($oldversion) { // Moodle v3.1.0 release upgrade line. // Put any upgrade step following this. + // Automatically generated Moodle v3.2.0 release upgrade line. + // Put any upgrade step following this. + return true; } diff --git a/grade/edit/tree/item_form.php b/grade/edit/tree/item_form.php index 572faa369a8..2313c637c0b 100644 --- a/grade/edit/tree/item_form.php +++ b/grade/edit/tree/item_form.php @@ -463,7 +463,8 @@ class edit_item_form extends moodleform { } if ($grade_item) { if ($grade_item->gradetype == GRADE_TYPE_VALUE) { - if (grade_floats_different($data['grademin'], $grade_item->grademin) || + if ((((bool) get_config('moodle', 'grade_report_showmin')) && + grade_floats_different($data['grademin'], $grade_item->grademin)) || grade_floats_different($data['grademax'], $grade_item->grademax)) { if ($grade_item->has_grades() && empty($data['rescalegrades'])) { $errors['rescalegrades'] = get_string('mustchooserescaleyesorno', 'grades'); diff --git a/grade/export/txt/tests/behat/export.feature b/grade/export/txt/tests/behat/export.feature index f6e84a59bd5..ea92bf6ae29 100644 --- a/grade/export/txt/tests/behat/export.feature +++ b/grade/export/txt/tests/behat/export.feature @@ -22,14 +22,14 @@ Feature: I need to export grades as text | assign | C1 | a2 | Test assignment name 2 | Submit your online text | 1 | And I log in as "teacher1" And I follow "Course 1" - And I go to "View > Grader report" in the course gradebook + And I navigate to "View > Grader report" in the course gradebook And I turn editing mode on And I give the grade "80.00" to the user "Student 1" for the grade item "Test assignment name" And I press "Save changes" @javascript Scenario: Export grades as text - When I go to "Export > Plain text file" in the course gradebook + When I navigate to "Export > Plain text file" in the course gradebook And I expand all fieldsets And I click on "Course total" "checkbox" And I set the field "Grade export decimal points" to "1" @@ -41,7 +41,7 @@ Feature: I need to export grades as text @javascript Scenario: Export grades as text using real - When I go to "Export > Plain text file" in the course gradebook + When I navigate to "Export > Plain text file" in the course gradebook And I expand all fieldsets And I set the following fields to these values: | Real | 1 | @@ -52,7 +52,7 @@ Feature: I need to export grades as text @javascript Scenario: Export grades as text using percentages and letters - When I go to "Export > Plain text file" in the course gradebook + When I navigate to "Export > Plain text file" in the course gradebook And I set the following fields to these values: | Percentage | 1 | | Letter | 1 | @@ -65,7 +65,7 @@ Feature: I need to export grades as text @javascript Scenario: Export grades as text using real, percentages and letters - When I go to "Export > Plain text file" in the course gradebook + When I navigate to "Export > Plain text file" in the course gradebook And I set the following fields to these values: | Real | 1 | | Percentage | 1 | diff --git a/grade/export/xml/tests/behat/export.feature b/grade/export/xml/tests/behat/export.feature index abc0e70a051..9e6450a0181 100644 --- a/grade/export/xml/tests/behat/export.feature +++ b/grade/export/xml/tests/behat/export.feature @@ -21,14 +21,14 @@ Feature: I need to export grades as xml | assign | C1 | a1 | Test assignment name | Submit something! | And I log in as "teacher1" And I follow "Course 1" - And I go to "View > Grader report" in the course gradebook + And I navigate to "View > Grader report" in the course gradebook And I turn editing mode on And I give the grade "80.00" to the user "Student 1" for the grade item "Test assignment name" And I press "Save changes" @javascript Scenario: Export grades as text - When I go to "Export > XML file" in the course gradebook + When I navigate to "Export > XML file" in the course gradebook And I expand all fieldsets And I set the field "Grade export decimal points" to "1" And I press "Download" diff --git a/grade/grading/form/guide/db/upgrade.php b/grade/grading/form/guide/db/upgrade.php index eb06597c269..a9e82f87cc1 100644 --- a/grade/grading/form/guide/db/upgrade.php +++ b/grade/grading/form/guide/db/upgrade.php @@ -49,5 +49,8 @@ function xmldb_gradingform_guide_upgrade($oldversion) { // Moodle v3.1.0 release upgrade line. // Put any upgrade step following this. + // Automatically generated Moodle v3.2.0 release upgrade line. + // Put any upgrade step following this. + return true; } diff --git a/grade/grading/form/guide/tests/behat/edit_guide.feature b/grade/grading/form/guide/tests/behat/edit_guide.feature index 0181a86d5d4..8f1ff15323d 100644 --- a/grade/grading/form/guide/tests/behat/edit_guide.feature +++ b/grade/grading/form/guide/tests/behat/edit_guide.feature @@ -87,7 +87,7 @@ Feature: Marking guides can be created and edited And I press "Ok" And I follow "Edit settings" And I follow "Test assignment 1 name" - And I click on "View all submissions" "link" in the "Administration" "block" + And I navigate to "View all submissions" in current page administration # Checking that the user grade is correct. Then I should see "80" in the "Student 1" "table_row" And I log out diff --git a/grade/grading/form/rubric/db/upgrade.php b/grade/grading/form/rubric/db/upgrade.php index 3d6ca7f90d6..2ac71477ee7 100644 --- a/grade/grading/form/rubric/db/upgrade.php +++ b/grade/grading/form/rubric/db/upgrade.php @@ -45,5 +45,8 @@ function xmldb_gradingform_rubric_upgrade($oldversion) { // Moodle v3.1.0 release upgrade line. // Put any upgrade step following this. + // Automatically generated Moodle v3.2.0 release upgrade line. + // Put any upgrade step following this. + return true; } diff --git a/grade/grading/form/rubric/tests/behat/reuse_own_rubrics.feature b/grade/grading/form/rubric/tests/behat/reuse_own_rubrics.feature index 1f196737100..5effb3d0e32 100644 --- a/grade/grading/form/rubric/tests/behat/reuse_own_rubrics.feature +++ b/grade/grading/form/rubric/tests/behat/reuse_own_rubrics.feature @@ -40,6 +40,7 @@ Feature: Reuse my rubrics in other activities And I should see "Criterion 1" And I should see "Criterion 2" And I should see "Criterion 3" + And I follow "Course 1" And I go to "Test assignment 1 name" advanced grading definition page And I should see "Criterion 1" And I should see "Criterion 2" diff --git a/grade/grading/tests/behat/behat_grading.php b/grade/grading/tests/behat/behat_grading.php index c4c9307e530..2aa49bc5a37 100644 --- a/grade/grading/tests/behat/behat_grading.php +++ b/grade/grading/tests/behat/behat_grading.php @@ -49,13 +49,8 @@ class behat_grading extends behat_base { $this->execute('behat_general::click_link', $this->escape($activityname)); - $this->execute('behat_general::i_click_on_in_the', - array( - get_string('gradingmanagement', 'grading'), - 'link', - 'Administration', - 'block' - )); + $this->execute('behat_navigation::i_navigate_to_in_current_page_administration', + get_string('gradingmanagement', 'grading')); } /** @@ -92,13 +87,8 @@ class behat_grading extends behat_base { $this->execute('behat_general::click_link', $this->escape($activityname)); - $this->execute('behat_general::i_click_on_in_the', - array( - get_string('viewgrading', 'mod_assign'), - 'link', - 'Administration', - 'block' - )); + $this->execute('behat_navigation::i_navigate_to_in_current_page_administration', + get_string('viewgrading', 'mod_assign')); $this->execute('behat_general::i_click_on_in_the', array( @@ -169,13 +159,8 @@ class behat_grading extends behat_base { $this->execute('behat_forms::press_button', 'Ok'); $this->execute('behat_general::i_click_on', array($this->escape(get_string('editsettings')), 'link')); $this->execute('behat_forms::press_button', get_string('cancel')); - $this->execute('behat_general::i_click_on_in_the', - array( - get_string('viewgrading', 'mod_assign'), - 'link', - 'Administration', - 'block' - )); + $this->execute('behat_navigation::i_navigate_to_in_current_page_administration', + get_string('viewgrading', 'mod_assign')); } /** diff --git a/grade/report/grader/tests/behat/ajax_grader.feature b/grade/report/grader/tests/behat/ajax_grader.feature index b75a92f1af8..e274a36ef94 100644 --- a/grade/report/grader/tests/behat/ajax_grader.feature +++ b/grade/report/grader/tests/behat/ajax_grader.feature @@ -55,7 +55,7 @@ Feature: Using the AJAX grading feature of Grader report to update grades and fe | grade_report_showquickfeedback | 0 | And I log in as "teacher1" And I follow "Course 1" - And I go to "View > Grader report" in the course gradebook + And I navigate to "View > Grader report" in the course gradebook And I click on student "Student 2" for grade item "Item VU" Then I should see a grade field for "Student 2" and grade item "Item VU" And I should not see a feedback field for "Student 2" and grade item "Item VU" @@ -93,7 +93,7 @@ Feature: Using the AJAX grading feature of Grader report to update grades and fe And the following should exist in the "user-grades" table: | -1- | -16- | | Student 1 | 90.00 | - And I go to "View > Grader report" in the course gradebook + And I navigate to "View > Grader report" in the course gradebook And the following should exist in the "user-grades" table: | -1- | -6- | -7- | -13- | -16- | | Student 1 | - | - | - | 90.00 | @@ -107,7 +107,7 @@ Feature: Using the AJAX grading feature of Grader report to update grades and fe | grade_report_showquickfeedback | 1 | And I log in as "teacher1" And I follow "Course 1" - And I go to "View > Grader report" in the course gradebook + And I navigate to "View > Grader report" in the course gradebook And I click on student "Student 2" for grade item "Item VU" Then I should see a grade field for "Student 2" and grade item "Item VU" And I should see a feedback field for "Student 2" and grade item "Item VU" @@ -127,8 +127,8 @@ Feature: Using the AJAX grading feature of Grader report to update grades and fe And I set the field "ajaxfeedback" to "Student 2 SU feedback" And I press key "13" in the field "ajaxfeedback" # Reload grader report: - And I go to "View > User report" in the course gradebook - And I go to "View > Grader report" in the course gradebook + And I navigate to "View > User report" in the course gradebook + And I navigate to "View > Grader report" in the course gradebook And the following should exist in the "user-grades" table: | -1- | -7- | -13- | -16- | | Student 2 | 33.00 | Very good | 36.00 | @@ -144,7 +144,7 @@ Feature: Using the AJAX grading feature of Grader report to update grades and fe | grade_report_showquickfeedback | 1 | And I log in as "teacher1" And I follow "Course 1" - And I go to "View > Grader report" in the course gradebook + And I navigate to "View > Grader report" in the course gradebook And I click on student "Student 2" for grade item "Item VU" Then I should see a grade field for "Student 2" and grade item "Item VU" And I should see a feedback field for "Student 2" and grade item "Item VU" @@ -164,7 +164,7 @@ Feature: Using the AJAX grading feature of Grader report to update grades and fe | grade_report_showquickfeedback | 1 | And I log in as "teacher1" And I follow "Course 1" - And I go to "View > Grader report" in the course gradebook + And I navigate to "View > Grader report" in the course gradebook And I turn editing mode on Then I should not see a grade field for "Student 2" and grade item "Item VL" And I should not see a feedback field for "Student 2" and grade item "Item VL" @@ -195,7 +195,7 @@ Feature: Using the AJAX grading feature of Grader report to update grades and fe | grade_report_showquickfeedback | 1 | And I log in as "teacher1" And I follow "Course 1" - And I go to "View > Grader report" in the course gradebook + And I navigate to "View > Grader report" in the course gradebook And I turn editing mode on And I change window size to "large" And I set "=[[i1]] + [[i3]] + [[gsc]]" calculation for grade item "Calc Item" with idnumbers: diff --git a/grade/report/grader/tests/behat/switch_views.feature b/grade/report/grader/tests/behat/switch_views.feature index d2256900d3e..775f455c05b 100644 --- a/grade/report/grader/tests/behat/switch_views.feature +++ b/grade/report/grader/tests/behat/switch_views.feature @@ -46,7 +46,7 @@ Feature: We can change what we are viewing on the grader report And I log out And I log in as "teacher1" And I follow "Course 1" - And I go to "View > Grader report" in the course gradebook + And I navigate to "View > Grader report" in the course gradebook And I turn editing mode on And I give the grade "80.00" to the user "Student 1" for the grade item "Test assignment name 1" And I give the grade "90.00" to the user "Student 1" for the grade item "Test assignment name 2" @@ -60,7 +60,7 @@ Feature: We can change what we are viewing on the grader report And I open "Test assignment name 2" actions menu And I click on "Hide" "link" in the "Test assignment name 2" activity And I follow "Course 1" - And I go to "View > Grader report" in the course gradebook + And I navigate to "View > Grader report" in the course gradebook And I should see "Test assignment name 1" And I should see "Test assignment name 2" And I should see "Course total" @@ -96,7 +96,7 @@ Feature: We can change what we are viewing on the grader report And I log out And I log in as "teacher1" And I follow "Course 1" - And I go to "View > Grader report" in the course gradebook + And I navigate to "View > Grader report" in the course gradebook And I should see "Test assignment name 1" And I should see "Test assignment name 2" And I should see "Course total" diff --git a/grade/report/history/tests/behat/basic_functionality.feature b/grade/report/history/tests/behat/basic_functionality.feature index 8245157ad66..3704c3ad420 100644 --- a/grade/report/history/tests/behat/basic_functionality.feature +++ b/grade/report/history/tests/behat/basic_functionality.feature @@ -30,7 +30,7 @@ Feature: A teacher checks the grade history report in a course And I add a "Assignment" to section "1" and I fill the form with: | Assignment name | Rewarding assignment | | Description | After writing your behat test go grab a beer! | - And I go to "View > Grader report" in the course gradebook + And I navigate to "View > Grader report" in the course gradebook And I turn editing mode on And I give the grade "50.00" to the user "Student 1" for the grade item "The greatest assignment ever" And I give the grade "60.00" to the user "Student 1" for the grade item "Rewarding assignment" @@ -40,7 +40,7 @@ Feature: A teacher checks the grade history report in a course And I log out And I log in as "teacher2" And I follow "Course 1" - And I go to "View > Grader report" in the course gradebook + And I navigate to "View > Grader report" in the course gradebook And I turn editing mode on And I give the grade "70.00" to the user "Student 1" for the grade item "The greatest assignment ever" And I give the grade "80.00" to the user "Student 1" for the grade item "Rewarding assignment" diff --git a/grade/report/singleview/tests/behat/bulk_insert_grades.feature b/grade/report/singleview/tests/behat/bulk_insert_grades.feature index 608f98ad0d9..fe94e1fcf2f 100644 --- a/grade/report/singleview/tests/behat/bulk_insert_grades.feature +++ b/grade/report/singleview/tests/behat/bulk_insert_grades.feature @@ -33,14 +33,14 @@ Feature: We can bulk insert grades for students in a course Given I log in as "teacher1" And I follow "Course 1" And I follow "Test assignment one" - And I click on "View all submissions" "link" in the "Administration" "block" + And I navigate to "View all submissions" in current page administration And I click on "Grade" "link" in the "Student 1" "table_row" And I set the following fields to these values: | Grade out of 100 | 50 | And I press "Save changes" And I press "Ok" - And I follow "Edit settings" - And I follow "View gradebook" + And I follow "Course 1" + And I navigate to "View > Grader report" in the course gradebook And I follow "Single view for Test assignment one" Then the field "Grade for james (Student) 1" matches value "50.00" And the field "Override for james (Student) 1" matches value "0" @@ -74,14 +74,14 @@ Feature: We can bulk insert grades for students in a course Given I log in as "teacher1" And I follow "Course 1" And I follow "Test assignment two" - And I click on "View all submissions" "link" in the "Administration" "block" + And I navigate to "View all submissions" in current page administration And I click on "Grade" "link" in the "Student 1" "table_row" And I set the following fields to these values: | Grade out of 100 | 50 | And I press "Save changes" And I press "Ok" - And I follow "Edit settings" - And I follow "View gradebook" + And I follow "Course 1" + And I navigate to "View > Grader report" in the course gradebook # And I click on "input[title='Dock Navigation block']" "css_element" # And I click on "input[title='Dock Administration block']" "css_element" And I follow "Single view for Test assignment two" diff --git a/grade/report/singleview/tests/behat/singleview.feature b/grade/report/singleview/tests/behat/singleview.feature index 7b77cdabaa6..cd1774fd9a2 100644 --- a/grade/report/singleview/tests/behat/singleview.feature +++ b/grade/report/singleview/tests/behat/singleview.feature @@ -52,11 +52,11 @@ Feature: We can use Single view | gradereport/singleview:view | Allow | teacher | Course | C1 | And I log in as "teacher1" And I follow "Course 1" - Given I go to "View > Grader report" in the course gradebook + Given I navigate to "View > Grader report" in the course gradebook @javascript Scenario: I can update grades, add feedback and exclude grades. - Given I go to "View > Single view" in the course gradebook + Given I navigate to "View > Single view" in the course gradebook And I select "Student 4" from the "Select user..." singleselect And I set the field "Override for Test assignment one" to "1" When I set the following fields to these values: @@ -97,7 +97,7 @@ Feature: We can use Single view And I log out And I log in as "teacher2" And I follow "Course 1" - Given I go to "View > Single view" in the course gradebook + Given I navigate to "View > Single view" in the course gradebook And I click on "Student 4" "option" And the "Exclude for Test assignment one" "checkbox" should be disabled And the "Override for Test assignment one" "checkbox" should be enabled @@ -105,7 +105,7 @@ Feature: We can use Single view Scenario: Single view links work on grade report. Given I follow "Single view for Test assignment one" Then I should see "Test assignment one" - Then I go to "View > Grader report" in the course gradebook + Then I navigate to "View > Grader report" in the course gradebook And I follow "Single view for Student 1" Then I should see "Student 1" diff --git a/grade/report/user/db/upgrade.php b/grade/report/user/db/upgrade.php index c80ab9d0862..8ed4c19d83e 100644 --- a/grade/report/user/db/upgrade.php +++ b/grade/report/user/db/upgrade.php @@ -48,5 +48,8 @@ function xmldb_gradereport_user_upgrade($oldversion) { // Moodle v3.1.0 release upgrade line. // Put any upgrade step following this. + // Automatically generated Moodle v3.2.0 release upgrade line. + // Put any upgrade step following this. + return true; } diff --git a/grade/report/user/lib.php b/grade/report/user/lib.php index c6978e4b058..e582b7a05a1 100644 --- a/grade/report/user/lib.php +++ b/grade/report/user/lib.php @@ -544,7 +544,7 @@ class grade_report_user extends grade_report { } if ($this->showgrade) { - $gradeitemdata['graderaw'] = ''; + $gradeitemdata['graderaw'] = null; $gradeitemdata['gradehiddenbydate'] = false; $gradeitemdata['gradeneedsupdate'] = $grade_grade->grade_item->needsupdate; $gradeitemdata['gradeishidden'] = $grade_grade->is_hidden(); diff --git a/grade/report/user/tests/behat/user_view.feature b/grade/report/user/tests/behat/user_view.feature index 5ce38e0af87..e54ac6f187e 100644 --- a/grade/report/user/tests/behat/user_view.feature +++ b/grade/report/user/tests/behat/user_view.feature @@ -32,10 +32,10 @@ Feature: View the user report as the student will see it | assign | C1 | a6 | Test assignment six | Submit something! | 100 | And I log in as "teacher1" And I follow "Course 1" - And I go to "Setup > Gradebook setup" in the course gradebook + And I navigate to "Setup > Gradebook setup" in the course gradebook And I hide the grade item "Test assignment six" And I hide the grade item "Sub category 2" - And I go to "View > Grader report" in the course gradebook + And I navigate to "View > Grader report" in the course gradebook And I turn editing mode on And I change window size to "large" And I give the grade "80.00" to the user "Student 1" for the grade item "Test assignment one" @@ -48,7 +48,7 @@ Feature: View the user report as the student will see it And I change window size to "medium" Scenario: View the report as the teacher themselves - When I go to "View > User report" in the course gradebook + When I navigate to "View > User report" in the course gradebook And I select "Student 1" from the "Select all or one user" singleselect And I select "Myself" from the "View report as" singleselect Then the following should exist in the "user-grade" table: @@ -64,7 +64,7 @@ Feature: View the user report as the student will see it | Course total | - | 383.00 | 0–600 | 63.83 % | - | Scenario: View the report as the student from both the teachers and students perspective - When I go to "View > User report" in the course gradebook + When I navigate to "View > User report" in the course gradebook And I select "Student 1" from the "Select all or one user" singleselect And I select "User" from the "View report as" singleselect Then the following should exist in the "user-grade" table: @@ -83,7 +83,7 @@ Feature: View the user report as the student will see it And I log out And I log in as "student1" And I follow "Course 1" - And I go to "User report" in the course gradebook + And I navigate to "User report" in the course gradebook Then the following should exist in the "user-grade" table: | Grade item | Calculated weight | Grade | Range | Percentage | Contribution to course total | | Test assignment one | - | 80.00 | 0–100 | 80.00 % | - | @@ -99,10 +99,10 @@ Feature: View the user report as the student will see it | Test assignment six | Scenario: View the report as the student from both the teachers and students perspective with totals excluding hidden - Given I go to "Setup > Course grade settings" in the course gradebook + Given I navigate to "Setup > Course grade settings" in the course gradebook And I set the field with xpath "//select[@name='report_user_showtotalsifcontainhidden']" to "Show totals excluding hidden items" And I press "Save changes" - And I go to "View > User report" in the course gradebook + And I navigate to "View > User report" in the course gradebook When I select "Student 1" from the "Select all or one user" singleselect And I select "User" from the "View report as" singleselect Then the following should exist in the "user-grade" table: @@ -121,7 +121,7 @@ Feature: View the user report as the student will see it And I log out And I log in as "student1" And I follow "Course 1" - And I go to "User report" in the course gradebook + And I navigate to "User report" in the course gradebook Then the following should exist in the "user-grade" table: | Grade item | Calculated weight | Grade | Range | Percentage | Contribution to course total | | Test assignment one | 50.00 % | 80.00 | 0–100 | 80.00 % | 26.67 % | @@ -137,10 +137,10 @@ Feature: View the user report as the student will see it | Test assignment six | Scenario: View the report as the student from both the teachers and students perspective with totals including hidden - Given I go to "Setup > Course grade settings" in the course gradebook + Given I navigate to "Setup > Course grade settings" in the course gradebook And I set the field with xpath "//select[@name='report_user_showtotalsifcontainhidden']" to "Show totals including hidden items" And I press "Save changes" - And I go to "View > User report" in the course gradebook + And I navigate to "View > User report" in the course gradebook When I select "Student 1" from the "Select all or one user" singleselect And I select "User" from the "View report as" singleselect Then the following should exist in the "user-grade" table: @@ -159,7 +159,7 @@ Feature: View the user report as the student will see it And I log out And I log in as "student1" And I follow "Course 1" - And I go to "User report" in the course gradebook + And I navigate to "User report" in the course gradebook Then the following should exist in the "user-grade" table: | Grade item | Calculated weight | Grade | Range | Percentage | Contribution to course total | | Test assignment one | 50.00 % | 80.00 | 0–100 | 80.00 % | 13.33 % | @@ -183,10 +183,10 @@ Feature: View the user report as the student will see it And I log out And I log in as "teacher1" And I follow "Course 1" - And I go to "Setup > Course grade settings" in the course gradebook + And I navigate to "Setup > Course grade settings" in the course gradebook And I set the field with xpath "//select[@name='report_user_showtotalsifcontainhidden']" to "Show totals excluding hidden items" And I press "Save changes" - And I go to "View > User report" in the course gradebook + And I navigate to "View > User report" in the course gradebook When I select "Student 1" from the "Select all or one user" singleselect And I select "User" from the "View report as" singleselect Then the following should exist in the "user-grade" table: @@ -203,7 +203,7 @@ Feature: View the user report as the student will see it And I log out And I log in as "student1" And I follow "Course 1" - And I go to "User report" in the course gradebook + And I navigate to "User report" in the course gradebook Then the following should exist in the "user-grade" table: | Grade item | Calculated weight | Grade | Range | Percentage | Contribution to course total | | Test assignment one | 50.00 % | 80.00 | 0–100 | 80.00 % | 13.33 % | diff --git a/grade/report/user/tests/behat/view_usereport.feature b/grade/report/user/tests/behat/view_usereport.feature index 9c334f0bc64..c0bebe61d35 100644 --- a/grade/report/user/tests/behat/view_usereport.feature +++ b/grade/report/user/tests/behat/view_usereport.feature @@ -12,6 +12,6 @@ Feature: We can use the user report Given I log in as "admin" And I am on site homepage And I follow "Course 1" - And I go to "View > User report" in the course gradebook + And I navigate to "View > User report" in the course gradebook And I select "All users (0)" from the "Select all or one user" singleselect Then I should see "No students enrolled in this course yet" diff --git a/grade/tests/behat/behat_grade.php b/grade/tests/behat/behat_grade.php index 787af0db4a2..4a1bbe9193b 100644 --- a/grade/tests/behat/behat_grade.php +++ b/grade/tests/behat/behat_grade.php @@ -247,30 +247,17 @@ class behat_grade extends behat_base { } /** - * Navigates to the course gradebook and selects a specified item from the grade navigation tabs. + * Select the tab in the gradebook. We must be on one of the gradebook pages already. * - * Examples: - * - I go to "Setup > Gradebook setup" in the course gradebook - * - I go to "Scales" in the course gradebook - * - I go to "Letters > View" in the course gradebook - * - I go to "View > User report" in the course gradebook // for teachers - * - I go to "User report" in the course gradebook // for students - * - * @Given /^I go to "(?P(?:[^"]|\\")*)" in the course gradebook$/ - * @param string $gradepath + * @param string $gradepath examples: "View > User report", "Letters > View", "Scales" */ - public function i_go_to_in_the_course_gradebook($gradepath) { + protected function select_in_gradebook_tabs($gradepath) { $gradepath = preg_split('/\s*>\s*/', trim($gradepath)); if (count($gradepath) > 2) { - throw new DriverException('Grade path is too long (must have no more than two items separated with ">")'); + throw new coding_exception('Grade path is too long (must have no more than two items separated with ">")'); } - // If we are not on one of the gradebook pages already, follow "Grades" link in the navigation block. $xpath = '//div[contains(@class,\'grade-navigation\')]'; - if (!$this->getSession()->getPage()->findAll('xpath', $xpath)) { - $this->execute("behat_general::i_click_on_in_the", array(get_string('grades'), 'link', - get_string('pluginname', 'block_navigation'), 'block')); - } // If the first row of the grade-navigation tabs does not have $gradepath[0] as active tab, click on it. $link = '\'' . $this->escape($gradepath[0]) . '\''; @@ -290,4 +277,40 @@ class behat_grade extends behat_base { } } } + + /** + * Navigates to the course gradebook and selects a specified item from the grade navigation tabs. + * + * Examples: + * - I navigate to "Setup > Gradebook setup" in the course gradebook + * - I navigate to "Scales" in the course gradebook + * - I navigate to "Letters > View" in the course gradebook + * - I navigate to "View > User report" in the course gradebook // for teachers + * - I navigate to "User report" in the course gradebook // for students + * + * @Given /^I navigate to "(?P(?:[^"]|\\")*)" in the course gradebook$/ + * @param string $gradepath + */ + public function i_navigate_to_in_the_course_gradebook($gradepath) { + // If we are not on one of the gradebook pages already, follow "Grades" link in the navigation block. + $xpath = '//div[contains(@class,\'grade-navigation\')]'; + if (!$this->getSession()->getPage()->findAll('xpath', $xpath)) { + $this->execute("behat_general::i_click_on_in_the", array(get_string('grades'), 'link', + get_string('pluginname', 'block_navigation'), 'block')); + } + + $this->select_in_gradebook_tabs($gradepath); + } + + /** + * Navigates to the course gradebook and selects a specified item from the grade navigation tabs. + * + * @todo MDL-57282 deprecate in Moodle 3.3 + * + * @Given /^I go to "(?P(?:[^"]|\\")*)" in the course gradebook$/ + * @param string $gradepath + */ + public function i_go_to_in_the_course_gradebook($gradepath) { + $this->execute('behat_grade::i_navigate_to_in_the_course_gradebook', $gradepath); + } } diff --git a/grade/tests/behat/grade_UI_settings.feature b/grade/tests/behat/grade_UI_settings.feature index e4a30701005..5661e329b05 100644 --- a/grade/tests/behat/grade_UI_settings.feature +++ b/grade/tests/behat/grade_UI_settings.feature @@ -20,7 +20,7 @@ Feature: Site settings can be used to hide parts of the gradebook UI And I log in as "admin" And I am on site homepage And I follow "Course 1" - And I go to "View > Grader report" in the course gradebook + And I navigate to "View > Grader report" in the course gradebook And I turn editing mode on @javascript @@ -32,7 +32,7 @@ Feature: Site settings can be used to hide parts of the gradebook UI And I press "Save changes" And I am on site homepage And I follow "Course 1" - And I go to "View > Grader report" in the course gradebook + And I navigate to "View > Grader report" in the course gradebook And I click on "Edit assign Assignment1" "link" And I should not see "Minimum grade" @@ -44,7 +44,7 @@ Feature: Site settings can be used to hide parts of the gradebook UI And I press "Save changes" And I am on site homepage And I follow "Course 1" - And I go to "View > Grader report" in the course gradebook + And I navigate to "View > Grader report" in the course gradebook Then "Edit calculation for Course total" "link" should not exist @javascript @@ -55,5 +55,5 @@ Feature: Site settings can be used to hide parts of the gradebook UI And I press "Save changes" And I am on site homepage And I follow "Course 1" - And I go to "View > Grader report" in the course gradebook + And I navigate to "View > Grader report" in the course gradebook And "tr .course input[type='text']" "css_element" should not exist diff --git a/grade/tests/behat/grade_aggregation.feature b/grade/tests/behat/grade_aggregation.feature index 6eccb427cce..df80dd3d24f 100644 --- a/grade/tests/behat/grade_aggregation.feature +++ b/grade/tests/behat/grade_aggregation.feature @@ -42,7 +42,7 @@ Feature: We can use calculated grade totals And I log out And I log in as "teacher1" And I follow "Course 1" - And I go to "View > Grader report" in the course gradebook + And I navigate to "View > Grader report" in the course gradebook And I turn editing mode on And I change window size to "large" And I give the grade "60.00" to the user "Student 1" for the grade item "Test assignment one" @@ -60,7 +60,7 @@ Feature: We can use calculated grade totals And I set the following settings for grade item "Test assignment eight": | Hidden | 1 | And I change window size to "medium" - And I go to "Setup > Course grade settings" in the course gradebook + And I navigate to "Setup > Course grade settings" in the course gradebook And I set the field "Grade display type" to "Real (percentage)" And I press "Save changes" @@ -74,7 +74,7 @@ Feature: We can use calculated grade totals | Exclude empty grades | 0 | And I turn editing mode off Then I should see "30.00 (30.00 %)" in the ".course" "css_element" - And I go to "Setup > Course grade settings" in the course gradebook + And I navigate to "Setup > Course grade settings" in the course gradebook And I set the field "Hide totals if they contain hidden items" to "Show totals excluding hidden items" And I press "Save changes" And I log out @@ -96,7 +96,7 @@ Feature: We can use calculated grade totals | Item weight | 3 | And I turn editing mode off Then I should see "27.14 (27.14 %)" in the ".course" "css_element" - And I go to "Setup > Course grade settings" in the course gradebook + And I navigate to "Setup > Course grade settings" in the course gradebook And I set the field "Hide totals if they contain hidden items" to "Show totals excluding hidden items" And I press "Save changes" And I log out @@ -116,7 +116,7 @@ Feature: We can use calculated grade totals | Extra credit | 1 | And I turn editing mode off Then I should see "45.19 (45.19 %)" in the ".course" "css_element" - And I go to "Setup > Course grade settings" in the course gradebook + And I navigate to "Setup > Course grade settings" in the course gradebook And I set the field "Hide totals if they contain hidden items" to "Show totals excluding hidden items" And I press "Save changes" And I log out @@ -136,7 +136,7 @@ Feature: We can use calculated grade totals | Extra credit weight | 2 | And I turn editing mode off Then I should see "42.50 (42.50 %)" in the ".course" "css_element" - And I go to "Setup > Course grade settings" in the course gradebook + And I navigate to "Setup > Course grade settings" in the course gradebook And I set the field "Hide totals if they contain hidden items" to "Show totals excluding hidden items" And I press "Save changes" And I log out @@ -154,7 +154,7 @@ Feature: We can use calculated grade totals | Exclude empty grades | 0 | And I turn editing mode off Then I should see "26.67 (26.67 %)" in the ".course" "css_element" - And I go to "Setup > Course grade settings" in the course gradebook + And I navigate to "Setup > Course grade settings" in the course gradebook And I set the field "Hide totals if they contain hidden items" to "Show totals excluding hidden items" And I press "Save changes" And I log out @@ -176,7 +176,7 @@ Feature: We can use calculated grade totals | Hidden | 1 | And I turn editing mode off Then I should see "0.00 (0.00 %)" in the ".course" "css_element" - And I go to "Setup > Course grade settings" in the course gradebook + And I navigate to "Setup > Course grade settings" in the course gradebook And I set the field "Hide totals if they contain hidden items" to "Show totals excluding hidden items" And I press "Save changes" And I log out @@ -196,7 +196,7 @@ Feature: We can use calculated grade totals | Hidden | 1 | And I turn editing mode off Then I should see "50.00 (50.00 %)" in the ".course" "css_element" - And I go to "Setup > Course grade settings" in the course gradebook + And I navigate to "Setup > Course grade settings" in the course gradebook And I set the field "Hide totals if they contain hidden items" to "Show totals excluding hidden items" And I press "Save changes" And I log out @@ -216,7 +216,7 @@ Feature: We can use calculated grade totals | Hidden | 1 | And I turn editing mode off Then I should see "50.00 (50.00 %)" in the ".course" "css_element" - And I go to "Setup > Course grade settings" in the course gradebook + And I navigate to "Setup > Course grade settings" in the course gradebook And I set the field "Hide totals if they contain hidden items" to "Show totals excluding hidden items" And I press "Save changes" And I log out @@ -236,15 +236,15 @@ Feature: We can use calculated grade totals And the following "grade items" exist: | itemname | course | outcome | gradetype | scale | | Test outcome item one | C1 | OT1 | Scale | Test Scale | - And I go to "Setup > Gradebook setup" in the course gradebook + And I navigate to "Setup > Gradebook setup" in the course gradebook And I set the following settings for grade item "Course 1": | Aggregation | Natural | | Include outcomes in aggregation | 1 | | Exclude empty grades | 0 | - And I go to "View > Grader report" in the course gradebook + And I navigate to "View > Grader report" in the course gradebook And I give the grade "Excellent" to the user "Student 1" for the grade item "Test outcome item one" And I press "Save changes" - And I go to "Setup > Course grade settings" in the course gradebook + And I navigate to "Setup > Course grade settings" in the course gradebook And I set the field "report_overview_showtotalsifcontainhidden" to "Show totals excluding hidden items" And I set the field "report_user_showtotalsifcontainhidden" to "Show totals excluding hidden items" And I press "Save changes" @@ -257,7 +257,7 @@ Feature: We can use calculated grade totals And I log out And I log in as "teacher1" And I follow "Course 1" - And I go to "Setup > Gradebook setup" in the course gradebook + And I navigate to "Setup > Gradebook setup" in the course gradebook And I set the following settings for grade item "Test outcome item one": | Extra credit | 1 | And I log out @@ -269,7 +269,7 @@ Feature: We can use calculated grade totals And I log out And I log in as "teacher1" And I follow "Course 1" - And I go to "Setup > Gradebook setup" in the course gradebook + And I navigate to "Setup > Gradebook setup" in the course gradebook And I set the following settings for grade item "Course 1": | Aggregation | Natural | | Include outcomes in aggregation | 0 | @@ -292,7 +292,7 @@ Feature: We can use calculated grade totals And the following "grade items" exist: | itemname | course | outcome | gradetype | scale | | Test outcome item one | C1 | OT1 | Scale | Test Scale | - And I go to "Setup > Gradebook setup" in the course gradebook + And I navigate to "Setup > Gradebook setup" in the course gradebook And I set the following settings for grade item "Course 1": | Aggregation | Natural | | Include outcomes in aggregation | 1 | @@ -300,10 +300,10 @@ Feature: We can use calculated grade totals And I set the following settings for grade item "Test outcome item one": | Weight adjusted | 1 | | aggregationcoef2 | 100 | - And I go to "View > Grader report" in the course gradebook + And I navigate to "View > Grader report" in the course gradebook And I give the grade "Excellent" to the user "Student 1" for the grade item "Test outcome item one" And I press "Save changes" - And I go to "Setup > Course grade settings" in the course gradebook + And I navigate to "Setup > Course grade settings" in the course gradebook And I set the field "report_overview_showtotalsifcontainhidden" to "Show totals excluding hidden items" And I set the field "report_user_showtotalsifcontainhidden" to "Show totals excluding hidden items" And I press "Save changes" @@ -331,13 +331,13 @@ Feature: We can use calculated grade totals | Extra credit | 1 | And I turn editing mode off Then I should see "152.68 (24.43 %)" in the ".course" "css_element" - And I go to "Setup > Course grade settings" in the course gradebook + And I navigate to "Setup > Course grade settings" in the course gradebook And I set the field "report_overview_showtotalsifcontainhidden" to "Show totals excluding hidden items" And I set the field "report_user_showtotalsifcontainhidden" to "Show totals excluding hidden items" And I set the field "Show contribution to course total" to "Show" And I set the field "Show weightings" to "Show" And I press "Save changes" - And I go to "View > User report" in the course gradebook + And I navigate to "View > User report" in the course gradebook And I select "Myself" from the "View report as" singleselect And I select "Student 1" from the "Select all or one user" singleselect And the following should exist in the "user-grade" table: @@ -372,7 +372,7 @@ Feature: We can use calculated grade totals And I log in as "admin" And I am on site homepage And I follow "Course 1" - And I go to "View > Grader report" in the course gradebook + And I navigate to "View > Grader report" in the course gradebook And I turn editing mode on And I set the following settings for grade item "Sub category 1": | Aggregation | Natural | @@ -383,7 +383,7 @@ Feature: We can use calculated grade totals And I set the following settings for grade item "Course 1": | Aggregation | Natural | | Exclude empty grades | 0 | - And I go to "Setup > Gradebook setup" in the course gradebook + And I navigate to "Setup > Gradebook setup" in the course gradebook And I press "Add category" And I set the following fields to these values: | Category name | Sub category 3 | @@ -405,7 +405,7 @@ Feature: We can use calculated grade totals | Item name | Manual item 3 | | Grade category | Sub category 3 | And I press "Save changes" - And I go to "View > Grader report" in the course gradebook + And I navigate to "View > Grader report" in the course gradebook And I give the grade "60.00" to the user "Student 1" for the grade item "Manual item 1" And I give the grade "20.00" to the user "Student 1" for the grade item "Manual item 2" And I give the grade "40.00" to the user "Student 1" for the grade item "Manual item 3" @@ -439,18 +439,18 @@ Feature: We can use calculated grade totals And I press "Save changes" And I turn editing mode off And I should see "250.00 (25.25 %)" in the ".course" "css_element" - And I go to "Setup > Gradebook setup" in the course gradebook + And I navigate to "Setup > Gradebook setup" in the course gradebook And I press "Add category" And I set the following fields to these values: | Category name | Sub sub category 1 | | Parent category | Sub category 3 | And I press "Save changes" - And I go to "View > Grader report" in the course gradebook + And I navigate to "View > Grader report" in the course gradebook And I should see "270.00 (24.77 %)" in the ".course" "css_element" @javascript Scenario: Natural aggregation from the setup screen - And I go to "Setup > Gradebook setup" in the course gradebook + And I navigate to "Setup > Gradebook setup" in the course gradebook And I set the following settings for grade item "Course 1": | Aggregation | Natural | And I set the following settings for grade item "Sub category 1": @@ -512,7 +512,7 @@ Feature: We can use calculated grade totals | Aggregation | Natural | | Exclude empty grades | 0 | And I turn editing mode off - And I go to "Setup > Gradebook setup" in the course gradebook + And I navigate to "Setup > Gradebook setup" in the course gradebook And I set the field "Override weight of Test assignment one" to "1" And I set the field "Weight of Test assignment one" to "0" And I set the field "Override weight of Test assignment six" to "1" @@ -520,14 +520,14 @@ Feature: We can use calculated grade totals And I set the field "Override weight of Test assignment nine" to "1" And I set the field "Weight of Test assignment nine" to "100" And I press "Save changes" - And I go to "Setup > Course grade settings" in the course gradebook + And I navigate to "Setup > Course grade settings" in the course gradebook And I set the field "report_overview_showtotalsifcontainhidden" to "Show totals excluding hidden items" And I set the field "report_user_showtotalsifcontainhidden" to "Show totals excluding hidden items" And I set the field "Show contribution to course total" to "Show" And I set the field "Show weightings" to "Show" And I press "Save changes" Then I should see "75.00 (16.85 %)" in the ".course" "css_element" - And I go to "View > User report" in the course gradebook + And I navigate to "View > User report" in the course gradebook And I select "Myself" from the "View report as" singleselect And I select "Student 1" from the "Select all or one user" singleselect And the following should exist in the "user-grade" table: diff --git a/grade/tests/behat/grade_aggregation_changes.feature b/grade/tests/behat/grade_aggregation_changes.feature index 8ece3c16b80..89db8d5680e 100644 --- a/grade/tests/behat/grade_aggregation_changes.feature +++ b/grade/tests/behat/grade_aggregation_changes.feature @@ -35,7 +35,7 @@ Feature: Changing the aggregation of an item affects its weight and extra credit | grade_aggregations_visible | Mean of grades,Weighted mean of grades,Simple weighted mean of grades,Mean of grades (with extra credits),Median of grades,Lowest grade,Highest grade,Mode of grades,Natural | And I am on site homepage And I follow "Course 1" - And I go to "View > Grader report" in the course gradebook + And I navigate to "View > Grader report" in the course gradebook And I turn editing mode on And I follow "Edit Cat mean" And I set the following fields to these values: @@ -335,13 +335,13 @@ Feature: Changing the aggregation of an item affects its weight and extra credit @javascript Scenario: Switching grade items between categories # Move to same aggregation (Natural). - Given I go to "Setup > Gradebook setup" in the course gradebook + Given I navigate to "Setup > Gradebook setup" in the course gradebook And I set the field "Select Item a1" to "1" And I set the field "Select Item a2" to "1" And I set the field "Select Item a3" to "1" And I set the field "Select Item a4" to "1" When I select "Cat natural" from the "Move selected items to" singleselect - And I go to "View > Grader report" in the course gradebook + And I navigate to "View > Grader report" in the course gradebook And I follow "Edit Item a1" Then the field "Weight adjusted" matches value "0" And the field "Extra credit" matches value "0" @@ -361,13 +361,13 @@ Feature: Changing the aggregation of an item affects its weight and extra credit And the field "Extra credit" matches value "1" And I press "Cancel" # Move to Mean of grades (with extra credit). - And I go to "Setup > Gradebook setup" in the course gradebook + And I navigate to "Setup > Gradebook setup" in the course gradebook And I set the field "Select Item a1" to "1" And I set the field "Select Item a2" to "1" And I set the field "Select Item a3" to "1" And I set the field "Select Item a4" to "1" And I select "Cat ec" from the "Move selected items to" singleselect - And I go to "View > Grader report" in the course gradebook + And I navigate to "View > Grader report" in the course gradebook And I follow "Edit Item a1" And the field "Extra credit" matches value "0" And I press "Cancel" @@ -381,13 +381,13 @@ Feature: Changing the aggregation of an item affects its weight and extra credit And the field "Extra credit" matches value "1" And I press "Cancel" # Move to Simple weight mean of grades. - And I go to "Setup > Gradebook setup" in the course gradebook + And I navigate to "Setup > Gradebook setup" in the course gradebook And I set the field "Select Item a1" to "1" And I set the field "Select Item a2" to "1" And I set the field "Select Item a3" to "1" And I set the field "Select Item a4" to "1" And I select "Cat simple" from the "Move selected items to" singleselect - And I go to "View > Grader report" in the course gradebook + And I navigate to "View > Grader report" in the course gradebook And I follow "Edit Item a1" And the field "Extra credit" matches value "0" And I press "Cancel" @@ -401,13 +401,13 @@ Feature: Changing the aggregation of an item affects its weight and extra credit And the field "Extra credit" matches value "1" And I press "Cancel" # Move to Weighted mean of grades. - And I go to "Setup > Gradebook setup" in the course gradebook + And I navigate to "Setup > Gradebook setup" in the course gradebook And I set the field "Select Item a1" to "1" And I set the field "Select Item a2" to "1" And I set the field "Select Item a3" to "1" And I set the field "Select Item a4" to "1" And I select "Cat weighted" from the "Move selected items to" singleselect - And I go to "View > Grader report" in the course gradebook + And I navigate to "View > Grader report" in the course gradebook And I follow "Edit Item a1" And the field "Item weight" matches value "1" And I set the field "Item weight" to "2" @@ -425,14 +425,14 @@ Feature: Changing the aggregation of an item affects its weight and extra credit And I set the field "Item weight" to "11" And I press "Save changes" # Move to same (Weighted mean of grades). - And I go to "Setup > Gradebook setup" in the course gradebook + And I navigate to "Setup > Gradebook setup" in the course gradebook And I set the field "Select Item a1" to "1" And I set the field "Select Item a2" to "1" And I set the field "Select Item a3" to "1" And I set the field "Select Item a4" to "1" And I select "Cat weighted2" from the "Move selected items to" singleselect And I wait "2" seconds - And I go to "View > Grader report" in the course gradebook + And I navigate to "View > Grader report" in the course gradebook And I follow "Edit Item a1" And the field "Item weight" matches value "2" And I press "Save changes" @@ -446,13 +446,13 @@ Feature: Changing the aggregation of an item affects its weight and extra credit And the field "Item weight" matches value "11" And I press "Save changes" # Move back to Natural. - And I go to "Setup > Gradebook setup" in the course gradebook + And I navigate to "Setup > Gradebook setup" in the course gradebook And I set the field "Select Item a1" to "1" And I set the field "Select Item a2" to "1" And I set the field "Select Item a3" to "1" And I set the field "Select Item a4" to "1" And I select "Course 1" from the "Move selected items to" singleselect - And I go to "View > Grader report" in the course gradebook + And I navigate to "View > Grader report" in the course gradebook And I follow "Edit Item a1" And the field "Weight adjusted" matches value "0" And the field "Extra credit" matches value "0" diff --git a/grade/tests/behat/grade_average.feature b/grade/tests/behat/grade_average.feature index de04cee4bee..f60cfa15821 100644 --- a/grade/tests/behat/grade_average.feature +++ b/grade/tests/behat/grade_average.feature @@ -24,18 +24,18 @@ Feature: Average grades are displayed in the gradebook And I am on site homepage And I follow "Course 1" # Enable averages - And I go to "Setup > Course grade settings" in the course gradebook + And I navigate to "Setup > Course grade settings" in the course gradebook And I set the following fields to these values: | Show average | Show | And I press "Save changes" # Add a manual grade item - And I go to "Setup > Gradebook setup" in the course gradebook + And I navigate to "Setup > Gradebook setup" in the course gradebook And I press "Add grade item" And I set the following fields to these values: | Item name | Manual item 1 | And I press "Save changes" # Give all student the same grade for the manual grade item - And I go to "View > Grader report" in the course gradebook + And I navigate to "View > Grader report" in the course gradebook And I turn editing mode on And I give the grade "50.00" to the user "Student 1" for the grade item "Manual item 1" And I give the grade "50.00" to the user "Student 2" for the grade item "Manual item 1" @@ -51,7 +51,7 @@ Feature: Average grades are displayed in the gradebook Scenario: Grade a grade item and ensure the results display correctly in the gradebook # Check the admin grade table - And I go to "View > Grader report" in the course gradebook + And I navigate to "View > Grader report" in the course gradebook Then I should see "50.00" in the ".avg.r0.lastrow .c1" "css_element" Then I should see "50.00" in the ".avg.r0.lastrow .c2" "css_element" And I log out @@ -60,7 +60,7 @@ Feature: Average grades are displayed in the gradebook And I log in as "student1" And I am on site homepage And I follow "Course 1" - And I go to "User report" in the course gradebook + And I navigate to "User report" in the course gradebook Then I should see "50.00" in the ".level2.column-grade" "css_element" Then I should see "50.00" in the ".level2.column-average" "css_element" And I log out diff --git a/grade/tests/behat/grade_calculated_grade_items.feature b/grade/tests/behat/grade_calculated_grade_items.feature index 1f900b6c538..a8ecfae18cc 100644 --- a/grade/tests/behat/grade_calculated_grade_items.feature +++ b/grade/tests/behat/grade_calculated_grade_items.feature @@ -21,7 +21,7 @@ Feature: Calculated grade items can be used in the gradebook And I log in as "admin" And I am on site homepage And I follow "Course 1" - And I go to "Setup > Gradebook setup" in the course gradebook + And I navigate to "Setup > Gradebook setup" in the course gradebook @javascript Scenario: The max grade for a category item, with a calculation using Natural aggregation, can be changed @@ -38,11 +38,11 @@ Feature: Calculated grade items can be used in the gradebook | grade item 1 | gi1 | And I set the following settings for grade item "Calc cat": | Maximum grade | 50 | - And I go to "View > Grader report" in the course gradebook + And I navigate to "View > Grader report" in the course gradebook And I turn editing mode on And I give the grade "75.00" to the user "Student 1" for the grade item "grade item 1" And I press "Save changes" - And I go to "View > User report" in the course gradebook + And I navigate to "View > User report" in the course gradebook And I select "Student 1" from the "Select all or one user" singleselect And the following should exist in the "user-grade" table: | Grade item | Calculated weight | Grade | Range | Percentage | Contribution to course total | @@ -65,24 +65,24 @@ Feature: Calculated grade items can be used in the gradebook | grade item 1 | gi1 | And I set the following settings for grade item "Calc cat": | Maximum grade | 50 | - And I go to "View > Grader report" in the course gradebook + And I navigate to "View > Grader report" in the course gradebook And I press "Turn editing on" And I give the grade "75.00" to the user "Student 1" for the grade item "grade item 1" And I press "Save changes" - And I go to "View > User report" in the course gradebook + And I navigate to "View > User report" in the course gradebook And I select "Student 1" from the "Select all or one user" singleselect And the following should exist in the "user-grade" table: | Grade item | Calculated weight | Grade | Range | Percentage | Contribution to course total | | grade item 1 | - | 75.00 | 0–100 | 75.00 % | - | | Calc cat totalInclude empty grades. | 100.00 % | 37.50 | 0–50 | 75.00 % | - | | Course total | - | 37.50 | 0–50 | 75.00 % | - | - And I go to "Setup > Gradebook setup" in the course gradebook + And I navigate to "Setup > Gradebook setup" in the course gradebook And I set the following settings for grade item "Calc cat": | Maximum grade | 40 | - And I go to "View > Grader report" in the course gradebook + And I navigate to "View > Grader report" in the course gradebook And I give the grade "65.00" to the user "Student 2" for the grade item "grade item 1" And I press "Save changes" - And I go to "View > User report" in the course gradebook + And I navigate to "View > User report" in the course gradebook When I select "Student 1" from the "Select all or one user" singleselect Then the following should exist in the "user-grade" table: | Grade item | Calculated weight | Grade | Range | Percentage | Contribution to course total | @@ -95,11 +95,11 @@ Feature: Calculated grade items can be used in the gradebook | grade item 1 | - | 65.00 | 0–100 | 65.00 % | - | | Calc cat totalInclude empty grades. | 100.00 % | 32.50 | 0–40 | 81.25 % | - | | Course total | - | 32.50 | 0–40 | 81.25 % | - | - And I go to "Setup > Course grade settings" in the course gradebook + And I navigate to "Setup > Course grade settings" in the course gradebook And I set the following fields to these values: | Min and max grades used in calculation | Initial min and max grades | And I press "Save changes" - And I go to "View > User report" in the course gradebook + And I navigate to "View > User report" in the course gradebook And I select "Student 1" from the "Select all or one user" singleselect And the following should exist in the "user-grade" table: | Grade item | Calculated weight | Grade | Range | Percentage | Contribution to course total | @@ -127,29 +127,29 @@ Feature: Calculated grade items can be used in the gradebook | grade item 1 | gi1 | And I set the following settings for grade item "calc item": | Maximum grade | 50 | - And I go to "Setup > Course grade settings" in the course gradebook + And I navigate to "Setup > Course grade settings" in the course gradebook And I set the following fields to these values: | Min and max grades used in calculation | Initial min and max grades | And I press "Save changes" - And I go to "View > Grader report" in the course gradebook + And I navigate to "View > Grader report" in the course gradebook And I press "Turn editing on" And I give the grade "75.00" to the user "Student 1" for the grade item "grade item 1" And I press "Save changes" - And I go to "View > User report" in the course gradebook + And I navigate to "View > User report" in the course gradebook When I select "Student 1" from the "Select all or one user" singleselect Then the following should exist in the "user-grade" table: | Grade item | Calculated weight | Grade | Range | Percentage | Contribution to course total | | grade item 1 | 66.67 % | 75.00 | 0–100 | 75.00 % | 50.00 % | | calc item | 33.33 % | 37.50 | 0–50 | 75.00 % | 25.00 % | | Course total | - | 112.50 | 0–150 | 75.00 % | - | - And I go to "Setup > Gradebook setup" in the course gradebook + And I navigate to "Setup > Gradebook setup" in the course gradebook And I set the following settings for grade item "calc item": | Rescale existing grades | No | | Maximum grade | 40 | - And I go to "View > Grader report" in the course gradebook + And I navigate to "View > Grader report" in the course gradebook And I give the grade "65.00" to the user "Student 2" for the grade item "grade item 1" And I press "Save changes" - And I go to "View > User report" in the course gradebook + And I navigate to "View > User report" in the course gradebook And I select "Student 1" from the "Select all or one user" singleselect And the following should exist in the "user-grade" table: | Grade item | Calculated weight | Grade | Range | Percentage | Contribution to course total | diff --git a/grade/tests/behat/grade_calculated_grade_items_20150627.feature b/grade/tests/behat/grade_calculated_grade_items_20150627.feature index fdabb9e039a..e1eb3fbf969 100644 --- a/grade/tests/behat/grade_calculated_grade_items_20150627.feature +++ b/grade/tests/behat/grade_calculated_grade_items_20150627.feature @@ -22,7 +22,7 @@ Feature: Gradebook calculations for calculated grade items before the fix 201506 And I log in as "admin" And I am on site homepage And I follow "Course 1" - And I go to "Setup > Gradebook setup" in the course gradebook + And I navigate to "Setup > Gradebook setup" in the course gradebook @javascript Scenario: The max grade for a category item, with a calculation using Natural aggregation, can be changed @@ -39,11 +39,11 @@ Feature: Gradebook calculations for calculated grade items before the fix 201506 | grade item 1 | gi1 | And I set the following settings for grade item "Calc cat": | Maximum grade | 50 | - And I go to "View > Grader report" in the course gradebook + And I navigate to "View > Grader report" in the course gradebook And I turn editing mode on And I give the grade "75.00" to the user "Student 1" for the grade item "grade item 1" And I press "Save changes" - And I go to "View > User report" in the course gradebook + And I navigate to "View > User report" in the course gradebook And I select "Student 1" from the "Select all or one user" singleselect And the following should exist in the "user-grade" table: | Grade item | Calculated weight | Grade | Range | Percentage | Contribution to course total | @@ -66,24 +66,24 @@ Feature: Gradebook calculations for calculated grade items before the fix 201506 | grade item 1 | gi1 | And I set the following settings for grade item "Calc cat": | Maximum grade | 50 | - And I go to "View > Grader report" in the course gradebook + And I navigate to "View > Grader report" in the course gradebook And I turn editing mode on And I give the grade "75.00" to the user "Student 1" for the grade item "grade item 1" And I press "Save changes" - And I go to "View > User report" in the course gradebook + And I navigate to "View > User report" in the course gradebook And I select "Student 1" from the "Select all or one user" singleselect And the following should exist in the "user-grade" table: | Grade item | Calculated weight | Grade | Range | Percentage | Contribution to course total | | grade item 1 | - | 75.00 | 0–100 | 75.00 % | - | | Calc cat totalInclude empty grades. | 100.00 % | 37.50 | 0–100 | 37.50 % | - | | Course total | - | 37.50 | 0–100 | 37.50 % | - | - And I go to "Setup > Gradebook setup" in the course gradebook + And I navigate to "Setup > Gradebook setup" in the course gradebook And I set the following settings for grade item "Calc cat": | Maximum grade | 40 | - And I go to "View > Grader report" in the course gradebook + And I navigate to "View > Grader report" in the course gradebook And I give the grade "65.00" to the user "Student 2" for the grade item "grade item 1" And I press "Save changes" - And I go to "View > User report" in the course gradebook + And I navigate to "View > User report" in the course gradebook When I select "Student 1" from the "Select all or one user" singleselect Then the following should exist in the "user-grade" table: | Grade item | Calculated weight | Grade | Range | Percentage | Contribution to course total | @@ -96,11 +96,11 @@ Feature: Gradebook calculations for calculated grade items before the fix 201506 | grade item 1 | - | 65.00 | 0–100 | 65.00 % | - | | Calc cat totalInclude empty grades. | 100.00 % | 32.50 | 0–100 | 32.50 % | - | | Course total | - | 32.50 | 0–100 | 32.50 % | - | - And I go to "Setup > Course grade settings" in the course gradebook + And I navigate to "Setup > Course grade settings" in the course gradebook And I set the following fields to these values: | Min and max grades used in calculation | Initial min and max grades | And I press "Save changes" - And I go to "View > User report" in the course gradebook + And I navigate to "View > User report" in the course gradebook And I select "Student 1" from the "Select all or one user" singleselect And the following should exist in the "user-grade" table: | Grade item | Calculated weight | Grade | Range | Percentage | Contribution to course total | @@ -128,29 +128,29 @@ Feature: Gradebook calculations for calculated grade items before the fix 201506 | grade item 1 | gi1 | And I set the following settings for grade item "calc item": | Maximum grade | 50 | - And I go to "Setup > Course grade settings" in the course gradebook + And I navigate to "Setup > Course grade settings" in the course gradebook And I set the following fields to these values: | Min and max grades used in calculation | Initial min and max grades | And I press "Save changes" - And I go to "View > Grader report" in the course gradebook + And I navigate to "View > Grader report" in the course gradebook And I turn editing mode on And I give the grade "75.00" to the user "Student 1" for the grade item "grade item 1" And I press "Save changes" - And I go to "View > User report" in the course gradebook + And I navigate to "View > User report" in the course gradebook When I select "Student 1" from the "Select all or one user" singleselect Then the following should exist in the "user-grade" table: | Grade item | Calculated weight | Grade | Range | Percentage | Contribution to course total | | grade item 1 | 50.00 % | 75.00 | 0–100 | 75.00 % | 37.50 % | | calc item | 50.00 % | 37.50 | 0–100 | 37.50 % | 18.75 % | | Course total | - | 112.50 | 0–200 | 56.25 % | - | - And I go to "Setup > Gradebook setup" in the course gradebook + And I navigate to "Setup > Gradebook setup" in the course gradebook And I set the following settings for grade item "calc item": | Rescale existing grades | No | | Maximum grade | 40 | - And I go to "View > Grader report" in the course gradebook + And I navigate to "View > Grader report" in the course gradebook And I give the grade "65.00" to the user "Student 2" for the grade item "grade item 1" And I press "Save changes" - And I go to "View > User report" in the course gradebook + And I navigate to "View > User report" in the course gradebook And I select "Student 1" from the "Select all or one user" singleselect And the following should exist in the "user-grade" table: | Grade item | Calculated weight | Grade | Range | Percentage | Contribution to course total | diff --git a/grade/tests/behat/grade_calculated_weights.feature b/grade/tests/behat/grade_calculated_weights.feature index 77e5c968f45..47a30400de8 100644 --- a/grade/tests/behat/grade_calculated_weights.feature +++ b/grade/tests/behat/grade_calculated_weights.feature @@ -30,7 +30,7 @@ Feature: We can understand the gradebook user report And I log out And I log in as "teacher1" And I follow "Course 1" - And I go to "View > Grader report" in the course gradebook + And I navigate to "View > Grader report" in the course gradebook And I turn editing mode on And I give the grade "60.00" to the user "Student 1" for the grade item "Test assignment one" And I give the grade "20.00" to the user "Student 1" for the grade item "Test assignment two" @@ -39,11 +39,11 @@ Feature: We can understand the gradebook user report And I give the grade "70.00" to the user "Student 1" for the grade item "Test assignment five" And I give the grade "30.00" to the user "Student 1" for the grade item "Test assignment six" And I press "Save changes" - And I go to "Setup > Course grade settings" in the course gradebook + And I navigate to "Setup > Course grade settings" in the course gradebook And I set the field "Show weightings" to "Show" And I set the field "Show contribution to course total" to "Show" And I press "Save changes" - And I go to "Setup > Gradebook setup" in the course gradebook + And I navigate to "Setup > Gradebook setup" in the course gradebook And I press "Add category" And I set the field "Category name" to "Sub category" And I press "Save changes" @@ -59,7 +59,7 @@ Feature: We can understand the gradebook user report Scenario: Mean of grades aggregation And I set the following settings for grade item "Course 1": | Aggregation | Mean of grades | - And I go to "View > User report" in the course gradebook + And I navigate to "View > User report" in the course gradebook And I set the field "Select all or one user" to "Student 1" # Check the values in the weights column. @@ -84,7 +84,7 @@ Feature: We can understand the gradebook user report | Item weight | 1.0 | And I set the following settings for grade item "Sub category": | Item weight | 1.0 | - And I go to "View > User report" in the course gradebook + And I navigate to "View > User report" in the course gradebook And I set the field "Select all or one user" to "Student 1" # Check the values in the weights column. @@ -105,7 +105,7 @@ Feature: We can understand the gradebook user report | Aggregation | Simple weighted mean of grades | And I set the following settings for grade item "Test assignment three": | Extra credit | 1 | - And I go to "View > User report" in the course gradebook + And I navigate to "View > User report" in the course gradebook And I set the field "Select all or one user" to "Student 1" # Check the values in the weights column. @@ -124,7 +124,7 @@ Feature: We can understand the gradebook user report | Aggregation | Mean of grades (with extra credits) | And I set the following settings for grade item "Test assignment three": | Extra credit weight | 1.0 | - And I go to "View > User report" in the course gradebook + And I navigate to "View > User report" in the course gradebook And I set the field "Select all or one user" to "Student 1" # Check the values in the weights column. @@ -141,7 +141,7 @@ Feature: We can understand the gradebook user report Scenario: Median of grades aggregation And I set the following settings for grade item "Course 1": | Aggregation | Median of grades | - And I go to "View > User report" in the course gradebook + And I navigate to "View > User report" in the course gradebook And I set the field "Select all or one user" to "Student 1" # Check the values in the weights column. @@ -158,7 +158,7 @@ Feature: We can understand the gradebook user report Scenario: Lowest grade aggregation And I set the following settings for grade item "Course 1": | Aggregation | Lowest grade | - And I go to "View > User report" in the course gradebook + And I navigate to "View > User report" in the course gradebook And I set the field "Select all or one user" to "Student 1" # Check the values in the weights column. @@ -175,7 +175,7 @@ Feature: We can understand the gradebook user report Scenario: Highest grade aggregation And I set the following settings for grade item "Course 1": | Aggregation | Highest grade | - And I go to "View > User report" in the course gradebook + And I navigate to "View > User report" in the course gradebook And I set the field "Select all or one user" to "Student 1" # Check the values in the weights column. @@ -192,7 +192,7 @@ Feature: We can understand the gradebook user report Scenario: Mode of grades aggregation And I set the following settings for grade item "Course 1": | Aggregation | Mode of grades | - And I go to "View > User report" in the course gradebook + And I navigate to "View > User report" in the course gradebook And I set the field "Select all or one user" to "Student 1" # Check the values in the weights column. @@ -213,7 +213,7 @@ Feature: We can understand the gradebook user report | Aggregation | Weighted mean of grades | And I set the following settings for grade item "Test assignment three": | Extra credit | 1 | - And I go to "View > User report" in the course gradebook + And I navigate to "View > User report" in the course gradebook And I set the field "Select all or one user" to "Student 1" # Check the values in the weights column. @@ -232,7 +232,7 @@ Feature: We can understand the gradebook user report Scenario: View user report with natural aggregation And I set the following settings for grade item "Test assignment three": | Extra credit | 1 | - And I go to "View > User report" in the course gradebook + And I navigate to "View > User report" in the course gradebook And I set the field "Select all or one user" to "Student 1" # Check the values in the weights column. diff --git a/grade/tests/behat/grade_category_validation.feature b/grade/tests/behat/grade_category_validation.feature index 7305fa7a668..74cff6208a5 100644 --- a/grade/tests/behat/grade_category_validation.feature +++ b/grade/tests/behat/grade_category_validation.feature @@ -34,7 +34,7 @@ Feature: Editing a grade item And I log in as "teacher1" And I am on site homepage And I follow "Course 1" - And I go to "Setup > Gradebook setup" in the course gradebook + And I navigate to "Setup > Gradebook setup" in the course gradebook And I press "Add category" And I set the following fields to these values: | Category name | Cat 1 | @@ -69,11 +69,11 @@ Feature: Editing a grade item And I should not see "You cannot change the scale, as grades already exist for this item" Scenario: Attempting to change a category item's grade type when overridden grades already exist - Given I go to "View > Grader report" in the course gradebook + Given I navigate to "View > Grader report" in the course gradebook And I turn editing mode on And I give the grade "20.00" to the user "Student 1" for the grade item "Cat 1 total" And I press "Save changes" - And I go to "Setup > Gradebook setup" in the course gradebook + And I navigate to "Setup > Gradebook setup" in the course gradebook And I click on "Edit" "link" in the "Cat 1" "table_row" When I click on "Edit settings" "link" in the "Cat 1" "table_row" Then I should see "This category has associated grade items which have been overridden. Therefore some grades have already been awarded, so the grade type cannot be changed. If you wish to change the maximum grade, you must first choose whether or not to rescale existing grades." @@ -85,22 +85,22 @@ Feature: Editing a grade item And I set the field "Grade type" to "Scale" And I set the field "Scale" to "ABCDEF" And I press "Save changes" - And I go to "View > Grader report" in the course gradebook + And I navigate to "View > Grader report" in the course gradebook And I turn editing mode on And I give the grade "C" to the user "Student 1" for the grade item "Cat 1 total" And I press "Save changes" - And I go to "Setup > Gradebook setup" in the course gradebook + And I navigate to "Setup > Gradebook setup" in the course gradebook And I click on "Edit" "link" in the "Cat 1" "table_row" When I click on "Edit settings" "link" in the "Cat 1" "table_row" Then I should see "This category has associated grade items which have been overridden. Therefore some grades have already been awarded, so the grade type and scale cannot be changed." And "//div[contains(concat(' ', normalize-space(@class), ' '), 'felement') and contains(text(), 'ABCDEF')]" "xpath_element" should exist Scenario: Attempting to change a category item's maximum grade when no rescaling option has been chosen - Given I go to "View > Grader report" in the course gradebook + Given I navigate to "View > Grader report" in the course gradebook And I turn editing mode on And I give the grade "20.00" to the user "Student 1" for the grade item "Cat 1 total" And I press "Save changes" - And I go to "Setup > Gradebook setup" in the course gradebook + And I navigate to "Setup > Gradebook setup" in the course gradebook And I click on "Edit" "link" in the "Cat 1" "table_row" And I click on "Edit settings" "link" in the "Cat 1" "table_row" And I set the field "Maximum grade" to "50" diff --git a/grade/tests/behat/grade_contribution_with_extra_credit.feature b/grade/tests/behat/grade_contribution_with_extra_credit.feature index 0d89bcca010..05311952dec 100644 --- a/grade/tests/behat/grade_contribution_with_extra_credit.feature +++ b/grade/tests/behat/grade_contribution_with_extra_credit.feature @@ -21,7 +21,7 @@ Feature: Extra credit contributions are normalised when going out of bounds | grade_aggregations_visible | Simple weighted mean of grades,Mean of grades (with extra credits),Natural | And I am on site homepage And I follow "Course 1" - And I go to "Setup > Gradebook setup" in the course gradebook + And I navigate to "Setup > Gradebook setup" in the course gradebook And I press "Add grade item" And I set the following fields to these values: | Item name | Manual item 1 | @@ -39,14 +39,14 @@ Feature: Extra credit contributions are normalised when going out of bounds And I set the following fields to these values: | Item name | Manual item 4 | And I press "Save changes" - And I go to "Setup > Course grade settings" in the course gradebook + And I navigate to "Setup > Course grade settings" in the course gradebook And I set the field "Show weighting" to "Show" And I set the field "Show contribution to course total" to "Show" And I press "Save changes" And I log out And I log in as "teacher1" And I follow "Course 1" - And I go to "View > Grader report" in the course gradebook + And I navigate to "View > Grader report" in the course gradebook And I turn editing mode on And I give the grade "80.00" to the user "Student 1" for the grade item "Manual item 1" And I give the grade "10.00" to the user "Student 1" for the grade item "Manual item 2" @@ -55,7 +55,7 @@ Feature: Extra credit contributions are normalised when going out of bounds And I press "Save changes" Scenario Outline: The contribution of extra credit items is normalised - Given I go to "Setup > Gradebook setup" in the course gradebook + Given I navigate to "Setup > Gradebook setup" in the course gradebook When I set the following settings for grade item "Course 1": | Aggregation | | And I set the following settings for grade item "Manual item 2": @@ -64,7 +64,7 @@ Feature: Extra credit contributions are normalised when going out of bounds | Extra credit | 1 | And I set the following settings for grade item "Manual item 4": | Extra credit | 1 | - And I go to "View > User report" in the course gradebook + And 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: | Grade item | Calculated weight | Grade | Contribution to course total | diff --git a/grade/tests/behat/grade_grade_minmax_change.feature b/grade/tests/behat/grade_grade_minmax_change.feature index 3c986930b83..16d6abd0430 100644 --- a/grade/tests/behat/grade_grade_minmax_change.feature +++ b/grade/tests/behat/grade_grade_minmax_change.feature @@ -22,33 +22,33 @@ Feature: We can change the maximum and minimum number of points for manual items And I log in as "teacher1" And I am on site homepage And I follow "Course 1" - And I go to "Setup > Gradebook setup" in the course gradebook + And I navigate to "Setup > Gradebook setup" in the course gradebook And I press "Add grade item" And I set the following fields to these values: | Item name | Manual item 1 | | Minimum grade | 0 | | Maximum grade | 100 | And I press "Save changes" - And I go to "Setup > Course grade settings" in the course gradebook + And I navigate to "Setup > Course grade settings" in the course gradebook And I set the field "Show weightings" to "Show" And I set the field "Show contribution to course total" to "Show" And I press "Save changes" Scenario: Change maximum number of points on a graded item. And I follow "Course 1" - And I go to "View > Grader report" in the course gradebook + And I navigate to "View > Grader report" in the course gradebook And I turn editing mode on And I give the grade "10.00" to the user "Student 1" for the grade item "Manual item 1" And I give the grade "8.00" to the user "Student 2" for the grade item "Manual item 1" And I press "Save changes" - When I go to "Setup > Gradebook setup" in the course gradebook + When I navigate to "Setup > Gradebook setup" in the course gradebook And I click on "Edit" "link" in the "Manual item 1" "table_row" And I click on "Edit settings" "link" in the "Manual item 1" "table_row" And I set the following fields to these values: | Maximum grade | 10 | | Rescale existing grades | No | And I press "Save changes" - And I go to "View > User report" in the course gradebook + And I navigate to "View > User report" in the course gradebook And I select "Student 1" from the "Select all or one user" singleselect Then the following should exist in the "user-grade" table: | Grade item | Calculated weight | Grade | Contribution to course total | @@ -57,14 +57,14 @@ Feature: We can change the maximum and minimum number of points for manual items And the following should exist in the "user-grade" table: | Grade item | Calculated weight | Grade | Contribution to course total | | Manual item 1 | 100.00 % | 8.00 | 80.00 % | - And I go to "Setup > Gradebook setup" in the course gradebook + And I navigate to "Setup > Gradebook setup" in the course gradebook And I click on "Edit" "link" in the "Manual item 1" "table_row" And I click on "Edit settings" "link" in the "Manual item 1" "table_row" And I set the following fields to these values: | Maximum grade | 20 | | Rescale existing grades | Yes | And I press "Save changes" - And I go to "View > User report" in the course gradebook + And I navigate to "View > User report" in the course gradebook And I select "Student 1" from the "Select all or one user" singleselect And the following should exist in the "user-grade" table: | Grade item | Calculated weight | Grade | Contribution to course total | diff --git a/grade/tests/behat/grade_hidden_items.feature b/grade/tests/behat/grade_hidden_items.feature index b83ab7f9cdb..fd7aa450f2d 100644 --- a/grade/tests/behat/grade_hidden_items.feature +++ b/grade/tests/behat/grade_hidden_items.feature @@ -35,7 +35,7 @@ Feature: Student and teacher's view of aggregated grade items is consistent when When I log out And I log in as "teacher1" And I follow "Course 1" - And I go to "View > Grader report" in the course gradebook + And I navigate to "View > Grader report" in the course gradebook And I turn editing mode on And I give the grade "50.00" to the user "Student 1" for the grade item "Test assignment one" And I give the grade "50.00" to the user "Student 1" for the grade item "Test assignment three" @@ -44,7 +44,7 @@ Feature: Student and teacher's view of aggregated grade items is consistent when | Hidden | 1 | And I press "Save changes" And I follow "Course 1" - And I go to "View > User report" in the course gradebook + And I navigate to "View > User report" in the course gradebook And I select "Myself" from the "View report as" singleselect And I select "Student 1" from the "Select all or one user" singleselect Then the following should exist in the "user-grade" table: @@ -56,7 +56,7 @@ Feature: Student and teacher's view of aggregated grade items is consistent when When I log out And I log in as "student1" And I follow "Course 1" - And I go to "User report" in the course gradebook + And I navigate to "User report" in the course gradebook Then the following should exist in the "user-grade" table: | Grade item | Calculated weight | Grade | Range | Percentage | Contribution to course total | | Test assignment one | 100.00 % | 50.00 | 0–100 | 50.00 % | 25.00 % | diff --git a/grade/tests/behat/grade_item_validation.feature b/grade/tests/behat/grade_item_validation.feature index e9721b8ff91..fa38d4a30aa 100644 --- a/grade/tests/behat/grade_item_validation.feature +++ b/grade/tests/behat/grade_item_validation.feature @@ -30,7 +30,7 @@ Feature: Editing a grade item And I press "Save changes" And I am on site homepage And I follow "Course 1" - And I go to "Setup > Gradebook setup" in the course gradebook + And I navigate to "Setup > Gradebook setup" in the course gradebook And I press "Add grade item" And I set the following fields to these values: | Item name | MI 1 | @@ -54,11 +54,11 @@ Feature: Editing a grade item And I should not see "You cannot change the scale, as grades already exist for this item" Scenario: Attempting to change a manual item's grade type when grades already exist - Given I go to "View > Grader report" in the course gradebook + Given I navigate to "View > Grader report" in the course gradebook And I turn editing mode on And I give the grade "20.00" to the user "Student 1" for the grade item "MI 1" And I press "Save changes" - And I go to "Setup > Gradebook setup" in the course gradebook + And I navigate to "Setup > Gradebook setup" in the course gradebook And I click on "Edit" "link" in the "MI 1" "table_row" When I click on "Edit settings" "link" in the "MI 1" "table_row" Then I should see "Some grades have already been awarded, so the grade type cannot be changed. If you wish to change the maximum grade, you must first choose whether or not to rescale existing grades." @@ -70,22 +70,22 @@ Feature: Editing a grade item And I set the field "Grade type" to "Scale" And I set the field "Scale" to "ABCDEF" And I press "Save changes" - And I go to "View > Grader report" in the course gradebook + And I navigate to "View > Grader report" in the course gradebook And I turn editing mode on And I give the grade "C" to the user "Student 1" for the grade item "MI 1" And I press "Save changes" - And I go to "Setup > Gradebook setup" in the course gradebook + And I navigate to "Setup > Gradebook setup" in the course gradebook And I click on "Edit" "link" in the "MI 1" "table_row" When I click on "Edit settings" "link" in the "MI 1" "table_row" Then I should see "Some grades have already been awarded, so the grade type and scale cannot be changed." And "//div[contains(concat(' ', normalize-space(@class), ' '), 'felement') and contains(text(), 'ABCDEF')]" "xpath_element" should exist Scenario: Attempting to change a manual item's maximum grade when no rescaling option has been chosen - Given I go to "View > Grader report" in the course gradebook + Given I navigate to "View > Grader report" in the course gradebook And I turn editing mode on And I give the grade "20.00" to the user "Student 1" for the grade item "MI 1" And I press "Save changes" - And I go to "Setup > Gradebook setup" in the course gradebook + And I navigate to "Setup > Gradebook setup" in the course gradebook And I click on "Edit" "link" in the "MI 1" "table_row" And I click on "Edit settings" "link" in the "MI 1" "table_row" And I set the field "Maximum grade" to "50" diff --git a/grade/tests/behat/grade_letter_boundary.feature b/grade/tests/behat/grade_letter_boundary.feature index 09bed65e56f..33466731920 100644 --- a/grade/tests/behat/grade_letter_boundary.feature +++ b/grade/tests/behat/grade_letter_boundary.feature @@ -22,17 +22,17 @@ Feature: We can customise the letter boundary of a course. | assign | C1 | a1 | Test assignment one | Submit something! | 100 | And I log in as "teacher1" And I follow "Course 1" - And I go to "Setup > Course grade settings" in the course gradebook + And I navigate to "Setup > Course grade settings" in the course gradebook And I set the following fields to these values: | Grade display type | Letter | And I press "Save changes" - And I go to "Letters" in the course gradebook + And I navigate to "Letters" in the course gradebook And I follow "Edit grade letters" And I set the following fields to these values: | id_override | 1 | | id_gradeboundary10 | 57 | And I press "Save changes" - And I go to "View > Grader report" in the course gradebook + And I navigate to "View > Grader report" in the course gradebook And I press "Turn editing on" And I give the grade "57" to the user "Student 1" for the grade item "Test assignment one" And I press "Save changes" diff --git a/grade/tests/behat/grade_letter_boundary_20160518.feature b/grade/tests/behat/grade_letter_boundary_20160518.feature index c2f13daaeb7..072c32df802 100644 --- a/grade/tests/behat/grade_letter_boundary_20160518.feature +++ b/grade/tests/behat/grade_letter_boundary_20160518.feature @@ -23,17 +23,17 @@ Feature: We can customise the letter boundary of a course. | assign | C1 | a1 | Test assignment one | Submit something! | 100 | And I log in as "teacher1" And I follow "Course 1" - And I go to "Setup > Course grade settings" in the course gradebook + And I navigate to "Setup > Course grade settings" in the course gradebook And I set the following fields to these values: | Grade display type | Letter | And I press "Save changes" - And I go to "Letters" in the course gradebook + And I navigate to "Letters" in the course gradebook And I follow "Edit grade letters" And I set the following fields to these values: | id_override | 1 | | id_gradeboundary10 | 57 | And I press "Save changes" - And I go to "View > Grader report" in the course gradebook + And I navigate to "View > Grader report" in the course gradebook And I press "Turn editing on" And I give the grade "57" to the user "Student 1" for the grade item "Test assignment one" And I press "Save changes" diff --git a/grade/tests/behat/grade_mingrade.feature b/grade/tests/behat/grade_mingrade.feature index a02d38c7a9a..0011f2086e4 100644 --- a/grade/tests/behat/grade_mingrade.feature +++ b/grade/tests/behat/grade_mingrade.feature @@ -27,7 +27,7 @@ Feature: We can use a minimum grade different than zero | grade_aggregations_visible | Mean of grades,Weighted mean of grades,Simple weighted mean of grades,Mean of grades (with extra credits),Median of grades,Lowest grade,Highest grade,Mode of grades,Natural | And I am on site homepage And I follow "Course 1" - And I go to "Setup > Gradebook setup" in the course gradebook + And I navigate to "Setup > Gradebook setup" in the course gradebook And I press "Add grade item" And I set the following fields to these values: | Item name | Manual item 1 | @@ -65,14 +65,14 @@ Feature: We can use a minimum grade different than zero | Minimum grade | 50 | | Grade category | Sub category 2 | And I press "Save changes" - And I go to "Setup > Course grade settings" in the course gradebook + And I navigate to "Setup > Course grade settings" in the course gradebook And I set the field "Show weightings" to "Show" And I set the field "Show contribution to course total" to "Show" And I press "Save changes" @javascript Scenario: Natural aggregation with negative and positive grade - And I go to "Setup > Gradebook setup" in the course gradebook + And I navigate to "Setup > Gradebook setup" in the course gradebook And I set the following settings for grade item "Sub category 1": | Aggregation | Natural | | Exclude empty grades | 0 | @@ -85,7 +85,7 @@ Feature: We can use a minimum grade different than zero And I log out And I log in as "teacher1" And I follow "Course 1" - And I go to "View > Grader report" in the course gradebook + And I navigate to "View > Grader report" in the course gradebook And I turn editing mode on When I give the grade "-25.00" to the user "Student 1" for the grade item "Manual item 1" And I give the grade "50.00" to the user "Student 1" for the grade item "Manual item 2" @@ -100,7 +100,7 @@ Feature: We can use a minimum grade different than zero And I give the grade "0.00" to the user "Student 2" for the grade item "Manual item 5" And I give the grade "0.00" to the user "Student 2" for the grade item "Manual item 6" And I press "Save changes" - And I go to "View > User report" in the course gradebook + And 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: | Grade item | Calculated weight | Grade | Contribution to course total | diff --git a/grade/tests/behat/grade_minmax.feature b/grade/tests/behat/grade_minmax.feature index 756a55e6fc7..13f1b756c4a 100644 --- a/grade/tests/behat/grade_minmax.feature +++ b/grade/tests/behat/grade_minmax.feature @@ -26,7 +26,7 @@ Feature: We can choose what min or max grade to use when aggregating grades. | grade_minmaxtouse | Min and max grades as specified in grade item settings | And I am on site homepage And I follow "C1" - And I go to "Setup > Gradebook setup" in the course gradebook + And I navigate to "Setup > Gradebook setup" in the course gradebook And I press "Add grade item" And I set the following fields to these values: | Item name | MI 1 | @@ -56,18 +56,18 @@ Feature: We can choose what min or max grade to use when aggregating grades. | MI 1 | mi1 | | MI 2 | mi2 | | MI 3 | mi3 | - And I go to "Setup > Course grade settings" in the course gradebook + And I navigate to "Setup > Course grade settings" in the course gradebook And I set the field "Min and max grades used in calculation" to "Default (Min and max grades as specified in grade item settings)" And I set the field "Show weightings" to "Show" And I set the field "Show contribution to course total" to "Show" And I press "Save changes" - And I go to "Setup > Gradebook setup" in the course gradebook + And I navigate to "Setup > Gradebook setup" in the course gradebook And I set the following settings for grade item "CAT1": | Aggregation | Natural | And I log out And I log in as "teacher1" And I follow "C1" - And I go to "View > Grader report" in the course gradebook + And I navigate to "View > Grader report" in the course gradebook And I turn editing mode on And I give the grade "75.00" to the user "Student 1" for the grade item "MI 1" And I give the grade "25.00" to the user "Student 1" for the grade item "MI 2" @@ -76,7 +76,7 @@ Feature: We can choose what min or max grade to use when aggregating grades. And I give the grade "20.00" to the user "Student 2" for the grade item "MI 1" And I give the grade "10.00" to the user "Student 2" for the grade item "MI 3" And I press "Save changes" - And I go to "View > User report" in the course gradebook + And I navigate to "View > User report" in the course gradebook And I select "Student 1" from the "Select all or one user" singleselect And the following should exist in the "user-grade" table: | Grade item | Calculated weight | Grade | Range | Percentage | Contribution to course total | @@ -97,7 +97,7 @@ Feature: We can choose what min or max grade to use when aggregating grades. | MI 5 | 33.33 % | 30.00 | 0–100 | 30.00 % | 10.00 % | | CAT1 total | 33.33 % | 10.00 | 0–100 | 10.00 % | - | | Course total | - | 60.00 | 0–300 | 20.00 % | - | - And I go to "Setup > Gradebook setup" in the course gradebook + And I navigate to "Setup > Gradebook setup" in the course gradebook And I set the following settings for grade item "MI 1": | Maximum grade | 50.00 | | Minimum grade | 5.00 | @@ -106,7 +106,7 @@ Feature: We can choose what min or max grade to use when aggregating grades. | Maximum grade | 50.00 | | Minimum grade | 5.00 | | Rescale existing grades | No | - And I go to "View > User report" in the course gradebook + And I navigate to "View > User report" in the course gradebook And I select "Student 1" from the "Select all or one user" singleselect And the following should exist in the "user-grade" table: | Grade item | Calculated weight | Grade | Range | Percentage | Contribution to course total | @@ -127,11 +127,11 @@ Feature: We can choose what min or max grade to use when aggregating grades. | MI 5 | 50.00 % | 30.00 | 0–100 | 30.00 % | 15.00 % | | CAT1 total | 25.00 % | 10.00 | 0–50 | 20.00 % | - | | Course total | - | 60.00 | 0–200 | 30.00 % | - | - And I go to "Setup > Gradebook setup" in the course gradebook + And I navigate to "Setup > Gradebook setup" in the course gradebook And I set the following settings for grade item "MI 5": | Maximum grade | 200.00 | | Rescale existing grades | No | - And I go to "View > User report" in the course gradebook + And I navigate to "View > User report" in the course gradebook And I select "Student 1" from the "Select all or one user" singleselect And the following should exist in the "user-grade" table: | Grade item | Calculated weight | Grade | Range | Percentage | Contribution to course total | @@ -142,10 +142,10 @@ Feature: We can choose what min or max grade to use when aggregating grades. | Grade item | Calculated weight | Grade | Range | Percentage | Contribution to course total | | MI 5 | 66.67 % | 30.00 | 0–200 | 15.00 % | 10.00 % | | Course total | - | 60.00 | 0–300 | 20.00 % | - | - And I go to "Setup > Course grade settings" in the course gradebook + And I navigate to "Setup > Course grade settings" in the course gradebook When I set the field "Min and max grades used in calculation" to "Initial min and max grades" And I press "Save changes" - And I go to "View > User report" in the course gradebook + And I navigate to "View > User report" in the course gradebook And I select "Student 1" from the "Select all or one user" singleselect Then the following should exist in the "user-grade" table: | Grade item | Calculated weight | Grade | Range | Percentage | Contribution to course total | diff --git a/grade/tests/behat/grade_natural_exclude_empty.feature b/grade/tests/behat/grade_natural_exclude_empty.feature index ae5e92c7b8d..37f411d4e56 100644 --- a/grade/tests/behat/grade_natural_exclude_empty.feature +++ b/grade/tests/behat/grade_natural_exclude_empty.feature @@ -25,7 +25,7 @@ Feature: Weights in natural aggregation are adjusted if the items are excluded f | assign | C1 | a5 | Test assignment five (extra) | x | 10 | And I log in as "teacher1" And I follow "Course 1" - And I go to "Setup > Gradebook setup" in the course gradebook + And I navigate to "Setup > Gradebook setup" in the course gradebook And I set the following settings for grade item "Test assignment four (extra)": | Extra credit | 1 | And I set the following settings for grade item "Test assignment five (extra)": @@ -33,7 +33,7 @@ Feature: Weights in natural aggregation are adjusted if the items are excluded f @javascript Scenario: No weights are overridden and student has all grades present - When I go to "View > Grader report" in the course gradebook + When I navigate to "View > Grader report" in the course gradebook And I turn editing mode on And I give the grade "80.00" to the user "Student 1" for the grade item "Test assignment one" And I give the grade "30.00" to the user "Student 1" for the grade item "Test assignment two" @@ -41,7 +41,7 @@ Feature: Weights in natural aggregation are adjusted if the items are excluded f And I give the grade "10.00" to the user "Student 1" for the grade item "Test assignment four (extra)" And I give the grade "8.00" to the user "Student 1" for the grade item "Test assignment five (extra)" And I press "Save changes" - And I go to "View > User report" in the course gradebook + And 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: | Grade item | Calculated weight | Grade | Range | Percentage | Contribution to course total | @@ -55,14 +55,14 @@ Feature: Weights in natural aggregation are adjusted if the items are excluded f @javascript Scenario: No weights are overridden, student has some grades present - When I go to "View > Grader report" in the course gradebook + When I navigate to "View > Grader report" in the course gradebook And I turn editing mode on And I give the grade "80.00" to the user "Student 1" for the grade item "Test assignment one" And I give the grade "30.00" to the user "Student 1" for the grade item "Test assignment two" And I give the grade "10.00" to the user "Student 1" for the grade item "Test assignment four (extra)" And I give the grade "8.00" to the user "Student 1" for the grade item "Test assignment five (extra)" And I press "Save changes" - And I go to "View > User report" in the course gradebook + And 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: | Grade item | Calculated weight | Grade | Range | Percentage | Contribution to course total | @@ -76,12 +76,12 @@ Feature: Weights in natural aggregation are adjusted if the items are excluded f @javascript Scenario: No weights are overridden, student has none grades present except for extra credit - When I go to "View > Grader report" in the course gradebook + When I navigate to "View > Grader report" in the course gradebook And I turn editing mode on And I give the grade "10.00" to the user "Student 1" for the grade item "Test assignment four (extra)" And I give the grade "8.00" to the user "Student 1" for the grade item "Test assignment five (extra)" And I press "Save changes" - And I go to "View > User report" in the course gradebook + And 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: | Grade item | Calculated weight | Grade | Range | Percentage | Contribution to course total | @@ -101,14 +101,14 @@ Feature: Weights in natural aggregation are adjusted if the items are excluded f | Extra credit | 1 | And I set the following settings for grade item "Test assignment three": | Extra credit | 1 | - When I go to "View > Grader report" in the course gradebook + When I navigate to "View > Grader report" in the course gradebook And I turn editing mode on And I give the grade "80.00" to the user "Student 1" for the grade item "Test assignment one" And I give the grade "30.00" to the user "Student 1" for the grade item "Test assignment two" And I give the grade "10.00" to the user "Student 1" for the grade item "Test assignment four (extra)" And I give the grade "8.00" to the user "Student 1" for the grade item "Test assignment five (extra)" And I press "Save changes" - And I go to "View > User report" in the course gradebook + And 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: | Grade item | Calculated weight | Grade | Range | Percentage | Contribution to course total | @@ -125,7 +125,7 @@ Feature: Weights in natural aggregation are adjusted if the items are excluded f When I set the field "Override weight of Test assignment one" to "1" And I set the field "Weight of Test assignment one" to "50" And I press "Save changes" - And I go to "View > Grader report" in the course gradebook + And I navigate to "View > Grader report" in the course gradebook And I turn editing mode on And I give the grade "80.00" to the user "Student 1" for the grade item "Test assignment one" And I give the grade "30.00" to the user "Student 1" for the grade item "Test assignment two" @@ -133,7 +133,7 @@ Feature: Weights in natural aggregation are adjusted if the items are excluded f And I give the grade "10.00" to the user "Student 1" for the grade item "Test assignment four (extra)" And I give the grade "8.00" to the user "Student 1" for the grade item "Test assignment five (extra)" And I press "Save changes" - And I go to "View > User report" in the course gradebook + And 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: | Grade item | Calculated weight | Grade | Range | Percentage | Contribution to course total | @@ -150,14 +150,14 @@ Feature: Weights in natural aggregation are adjusted if the items are excluded f When I set the field "Override weight of Test assignment one" to "1" And I set the field "Weight of Test assignment one" to "50" And I press "Save changes" - And I go to "View > Grader report" in the course gradebook + And I navigate to "View > Grader report" in the course gradebook And I turn editing mode on And I give the grade "80.00" to the user "Student 1" for the grade item "Test assignment one" And I give the grade "30.00" to the user "Student 1" for the grade item "Test assignment two" And I give the grade "10.00" to the user "Student 1" for the grade item "Test assignment four (extra)" And I give the grade "8.00" to the user "Student 1" for the grade item "Test assignment five (extra)" And I press "Save changes" - And I go to "View > User report" in the course gradebook + And 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: | Grade item | Calculated weight | Grade | Range | Percentage | Contribution to course total | @@ -174,12 +174,12 @@ Feature: Weights in natural aggregation are adjusted if the items are excluded f When I set the field "Override weight of Test assignment one" to "1" And I set the field "Weight of Test assignment one" to "50" And I press "Save changes" - And I go to "View > Grader report" in the course gradebook + And I navigate to "View > Grader report" in the course gradebook And I turn editing mode on And I give the grade "10.00" to the user "Student 1" for the grade item "Test assignment four (extra)" And I give the grade "8.00" to the user "Student 1" for the grade item "Test assignment five (extra)" And I press "Save changes" - And I go to "View > User report" in the course gradebook + And 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: | Grade item | Calculated weight | Grade | Range | Percentage | Contribution to course total | @@ -198,7 +198,7 @@ Feature: Weights in natural aggregation are adjusted if the items are excluded f And I set the field "Override weight of Test assignment four (extra)" to "1" And I set the field "Weight of Test assignment four (extra)" to "10" And I press "Save changes" - And I go to "View > Grader report" in the course gradebook + And I navigate to "View > Grader report" in the course gradebook And I turn editing mode on And I give the grade "80.00" to the user "Student 1" for the grade item "Test assignment one" And I give the grade "30.00" to the user "Student 1" for the grade item "Test assignment two" @@ -206,7 +206,7 @@ Feature: Weights in natural aggregation are adjusted if the items are excluded f And I give the grade "10.00" to the user "Student 1" for the grade item "Test assignment four (extra)" And I give the grade "8.00" to the user "Student 1" for the grade item "Test assignment five (extra)" And I press "Save changes" - And I go to "View > User report" in the course gradebook + And 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: | Grade item | Calculated weight | Grade | Range | Percentage | Contribution to course total | @@ -225,14 +225,14 @@ Feature: Weights in natural aggregation are adjusted if the items are excluded f And I set the field "Override weight of Test assignment four (extra)" to "1" And I set the field "Weight of Test assignment four (extra)" to "10" And I press "Save changes" - And I go to "View > Grader report" in the course gradebook + And I navigate to "View > Grader report" in the course gradebook And I turn editing mode on And I give the grade "80.00" to the user "Student 1" for the grade item "Test assignment one" And I give the grade "30.00" to the user "Student 1" for the grade item "Test assignment two" And I give the grade "10.00" to the user "Student 1" for the grade item "Test assignment four (extra)" And I give the grade "8.00" to the user "Student 1" for the grade item "Test assignment five (extra)" And I press "Save changes" - And I go to "View > User report" in the course gradebook + And 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: | Grade item | Calculated weight | Grade | Range | Percentage | Contribution to course total | @@ -251,12 +251,12 @@ Feature: Weights in natural aggregation are adjusted if the items are excluded f And I set the field "Override weight of Test assignment four (extra)" to "1" And I set the field "Weight of Test assignment four (extra)" to "10" And I press "Save changes" - And I go to "View > Grader report" in the course gradebook + And I navigate to "View > Grader report" in the course gradebook And I turn editing mode on And I give the grade "10.00" to the user "Student 1" for the grade item "Test assignment four (extra)" And I give the grade "8.00" to the user "Student 1" for the grade item "Test assignment five (extra)" And I press "Save changes" - And I go to "View > User report" in the course gradebook + And 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: | Grade item | Calculated weight | Grade | Range | Percentage | Contribution to course total | diff --git a/grade/tests/behat/grade_natural_exclude_empty_20150619.feature b/grade/tests/behat/grade_natural_exclude_empty_20150619.feature index 19916604168..54dfc00d25d 100644 --- a/grade/tests/behat/grade_natural_exclude_empty_20150619.feature +++ b/grade/tests/behat/grade_natural_exclude_empty_20150619.feature @@ -26,7 +26,7 @@ Feature: Gradebook calculations for extra credit items before the fix 20150619 | assign | C1 | a5 | Test assignment five (extra) | x | 10 | And I log in as "teacher1" And I follow "Course 1" - And I go to "Setup > Gradebook setup" in the course gradebook + And I navigate to "Setup > Gradebook setup" in the course gradebook And I set the following settings for grade item "Test assignment four (extra)": | Extra credit | 1 | And I set the following settings for grade item "Test assignment five (extra)": @@ -34,7 +34,7 @@ Feature: Gradebook calculations for extra credit items before the fix 20150619 @javascript Scenario: No weights are overridden and student has all grades present (before the fix 20150619) - When I go to "View > Grader report" in the course gradebook + When I navigate to "View > Grader report" in the course gradebook And I turn editing mode on And I give the grade "80.00" to the user "Student 1" for the grade item "Test assignment one" And I give the grade "30.00" to the user "Student 1" for the grade item "Test assignment two" @@ -42,7 +42,7 @@ Feature: Gradebook calculations for extra credit items before the fix 20150619 And I give the grade "10.00" to the user "Student 1" for the grade item "Test assignment four (extra)" And I give the grade "8.00" to the user "Student 1" for the grade item "Test assignment five (extra)" And I press "Save changes" - And I go to "View > User report" in the course gradebook + And 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: | Grade item | Calculated weight | Grade | Range | Percentage | Contribution to course total | @@ -56,14 +56,14 @@ Feature: Gradebook calculations for extra credit items before the fix 20150619 @javascript Scenario: No weights are overridden, student has some grades present (before the fix 20150619) - When I go to "View > Grader report" in the course gradebook + When I navigate to "View > Grader report" in the course gradebook And I turn editing mode on And I give the grade "80.00" to the user "Student 1" for the grade item "Test assignment one" And I give the grade "30.00" to the user "Student 1" for the grade item "Test assignment two" And I give the grade "10.00" to the user "Student 1" for the grade item "Test assignment four (extra)" And I give the grade "8.00" to the user "Student 1" for the grade item "Test assignment five (extra)" And I press "Save changes" - And I go to "View > User report" in the course gradebook + And 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: | Grade item | Calculated weight | Grade | Range | Percentage | Contribution to course total | @@ -77,12 +77,12 @@ Feature: Gradebook calculations for extra credit items before the fix 20150619 @javascript Scenario: No weights are overridden, student has none grades present except for extra credit (before the fix 20150619) - When I go to "View > Grader report" in the course gradebook + When I navigate to "View > Grader report" in the course gradebook And I turn editing mode on And I give the grade "10.00" to the user "Student 1" for the grade item "Test assignment four (extra)" And I give the grade "8.00" to the user "Student 1" for the grade item "Test assignment five (extra)" And I press "Save changes" - And I go to "View > User report" in the course gradebook + And 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: | Grade item | Calculated weight | Grade | Range | Percentage | Contribution to course total | @@ -102,14 +102,14 @@ Feature: Gradebook calculations for extra credit items before the fix 20150619 | Extra credit | 1 | And I set the following settings for grade item "Test assignment three": | Extra credit | 1 | - When I go to "View > Grader report" in the course gradebook + When I navigate to "View > Grader report" in the course gradebook And I turn editing mode on And I give the grade "80.00" to the user "Student 1" for the grade item "Test assignment one" And I give the grade "30.00" to the user "Student 1" for the grade item "Test assignment two" And I give the grade "10.00" to the user "Student 1" for the grade item "Test assignment four (extra)" And I give the grade "8.00" to the user "Student 1" for the grade item "Test assignment five (extra)" And I press "Save changes" - And I go to "View > User report" in the course gradebook + And 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: | Grade item | Calculated weight | Grade | Range | Percentage | Contribution to course total | @@ -126,7 +126,7 @@ Feature: Gradebook calculations for extra credit items before the fix 20150619 When I set the field "Override weight of Test assignment one" to "1" And I set the field "Weight of Test assignment one" to "50" And I press "Save changes" - When I go to "View > Grader report" in the course gradebook + When I navigate to "View > Grader report" in the course gradebook And I turn editing mode on And I give the grade "80.00" to the user "Student 1" for the grade item "Test assignment one" And I give the grade "30.00" to the user "Student 1" for the grade item "Test assignment two" @@ -134,7 +134,7 @@ Feature: Gradebook calculations for extra credit items before the fix 20150619 And I give the grade "10.00" to the user "Student 1" for the grade item "Test assignment four (extra)" And I give the grade "8.00" to the user "Student 1" for the grade item "Test assignment five (extra)" And I press "Save changes" - And I go to "View > User report" in the course gradebook + And 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: | Grade item | Calculated weight | Grade | Range | Percentage | Contribution to course total | @@ -152,14 +152,14 @@ Feature: Gradebook calculations for extra credit items before the fix 20150619 When I set the field "Override weight of Test assignment one" to "1" And I set the field "Weight of Test assignment one" to "50" And I press "Save changes" - When I go to "View > Grader report" in the course gradebook + When I navigate to "View > Grader report" in the course gradebook And I turn editing mode on And I give the grade "80.00" to the user "Student 1" for the grade item "Test assignment one" And I give the grade "30.00" to the user "Student 1" for the grade item "Test assignment two" And I give the grade "10.00" to the user "Student 1" for the grade item "Test assignment four (extra)" And I give the grade "8.00" to the user "Student 1" for the grade item "Test assignment five (extra)" And I press "Save changes" - And I go to "View > User report" in the course gradebook + And 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: | Grade item | Calculated weight | Grade | Range | Percentage | Contribution to course total | @@ -177,12 +177,12 @@ Feature: Gradebook calculations for extra credit items before the fix 20150619 When I set the field "Override weight of Test assignment one" to "1" And I set the field "Weight of Test assignment one" to "50" And I press "Save changes" - When I go to "View > Grader report" in the course gradebook + When I navigate to "View > Grader report" in the course gradebook And I turn editing mode on And I give the grade "10.00" to the user "Student 1" for the grade item "Test assignment four (extra)" And I give the grade "8.00" to the user "Student 1" for the grade item "Test assignment five (extra)" And I press "Save changes" - And I go to "View > User report" in the course gradebook + And 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: | Grade item | Calculated weight | Grade | Range | Percentage | Contribution to course total | @@ -201,7 +201,7 @@ Feature: Gradebook calculations for extra credit items before the fix 20150619 And I set the field "Override weight of Test assignment four (extra)" to "1" And I set the field "Weight of Test assignment four (extra)" to "10" And I press "Save changes" - When I go to "View > Grader report" in the course gradebook + When I navigate to "View > Grader report" in the course gradebook And I turn editing mode on And I give the grade "80.00" to the user "Student 1" for the grade item "Test assignment one" And I give the grade "30.00" to the user "Student 1" for the grade item "Test assignment two" @@ -209,7 +209,7 @@ Feature: Gradebook calculations for extra credit items before the fix 20150619 And I give the grade "10.00" to the user "Student 1" for the grade item "Test assignment four (extra)" And I give the grade "8.00" to the user "Student 1" for the grade item "Test assignment five (extra)" And I press "Save changes" - And I go to "View > User report" in the course gradebook + And 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: | Grade item | Calculated weight | Grade | Range | Percentage | Contribution to course total | @@ -229,14 +229,14 @@ Feature: Gradebook calculations for extra credit items before the fix 20150619 And I set the field "Override weight of Test assignment four (extra)" to "1" And I set the field "Weight of Test assignment four (extra)" to "10" And I press "Save changes" - And I go to "View > Grader report" in the course gradebook + And I navigate to "View > Grader report" in the course gradebook And I turn editing mode on And I give the grade "80.00" to the user "Student 1" for the grade item "Test assignment one" And I give the grade "30.00" to the user "Student 1" for the grade item "Test assignment two" And I give the grade "10.00" to the user "Student 1" for the grade item "Test assignment four (extra)" And I give the grade "8.00" to the user "Student 1" for the grade item "Test assignment five (extra)" And I press "Save changes" - And I go to "View > User report" in the course gradebook + And 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: | Grade item | Calculated weight | Grade | Range | Percentage | Contribution to course total | @@ -256,12 +256,12 @@ Feature: Gradebook calculations for extra credit items before the fix 20150619 And I set the field "Override weight of Test assignment four (extra)" to "1" And I set the field "Weight of Test assignment four (extra)" to "10" And I press "Save changes" - When I go to "View > Grader report" in the course gradebook + When I navigate to "View > Grader report" in the course gradebook And I turn editing mode on And I give the grade "10.00" to the user "Student 1" for the grade item "Test assignment four (extra)" And I give the grade "8.00" to the user "Student 1" for the grade item "Test assignment five (extra)" And I press "Save changes" - And I go to "View > User report" in the course gradebook + And 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: | Grade item | Calculated weight | Grade | Range | Percentage | Contribution to course total | diff --git a/grade/tests/behat/grade_natural_normalisation.feature b/grade/tests/behat/grade_natural_normalisation.feature index 491661dbf45..1f10b75dff2 100644 --- a/grade/tests/behat/grade_natural_normalisation.feature +++ b/grade/tests/behat/grade_natural_normalisation.feature @@ -32,7 +32,7 @@ Feature: We can use natural aggregation and weights will be normalised to a tota | assign | C1 | a7 | Test assignment seven | Submit nothing! | Sub category 1 | 15 | And I log in as "teacher1" And I follow "Course 1" - And I go to "Setup > Gradebook setup" in the course gradebook + And I navigate to "Setup > Gradebook setup" in the course gradebook @javascript Scenario: Setting all weights in a category to exactly one hundred in total. diff --git a/grade/tests/behat/grade_natural_normalisation_20150619.feature b/grade/tests/behat/grade_natural_normalisation_20150619.feature index 0157764c606..b302102589a 100644 --- a/grade/tests/behat/grade_natural_normalisation_20150619.feature +++ b/grade/tests/behat/grade_natural_normalisation_20150619.feature @@ -33,7 +33,7 @@ Feature: Gradebook calculations for natural weights normalisation before the fix | assign | C1 | a7 | Test assignment seven | Submit nothing! | Sub category 1 | 15 | And I log in as "teacher1" And I follow "Course 1" - And I go to "Setup > Gradebook setup" in the course gradebook + And I navigate to "Setup > Gradebook setup" in the course gradebook @javascript Scenario: Grade items weights are normalised when all grade item weights are overridden (sum exactly 100). Extra credit is set to zero (before the fix 20150619). diff --git a/grade/tests/behat/grade_override_letter.feature b/grade/tests/behat/grade_override_letter.feature index 9328a15749d..be0ff3dd907 100644 --- a/grade/tests/behat/grade_override_letter.feature +++ b/grade/tests/behat/grade_override_letter.feature @@ -16,7 +16,7 @@ Feature: Grade letters can be overridden | teacher1 | C1 | editingteacher | And I log in as "teacher1" And I follow "Course 1" - And I go to "Letters > Edit" in the course gradebook + And I navigate to "Letters > Edit" in the course gradebook Scenario Outline: Grade letters can be completely overridden When I set the following fields to these values: diff --git a/grade/tests/behat/grade_point_maximum.feature b/grade/tests/behat/grade_point_maximum.feature index 823c8eda325..347b9860c3a 100644 --- a/grade/tests/behat/grade_point_maximum.feature +++ b/grade/tests/behat/grade_point_maximum.feature @@ -25,7 +25,7 @@ Feature: We can change the grading type and maximum grade point values @javascript Scenario: Validate that switching the type of grading used correctly disables input form elements When I follow "Test Assignment 1" - And I click on "Edit settings" "link" in the "Administration" "block" + And I navigate to "Edit settings" in current page administration And I expand all fieldsets And I set the field "grade[modgrade_type]" to "Point" Then the "Scale" "select" should be disabled @@ -41,12 +41,12 @@ Feature: We can change the grading type and maximum grade point values @javascript Scenario: Create an activity with a maximum grade point value less than the system maximum When I follow "Test Assignment 1" - And I click on "Edit settings" "link" in the "Administration" "block" + And I navigate to "Edit settings" in current page administration And I expand all fieldsets And I set the field "grade[modgrade_type]" to "point" And I set the field "grade[modgrade_point]" to "600" And I press "Save and display" - And I click on "Edit settings" "link" in the "Administration" "block" + And I navigate to "Edit settings" in current page administration Then the field "grade[modgrade_point]" matches value "600" And the "Scale" "select" should be disabled And I press "Save and return to course" @@ -54,12 +54,12 @@ Feature: We can change the grading type and maximum grade point values @javascript Scenario: Create an activity with a scale as the grade type When I follow "Test Assignment 1" - And I click on "Edit settings" "link" in the "Administration" "block" + And I navigate to "Edit settings" in current page administration And I expand all fieldsets And I set the field "grade[modgrade_type]" to "Scale" And I set the field "grade[modgrade_scale]" to "Separate and Connected ways of knowing" And I press "Save and display" - And I click on "Edit settings" "link" in the "Administration" "block" + And I navigate to "Edit settings" in current page administration Then the field "grade[modgrade_scale]" matches value "Separate and Connected ways of knowing" And the "Maximum grade" "field" should be disabled And I press "Save and return to course" @@ -67,18 +67,18 @@ Feature: We can change the grading type and maximum grade point values @javascript Scenario: Create an activity with no grade as the grade type When I follow "Test Assignment 1" - And I click on "Edit settings" "link" in the "Administration" "block" + And I navigate to "Edit settings" in current page administration And I expand all fieldsets And I set the field "grade[modgrade_type]" to "None" And I press "Save and display" - And I click on "Edit settings" "link" in the "Administration" "block" + And I navigate to "Edit settings" in current page administration And the "Scale" "select" should be disabled And the "Maximum grade" "field" should be disabled And I press "Save and return to course" Scenario: Create an activity with a maximum grade point value higher than the system maximum When I follow "Test Assignment 1" - And I click on "Edit settings" "link" in the "Administration" "block" + And I navigate to "Edit settings" in current page administration And I expand all fieldsets And I set the field "grade[modgrade_type]" to "Point" And I set the field "grade[modgrade_point]" to "20000" @@ -88,7 +88,7 @@ Feature: We can change the grading type and maximum grade point values Scenario: Create an activity with a valid maximum grade point and then change the system maximum to be lower When I follow "Test Assignment 1" - And I click on "Edit settings" "link" in the "Administration" "block" + And I navigate to "Edit settings" in current page administration And I expand all fieldsets And I set the field "grade[modgrade_type]" to "point" And I set the field "grade[modgrade_point]" to "600" @@ -100,7 +100,7 @@ Feature: We can change the grading type and maximum grade point values And I am on site homepage And I follow "Course 1" And I follow "Test Assignment 1" - And I click on "Edit settings" "link" in the "Administration" "block" + And I navigate to "Edit settings" in current page administration And I press "Save and display" Then I should see "Invalid grade value. This must be an integer between 1 and 100" And I press "Cancel" diff --git a/grade/tests/behat/grade_scales.feature b/grade/tests/behat/grade_scales.feature index f4e427a6ab3..400e96fb43d 100644 --- a/grade/tests/behat/grade_scales.feature +++ b/grade/tests/behat/grade_scales.feature @@ -44,12 +44,12 @@ Feature: View gradebook when scales are used And I log in as "teacher1" And I follow "Course 1" And I follow "Test assignment one" - And I click on "Edit settings" "link" in the "Administration" "block" + And I navigate to "Edit settings" in current page administration And I expand all fieldsets And I set the field "grade[modgrade_type]" to "Scale" And I set the field "grade[modgrade_scale]" to "Letterscale" And I press "Save and display" - And I click on "View all submissions" "link" in the "Administration" "block" + And I navigate to "View all submissions" in current page administration And I click on "Grade" "link" in the "Student 1" "table_row" And I set the field "Grade" to "A" And I press "Save changes" @@ -71,11 +71,11 @@ Feature: View gradebook when scales are used And I press "Save changes" And I press "Ok" And I follow "Course 1" - And I go to "Setup > Course grade settings" in the course gradebook + And I navigate to "Setup > Course grade settings" in the course gradebook And I set the field "Show weightings" to "Show" And I set the field "Show contribution to course total" to "Show" And I press "Save changes" - And I go to "View > Grader report" in the course gradebook + And I navigate to "View > Grader report" in the course gradebook And I turn editing mode on Scenario: Test displaying scales in gradebook in aggregation method Natural @@ -91,14 +91,14 @@ Feature: View gradebook when scales are used | -1- | -2- | -3- | -4- | | Range | F–A | 0.00–5.00 | 0.00–5.00 | | Overall average | C | 3.00 | 3.00 | - And I go to "View > User report" in the course gradebook + And I navigate to "View > User report" in the course gradebook And I select "Student 3" from the "Select all or one user" singleselect And the following should exist in the "user-grade" table: | Grade item | Grade | Range | Percentage | Contribution to course total | | Test assignment one | C | F–A | 50.00 % | 60.00 % | | Sub category 1 total | 3.00 | 0–5 | 60.00 % | - | | Course total | 3.00 | 0–5 | 60.00 % | - | - And I go to "Setup > Gradebook setup" in the course gradebook + And I navigate to "Setup > Gradebook setup" in the course gradebook And the following should exist in the "grade_edit_tree_table" table: | Name | Max grade | | Test assignment one | 5.00 | @@ -137,14 +137,14 @@ Feature: View gradebook when scales are used | -1- | -2- | -3- | -4- | | Range | F–A | 1.00–5.00 | 0.00–100.00 | | Overall average | C | 3.00 | | - And I go to "View > User report" in the course gradebook + And I navigate to "View > User report" in the course gradebook And I select "Student 3" from the "Select all or one user" singleselect And the following should exist in the "user-grade" table: | Grade item | Grade | Range | Percentage | Contribution to course total | | Test assignment one | C | F–A | 50.00 % | | | Sub category () total. | 3.00 | 1–5 | 50.00 % | - | | Course total. | | 0–100 | | - | - And I go to "Setup > Gradebook setup" in the course gradebook + And I navigate to "Setup > Gradebook setup" in the course gradebook And the following should exist in the "grade_edit_tree_table" table: | Name | Max grade | | Test assignment one | A (5) | diff --git a/grade/tests/behat/grade_scales_aggregation.feature b/grade/tests/behat/grade_scales_aggregation.feature index 2685397a38f..dc2092b9d78 100644 --- a/grade/tests/behat/grade_scales_aggregation.feature +++ b/grade/tests/behat/grade_scales_aggregation.feature @@ -39,14 +39,14 @@ Feature: Control the aggregation of the scales Scenario Outline: Scales can be excluded from aggregation Given I log in as "teacher1" And I follow "Course 1" - And I go to "View > Grader report" in the course gradebook + And I navigate to "View > Grader report" in the course gradebook And I turn editing mode on When I give the grade "10" to the user "Student 1" for the grade item "Grade me" And I give the grade "B" to the user "Student 1" for the grade item "Scale me" And I press "Save changes" And I set the following settings for grade item "Course 1": | Aggregation | | - And I go to "View > User report" in the course gradebook + And I navigate to "View > User report" in the course gradebook And I select "Student 1" from the "Select all or one user" singleselect Then the following should exist in the "user-grade" table: | Grade item | Grade | Percentage | Contribution to course total | @@ -60,7 +60,7 @@ Feature: Control the aggregation of the scales And I log out And I log in as "teacher1" And I follow "Course 1" - And I go to "View > User report" in the course gradebook + And I navigate to "View > User report" in the course gradebook And I select "Student 1" from the "Select all or one user" singleselect And the following should exist in the "user-grade" table: | Grade item | Grade | Percentage | Contribution to course total | @@ -84,11 +84,11 @@ Feature: Control the aggregation of the scales Scenario: Weights of scales cannot be edited when they are not aggregated Given I log in as "teacher1" And I follow "Course 1" - And I go to "View > Grader report" in the course gradebook + And I navigate to "View > Grader report" in the course gradebook And I turn editing mode on When I set the following settings for grade item "Course 1": | Aggregation | Natural | - And I go to "Setup > Gradebook setup" in the course gradebook + And I navigate to "Setup > Gradebook setup" in the course gradebook And I set the field "Override weight of Grade me" to "1" Then the field "Override weight of Grade me" matches value "100.00" And I click on "Edit" "link" in the "Scale me" "table_row" @@ -99,7 +99,7 @@ Feature: Control the aggregation of the scales And the following config values are set as admin: | grade_includescalesinaggregation | 1 | And I follow "Course 1" - And I go to "Setup > Gradebook setup" in the course gradebook + And I navigate to "Setup > Gradebook setup" in the course gradebook And I set the field "Override weight of Grade me" to "1" And the field "Override weight of Grade me" matches value "95.238" And I set the field "Override weight of Scale me" to "1" diff --git a/grade/tests/behat/grade_single_item_scales.feature b/grade/tests/behat/grade_single_item_scales.feature index 921ce585317..2f4a7cc158a 100644 --- a/grade/tests/behat/grade_single_item_scales.feature +++ b/grade/tests/behat/grade_single_item_scales.feature @@ -38,22 +38,22 @@ Feature: View gradebook when single item scales are used And I log in as "teacher1" And I follow "Course 1" And I follow "Test assignment one" - And I click on "Edit settings" "link" in the "Administration" "block" + And I navigate to "Edit settings" in current page administration And I expand all fieldsets And I set the field "grade[modgrade_type]" to "Scale" And I set the field "grade[modgrade_scale]" to "Singleitem" And I press "Save and display" - And I click on "View all submissions" "link" in the "Administration" "block" + And I navigate to "View all submissions" in current page administration And I click on "Grade" "link" in the "Student 1" "table_row" And I set the field "Grade" to "A" And I press "Save changes" And I press "Ok" And I follow "Course 1" - And I go to "Setup > Course grade settings" in the course gradebook + And I navigate to "Setup > Course grade settings" in the course gradebook And I set the field "Show weightings" to "Show" And I set the field "Show contribution to course total" to "Show" And I press "Save changes" - And I go to "View > Grader report" in the course gradebook + And I navigate to "View > Grader report" in the course gradebook And I turn editing mode on Scenario: Test displaying single item scales in gradebook in aggregation method Natural @@ -65,7 +65,7 @@ Feature: View gradebook when single item scales are used | -1- | -2- | -3- | -4- | | Range | Ace!–Ace! | 0.00–1.00 | 0.00–1.00 | | Overall average | Ace! | 1.00 | 1.00 | - And I go to "View > User report" in the course gradebook + And I navigate to "View > User report" in the course gradebook And I select "Student 1" from the "Select all or one user" singleselect And the following should exist in the "user-grade" table: | Grade item | Grade | Range | Contribution to course total | @@ -78,7 +78,7 @@ Feature: View gradebook when single item scales are used | Test assignment one | - | Ace!–Ace! | - | | Sub category 1 total| - | 0–1 | - | | Course total | - | 0–1 | - | - And I go to "Setup > Gradebook setup" in the course gradebook + And I navigate to "Setup > Gradebook setup" in the course gradebook And the following should exist in the "grade_edit_tree_table" table: | Name | Max grade | | Test assignment one | 1.00 | @@ -103,14 +103,14 @@ Feature: View gradebook when single item scales are used | -1- | -2- | -3- | -4- | | Range | Ace!–Ace! | 0.00–100.0 | 0.00–100.00 | | Overall average | Ace! | | | - And I go to "View > User report" in the course gradebook + And I navigate to "View > User report" in the course gradebook And I select "Student 1" from the "Select all or one user" singleselect And the following should exist in the "user-grade" table: | Grade item | Grade | Range | Contribution to course total | | Test assignment one | Ace! | Ace!–Ace! | | | Sub category () total. | | 0–100 | - | | Course total. | | 0–100 | - | - And I go to "Setup > Gradebook setup" in the course gradebook + And I navigate to "Setup > Gradebook setup" in the course gradebook And the following should exist in the "grade_edit_tree_table" table: | Name | Max grade | | Test assignment one | Ace! (1) | diff --git a/grade/tests/behat/grade_to_pass.feature b/grade/tests/behat/grade_to_pass.feature index 2fb29483e16..b108e06b107 100644 --- a/grade/tests/behat/grade_to_pass.feature +++ b/grade/tests/behat/grade_to_pass.feature @@ -54,7 +54,7 @@ Feature: We can set the grade to pass value | grade[modgrade_type] | Point | | grade[modgrade_point] | 50 | | Grade to pass | 25 | - And I go to "View > Grader report" in the course gradebook + And I navigate to "View > Grader report" in the course gradebook And I turn editing mode on And I click on "Edit assign Test Assignment 1" "link" Then the field "Grade to pass" matches value "25" @@ -64,7 +64,7 @@ Feature: We can set the grade to pass value And I expand all fieldsets And I set the field "Grade to pass" to "30" And I press "Save and return to course" - And I go to "View > Grader report" in the course gradebook + And I navigate to "View > Grader report" in the course gradebook And I click on "Edit assign Test Assignment 1" "link" And the field "Grade to pass" matches value "30" @@ -76,7 +76,7 @@ Feature: We can set the grade to pass value | grade[modgrade_type] | Scale | | grade[modgrade_scale] | Test Scale 1 | | Grade to pass | 3 | - And I go to "View > Grader report" in the course gradebook + And I navigate to "View > Grader report" in the course gradebook And I turn editing mode on And I click on "Edit assign Test Assignment 1" "link" And I expand all fieldsets @@ -107,7 +107,7 @@ Feature: We can set the grade to pass value | Submission grade to pass | 40 | | gradinggrade | 20 | | Assessment grade to pass | 10 | - And I go to "View > Grader report" in the course gradebook + And I navigate to "View > Grader report" in the course gradebook And I turn editing mode on And I click on "Edit workshop Test Workshop 1 (submission)" "link" And I expand all fieldsets @@ -142,7 +142,7 @@ Feature: We can set the grade to pass value And I add a "Quiz" to section "1" and I fill the form with: | Name | Test Quiz 1 | | Grade to pass | 9.5 | - And I go to "View > Grader report" in the course gradebook + And I navigate to "View > Grader report" in the course gradebook And I turn editing mode on And I click on "Edit quiz Test Quiz 1" "link" And I expand all fieldsets @@ -160,7 +160,7 @@ Feature: We can set the grade to pass value | Name | Test Lesson 1 | | Description | Test | | Grade to pass | 90 | - And I go to "View > Grader report" in the course gradebook + And I navigate to "View > Grader report" in the course gradebook And I turn editing mode on And I click on "Edit lesson Test Lesson 1" "link" And I expand all fieldsets @@ -179,7 +179,7 @@ Feature: We can set the grade to pass value | Description | Test | | Aggregate type | Average of ratings | | Grade to pass | 90 | - And I go to "View > Grader report" in the course gradebook + And I navigate to "View > Grader report" in the course gradebook And I turn editing mode on And I click on "Edit data Test Database 1" "link" And I expand all fieldsets @@ -187,8 +187,7 @@ Feature: We can set the grade to pass value And I set the field "Grade to pass" to "80" And I press "Save changes" And I follow "Course 1" - And I follow "Test Database 1" - And I follow "Edit settings" + And I click on "Edit settings" "link" in the "Test Database 1" activity And the field "Grade to pass" matches value "80" Scenario: Set an invalid grade to pass for forum activity @@ -208,7 +207,7 @@ Feature: We can set the grade to pass value | Description | Test | | Aggregate type | Average of ratings | | Grade to pass | 90 | - And I go to "View > Grader report" in the course gradebook + And I navigate to "View > Grader report" in the course gradebook And I turn editing mode on And I click on "Edit forum Test Forum 1" "link" And I expand all fieldsets @@ -227,7 +226,7 @@ Feature: We can set the grade to pass value | Description | Test | | Aggregate type | Average of ratings | | Grade to pass | 90 | - And I go to "View > Grader report" in the course gradebook + And I navigate to "View > Grader report" in the course gradebook And I turn editing mode on And I click on "Edit glossary Test Glossary 1" "link" And I expand all fieldsets diff --git a/grade/tests/behat/grade_view.feature b/grade/tests/behat/grade_view.feature index 4cc19cb0fd0..f2c85c47bcd 100644 --- a/grade/tests/behat/grade_view.feature +++ b/grade/tests/behat/grade_view.feature @@ -51,14 +51,14 @@ Feature: We can enter in grades and view reports from the gradebook And I log out And I log in as "teacher1" And I follow "Course 1" - And I go to "View > Grader report" in the course gradebook + And I navigate to "View > Grader report" in the course gradebook And I turn editing mode on And I give the grade "80.00" to the user "Student 1" for the grade item "Test assignment name 1" And I give the grade "90.00" to the user "Student 1" for the grade item "Test assignment name 2" And I press "Save changes" Scenario: Grade a grade item and ensure the results display correctly in the gradebook - When I go to "View > User report" in the course gradebook + When I navigate to "View > User report" in the course gradebook And "Grader report" "link" should exist And "Outcomes report" "link" should exist And the "Select all or one user" select box should contain "All users (1)" @@ -79,12 +79,12 @@ Feature: We can enter in grades and view reports from the gradebook And "Course 1" row "Grade" column of "overview-grade" table should not contain "90.00" Scenario: We can add a weighting to a grade item and it is displayed properly in the user report - When I go to "Setup > Gradebook setup" in the course gradebook + When I navigate to "Setup > Gradebook setup" in the course gradebook And I set the following settings for grade item "Course 1": | Aggregation | Weighted mean of grades | And I set the field "Extra credit value for Test assignment name" to "0.72" And I press "Save changes" - And I go to "Setup > Course grade settings" in the course gradebook + And I navigate to "Setup > Course grade settings" in the course gradebook And I set the following fields to these values: | Show weightings | Show | And I press "Save changes" diff --git a/group/tests/behat/auto_creation.feature b/group/tests/behat/auto_creation.feature index bc928eb433d..e41b32fc9d8 100644 --- a/group/tests/behat/auto_creation.feature +++ b/group/tests/behat/auto_creation.feature @@ -38,8 +38,7 @@ Feature: Automatic creation of groups | suspendedstudent11 | C1 | student | 1 | And I log in as "teacher1" And I follow "Course 1" - And I expand "Users" node - And I follow "Groups" + And I navigate to "Users > Groups" in current page administration When I press "Auto-create groups" And I expand all fieldsets @@ -165,8 +164,7 @@ Feature: Automatic creation of groups And I log out And I log in as "teacher1" And I follow "Course 1" - And I expand "Users" node - And I follow "Groups" + And I navigate to "Users > Groups" in current page administration When I press "Auto-create groups" Then I should not see "Include only active enrolments" And I set the field "Group/member count" to "11" diff --git a/group/tests/behat/create_groups.feature b/group/tests/behat/create_groups.feature index 4d07c441215..b2cdd223dff 100644 --- a/group/tests/behat/create_groups.feature +++ b/group/tests/behat/create_groups.feature @@ -25,8 +25,7 @@ Feature: Organize students into groups | student3 | C1 | student | And I log in as "teacher1" And I follow "Course 1" - And I expand "Users" node - And I follow "Groups" + And I navigate to "Users > Groups" in current page administration And I press "Create group" And I set the following fields to these values: | Group name | Group 1 | @@ -47,7 +46,7 @@ Feature: Organize students into groups And the "members" select box should contain "Student 2" And the "members" select box should contain "Student 3" And the "members" select box should not contain "Student 0" - And I follow "Participants" + And I navigate to course participants And I set the field "Separate groups" to "Group 1" And I should see "Student 0" And I should see "Student 1" @@ -73,8 +72,7 @@ Feature: Organize students into groups And I log out And I log in as "teacher1" And I follow "Course 1" - And I expand "Users" node - And I follow "Groups" + And I navigate to "Users > Groups" in current page administration When I press "Create group" Then the "idnumber" "field" should be readonly And I set the following fields to these values: @@ -97,8 +95,7 @@ Feature: Organize students into groups And I log in as "admin" And I am on site homepage And I follow "Course 1" - And I expand "Users" node - And I follow "Groups" + And I navigate to "Users > Groups" in current page administration When I press "Create group" And I set the following fields to these values: | Group name | Group A | @@ -121,8 +118,7 @@ Feature: Organize students into groups And the "groups" select box should contain "Group B (0)" And I am on site homepage And I follow "Course 2" - And I expand "Users" node - And I follow "Groups" + And I navigate to "Users > Groups" in current page administration And I press "Create group" And I set the following fields to these values: | Group name | Group A | diff --git a/group/tests/behat/delete_groups.feature b/group/tests/behat/delete_groups.feature index 41158de0294..b77d0007c0b 100644 --- a/group/tests/behat/delete_groups.feature +++ b/group/tests/behat/delete_groups.feature @@ -16,8 +16,7 @@ Feature: Automatic deletion of groups and groupings | teacher1 | C1 | editingteacher | And I log in as "teacher1" And I follow "Course 1" - And I expand "Users" node - And I follow "Groups" + And I navigate to "Users > Groups" in current page administration And I press "Create group" And I set the following fields to these values: | Group name | Group (without ID) | @@ -66,8 +65,7 @@ Feature: Automatic deletion of groups and groupings And I log out And I log in as "teacher1" And I follow "Course 1" - And I expand "Users" node - And I follow "Groups" + And I navigate to "Users > Groups" in current page administration When I set the field "groups" to "Group (with ID) (0)" Then the "Delete selected group" "button" should be disabled And I set the field "groups" to "Group (without ID) (0)" diff --git a/group/tests/behat/groups_import.feature b/group/tests/behat/groups_import.feature index 51ba389d670..eaea7d4c439 100644 --- a/group/tests/behat/groups_import.feature +++ b/group/tests/behat/groups_import.feature @@ -19,8 +19,7 @@ Feature: Importing of groups and groupings Scenario: Import groups and groupings as teacher Given I log in as "teacher1" And I follow "Course 1" - And I expand "Users" node - And I follow "Groups" + And I navigate to "Users > Groups" in current page administration And I press "Import groups" When I upload "group/tests/fixtures/groups_import.csv" file to "Import" filemanager And I press "Import groups" @@ -44,8 +43,7 @@ Feature: Importing of groups and groupings Scenario: Import groups with idnumber when the user has proper permissions for the idnumber field Given I log in as "teacher1" And I follow "Course 1" - And I expand "Users" node - And I follow "Groups" + And I navigate to "Users > Groups" in current page administration And I press "Import groups" When I upload "group/tests/fixtures/groups_import.csv" file to "Import" filemanager And I press "Import groups" @@ -82,15 +80,13 @@ Feature: Importing of groups and groupings Given I log in as "admin" And I am on site homepage And I follow "Course 1" - And I expand "Users" node - And I follow "Permissions" + And I navigate to "Users > Permissions" in current page administration And I override the system permissions of "Teacher" role with: | moodle/course:changeidnumber | Prevent | And I log out And I log in as "teacher1" And I follow "Course 1" - And I expand "Users" node - And I follow "Groups" + And I navigate to "Users > Groups" in current page administration And I press "Import groups" When I upload "group/tests/fixtures/groups_import.csv" file to "Import" filemanager And I press "Import groups" diff --git a/group/tests/behat/id_uniqueness.feature b/group/tests/behat/id_uniqueness.feature index 50fc619f6b8..14c18c46190 100644 --- a/group/tests/behat/id_uniqueness.feature +++ b/group/tests/behat/id_uniqueness.feature @@ -16,8 +16,7 @@ Feature: Uniqueness of Group ID number | teacher1 | C1 | editingteacher | And I log in as "teacher1" And I follow "Course 1" - And I expand "Users" node - And I follow "Groups" + And I navigate to "Users > Groups" in current page administration Scenario: Group ID number uniqueness Given I press "Create group" diff --git a/group/tests/behat/update_groups.feature b/group/tests/behat/update_groups.feature index e7b428bb225..6da490d0c7f 100644 --- a/group/tests/behat/update_groups.feature +++ b/group/tests/behat/update_groups.feature @@ -16,8 +16,7 @@ Feature: Automatic updating of groups and groupings | teacher1 | C1 | editingteacher | And I log in as "teacher1" And I follow "Course 1" - And I expand "Users" node - And I follow "Groups" + And I navigate to "Users > Groups" in current page administration And I press "Create group" And I set the following fields to these values: | Group name | Group (without ID) | @@ -73,8 +72,7 @@ Feature: Automatic updating of groups and groupings And I log out And I log in as "teacher1" And I follow "Course 1" - And I expand "Users" node - And I follow "Groups" + And I navigate to "Users > Groups" in current page administration And I set the field "groups" to "Group (with ID)" When I press "Edit group settings" Then the "idnumber" "field" should be readonly @@ -111,8 +109,7 @@ Feature: Automatic updating of groups and groupings And I log out And I log in as "teacher1" And I follow "Course 1" - And I expand "Users" node - And I follow "Groups" + And I navigate to "Users > Groups" in current page administration And I set the field "groups" to "Group (with ID)" And I press "Edit group settings" And I set the following fields to these values: @@ -138,8 +135,7 @@ Feature: Automatic updating of groups and groupings And I should not see "This enrolment key is already used for another group." And I am on homepage And I follow "Course 2" - And I expand "Users" node - And I follow "Groups" + And I navigate to "Users > Groups" in current page administration And I press "Create group" And I set the following fields to these values: | Group name | Group A | diff --git a/lib/antivirus/clamav/db/upgrade.php b/lib/antivirus/clamav/db/upgrade.php index 08fc4a2d9e3..ea196f11920 100644 --- a/lib/antivirus/clamav/db/upgrade.php +++ b/lib/antivirus/clamav/db/upgrade.php @@ -50,5 +50,8 @@ function xmldb_antivirus_clamav_upgrade($oldversion) { upgrade_plugin_savepoint(true, 2016102600, 'antivirus', 'clamav'); } + // Automatically generated Moodle v3.2.0 release upgrade line. + // Put any upgrade step following this. + return true; } diff --git a/lib/blocklib.php b/lib/blocklib.php index 2baca98e5e5..e3a386883ea 100644 --- a/lib/blocklib.php +++ b/lib/blocklib.php @@ -387,10 +387,7 @@ class block_manager { $requiredbythemeblocks = $PAGE->theme->requiredblocks; } - // We need blocks for behat, till MDL-56614 gets in. - if (defined('BEHAT_SITE_RUNNING')) { - return array('navigation', 'settings'); - } else if ($requiredbythemeblocks === false) { + if ($requiredbythemeblocks === false) { return array('navigation', 'settings'); } else if ($requiredbythemeblocks === '') { return array(); diff --git a/lib/classes/dataformat/spout_base.php b/lib/classes/dataformat/spout_base.php index 434b18c86a7..9208e605b3f 100644 --- a/lib/classes/dataformat/spout_base.php +++ b/lib/classes/dataformat/spout_base.php @@ -49,6 +49,9 @@ abstract class spout_base extends \core\dataformat\base { */ public function send_http_headers() { $this->writer = \Box\Spout\Writer\WriterFactory::create($this->spouttype); + if (method_exists($this->writer, 'setTempFolder')) { + $this->writer->setTempFolder(make_request_directory()); + } $filename = $this->filename . $this->get_extension(); $this->writer->openToBrowser($filename); if ($this->sheettitle && $this->writer instanceof \Box\Spout\Writer\AbstractMultiSheetsWriter) { diff --git a/lib/db/upgrade.php b/lib/db/upgrade.php index cd9f0f06465..da208239457 100644 --- a/lib/db/upgrade.php +++ b/lib/db/upgrade.php @@ -2433,5 +2433,8 @@ function xmldb_main_upgrade($oldversion) { upgrade_main_savepoint(true, 2016112200.02); } + // Automatically generated Moodle v3.2.0 release upgrade line. + // Put any upgrade step following this. + return true; } diff --git a/lib/editor/atto/db/upgrade.php b/lib/editor/atto/db/upgrade.php index c419bf5d08c..fb4b966f9a9 100644 --- a/lib/editor/atto/db/upgrade.php +++ b/lib/editor/atto/db/upgrade.php @@ -89,5 +89,8 @@ function xmldb_editor_atto_upgrade($oldversion) { // Moodle v3.1.0 release upgrade line. // Put any upgrade step following this. + // Automatically generated Moodle v3.2.0 release upgrade line. + // Put any upgrade step following this. + return true; } diff --git a/lib/editor/atto/plugins/equation/db/upgrade.php b/lib/editor/atto/plugins/equation/db/upgrade.php index 1a11a63b063..8f0fcf7883e 100644 --- a/lib/editor/atto/plugins/equation/db/upgrade.php +++ b/lib/editor/atto/plugins/equation/db/upgrade.php @@ -45,5 +45,8 @@ function xmldb_atto_equation_upgrade($oldversion) { // Moodle v3.1.0 release upgrade line. // Put any upgrade step following this. + // Automatically generated Moodle v3.2.0 release upgrade line. + // Put any upgrade step following this. + return true; } \ No newline at end of file diff --git a/lib/editor/atto/tests/behat/autosave.feature b/lib/editor/atto/tests/behat/autosave.feature index 7a413eaed5c..fc45d208bda 100644 --- a/lib/editor/atto/tests/behat/autosave.feature +++ b/lib/editor/atto/tests/behat/autosave.feature @@ -55,7 +55,7 @@ Feature: Atto Autosave And I follow "Manage private files..." And I upload "lib/editor/atto/tests/fixtures/moodle-logo.png" file to "Files" filemanager And I click on "Save changes" "button" - And I click on "Dashboard" "link" in the "Navigation" "block" + And I am on homepage And I follow "Course 1" And I navigate to "Edit settings" node in "Course administration" And I set the field "Course summary" to "

Image test

" diff --git a/lib/editor/tinymce/db/upgrade.php b/lib/editor/tinymce/db/upgrade.php index 2ed7bbfdcd5..38a74ce3d3f 100644 --- a/lib/editor/tinymce/db/upgrade.php +++ b/lib/editor/tinymce/db/upgrade.php @@ -59,5 +59,8 @@ function xmldb_editor_tinymce_upgrade($oldversion) { // Moodle v3.1.0 release upgrade line. // Put any upgrade step following this. + // Automatically generated Moodle v3.2.0 release upgrade line. + // Put any upgrade step following this. + return true; } diff --git a/lib/editor/tinymce/plugins/spellchecker/db/upgrade.php b/lib/editor/tinymce/plugins/spellchecker/db/upgrade.php index 75ed5760e31..3c7395ef4a0 100644 --- a/lib/editor/tinymce/plugins/spellchecker/db/upgrade.php +++ b/lib/editor/tinymce/plugins/spellchecker/db/upgrade.php @@ -39,5 +39,8 @@ function xmldb_tinymce_spellchecker_upgrade($oldversion) { // Moodle v3.1.0 release upgrade line. // Put any upgrade step following this. + // Automatically generated Moodle v3.2.0 release upgrade line. + // Put any upgrade step following this. + return true; } diff --git a/lib/enrollib.php b/lib/enrollib.php index 4849b07ddee..452a8991ddc 100644 --- a/lib/enrollib.php +++ b/lib/enrollib.php @@ -145,13 +145,15 @@ function enrol_get_plugin($name) { $location = "$CFG->dirroot/enrol/$name"; - if (!file_exists("$location/lib.php")) { - return null; - } - include_once("$location/lib.php"); $class = "enrol_{$name}_plugin"; if (!class_exists($class)) { - return null; + if (!file_exists("$location/lib.php")) { + return null; + } + include_once("$location/lib.php"); + if (!class_exists($class)) { + return null; + } } return new $class(); diff --git a/lib/filterlib.php b/lib/filterlib.php index 230fd3fe728..688ec006daa 100644 --- a/lib/filterlib.php +++ b/lib/filterlib.php @@ -295,6 +295,9 @@ class filter_manager { $filter = $this->textfilters[$context->id][$name]; } else { $filter = $this->make_filter_object($name, $context, $config); + if (is_null($filter)) { + continue; + } } $filter->setup($page, $context); } diff --git a/lib/form/tests/behat/modgrade_validation.feature b/lib/form/tests/behat/modgrade_validation.feature index cc4fe72010c..dd65fd0d193 100644 --- a/lib/form/tests/behat/modgrade_validation.feature +++ b/lib/form/tests/behat/modgrade_validation.feature @@ -43,20 +43,20 @@ Feature: Using the activity grade form element | scale[modgrade_point] | 100 | | Group mode | No groups | And I follow "Test forum name" - And I click on "Edit settings" "link" in the "Administration" "block" + And I navigate to "Edit settings" in current page administration When I expand all fieldsets Then I should not see "Some grades have already been awarded, so the grade type" And I set the field "scale[modgrade_type]" to "Scale" And I set the field "scale[modgrade_scale]" to "ABCDEF" And I press "Save and display" And I should not see "You cannot change the type, as grades already exist for this item" - And I click on "Edit settings" "link" in the "Administration" "block" + And I navigate to "Edit settings" in current page administration And I expand all fieldsets And I should not see "Some grades have already been awarded, so the grade type" And I set the field "scale[modgrade_scale]" to "Letter scale" And I press "Save and display" And I should not see "You cannot change the scale, as grades already exist for this item" - And I click on "Edit settings" "link" in the "Administration" "block" + And I navigate to "Edit settings" in current page administration And I expand all fieldsets And I should not see "Some grades have already been awarded, so the grade type" And I set the field "scale[modgrade_type]" to "Point" @@ -105,13 +105,14 @@ Feature: Using the activity grade form element And I follow "Test forum name" And I follow "Discussion subject" And I set the field "rating" to "D" - And I click on "Edit settings" "link" in the "Administration" "block" + And I follow "Test forum name" + And I navigate to "Edit settings" in current page administration When I expand all fieldsets Then I should see "Some grades have already been awarded, so the grade type and scale cannot be changed" # Try saving the form and visiting it back to verify that everything is working ok. And I press "Save and display" And I should not see "When selecting a ratings aggregate type you must also select" - And I click on "Edit settings" "link" in the "Administration" "block" + And I navigate to "Edit settings" in current page administration And I expand all fieldsets And the field "Aggregate type" matches value "Average of ratings" And the field "scale[modgrade_type]" matches value "Scale" @@ -142,7 +143,7 @@ Feature: Using the activity grade form element | grade[modgrade_scale] | ABCDEF | And I follow "Course 1" And I follow "Test assignment name" - And I click on "View all submissions" "link" in the "Administration" "block" + And I navigate to "View all submissions" in current page administration And I click on "Grade" "link" in the "Student 1" "table_row" And I set the field "Grade" to "C" And I press "Save changes" @@ -152,7 +153,7 @@ Feature: Using the activity grade form element Then I should see "Some grades have already been awarded, so the grade type and scale cannot be changed" # Try saving the form and visiting it back to verify everything is working ok. And I press "Save and display" - And I click on "Edit settings" "link" in the "Administration" "block" + And I navigate to "Edit settings" in current page administration And I expand all fieldsets And the field "grade[modgrade_type]" matches value "Scale" And the field "grade[modgrade_scale]" matches value "ABCDEF" @@ -185,7 +186,8 @@ Feature: Using the activity grade form element And I follow "Discussion subject" And I set the field "rating" to "100" And I press "Rate" - And I click on "Edit settings" "link" in the "Administration" "block" + And I follow "Test forum name" + And I navigate to "Edit settings" in current page administration When I expand all fieldsets Then I should see "Some grades have already been awarded, so the grade type cannot be changed. If you wish to change the maximum grade, you must first choose whether or not to rescale existing grades." And I set the field "Maximum grade" to "50" @@ -202,7 +204,7 @@ Feature: Using the activity grade form element | Description | Test assignment description | And I follow "Course 1" And I follow "Test assignment name" - And I click on "View all submissions" "link" in the "Administration" "block" + And I navigate to "View all submissions" in current page administration And I click on "Grade" "link" in the "Student 1" "table_row" And I set the field "Grade out of 100" to "50" And I press "Save changes" diff --git a/lib/form/tests/behat/multi_select_dependencies.feature b/lib/form/tests/behat/multi_select_dependencies.feature new file mode 100644 index 00000000000..4a60d7da545 --- /dev/null +++ b/lib/form/tests/behat/multi_select_dependencies.feature @@ -0,0 +1,25 @@ +@core_form @javascript @_bug_phantomjs +Feature: Forms with a multi select field dependency + In order to test multi select field dependency + As an admin + I need forms field which depends on multiple select options + + Scenario: Field should be enabled only when all select options are selected + # Get to the fixture page. + Given the following "courses" exist: + | fullname | shortname | format | + | Course 1 | C1 | topics | + And the following "activities" exist: + | activity | name | intro | course | idnumber | + | label | L1 | FixtureLink | C1 | label1 | + And I log in as "admin" + And I am on site homepage + And I follow "Course 1" + When I follow "FixtureLink" + Then the "Enter your name" "field" should be disabled + And I set the field "Choose one or more directions" to "South,West" + Then the "Enter your name" "field" should be enabled + And I set the field "Choose one or more directions" to "West" + Then the "Enter your name" "field" should be disabled + And I set the field "Choose one or more directions" to "North,West" + Then the "Enter your name" "field" should be disabled \ No newline at end of file diff --git a/lib/form/tests/fixtures/multi_select_dependencies.php b/lib/form/tests/fixtures/multi_select_dependencies.php new file mode 100644 index 00000000000..a93dfd3fc34 --- /dev/null +++ b/lib/form/tests/fixtures/multi_select_dependencies.php @@ -0,0 +1,68 @@ +. + +/** + * Fixture for Behat test for testing multiple select dependencies. + * + * @package core_form + * @copyright 2016 Rajesh Taneja + * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later + */ + +require(__DIR__ . '/../../../../config.php'); +require_once($CFG->libdir . '/formslib.php'); + +// Behat test fixture only. +defined('BEHAT_SITE_RUNNING') || die('Only available on Behat test server'); + +/** + * Form for testing multiple select dependencies. + * + * @package core_form + * @copyright 2016 Rajesh Taneja + * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later + */ +class test_form extends moodleform { + + /** + * Form definition. + */ + public function definition() { + + $mform = $this->_form; + + $labels = array('North', 'Est', 'South', 'West'); + $select = $mform->addElement('select', 'mselect_name', 'Choose one or more directions', $labels); + $select->setMultiple(true); + + $mform->addElement('text', 'text_name', 'Enter your name'); + $mform->setType('text_name', PARAM_RAW); + + $mform->disabledIf('text_name', 'mselect_name[]', 'neq', array(2, 3)); + + $this->add_action_buttons($cancel = true, $submitlabel = null); + } +} + +$PAGE->set_context(context_system::instance()); +$PAGE->set_url('/lib/form/tests/fixtures/multi_select_dependencies.php'); +$PAGE->set_title('multi_select_dependencies'); + +$mform = new test_form(new moodle_url('/lib/form/tests/fixtures/multi_select_dependencies.php')); + +echo $OUTPUT->header(); +$mform->display(); +echo $OUTPUT->footer(); \ No newline at end of file diff --git a/lib/formslib.php b/lib/formslib.php index 23dce84d276..de7dfca9bd1 100644 --- a/lib/formslib.php +++ b/lib/formslib.php @@ -1362,6 +1362,7 @@ abstract class moodleform { $_FILES = $simulatedsubmittedfiles; if ($formidentifier === null) { $formidentifier = get_called_class(); + $formidentifier = str_replace('\\', '_', $formidentifier); // See MDL-56233 for more information. } $simulatedsubmitteddata['_qf__'.$formidentifier] = 1; $simulatedsubmitteddata['sesskey'] = sesskey(); diff --git a/lib/moodlelib.php b/lib/moodlelib.php index 664cf4072c8..f6b88c42a04 100644 --- a/lib/moodlelib.php +++ b/lib/moodlelib.php @@ -6161,13 +6161,25 @@ function send_confirmation_email($user, $confirmationurl = null) { $subject = get_string('emailconfirmationsubject', '', format_string($site->fullname)); - $username = urlencode($user->username); - $username = str_replace('.', '%2E', $username); // Prevent problems with trailing dots. if (empty($confirmationurl)) { $confirmationurl = '/login/confirm.php'; } - $confirmationurl = new moodle_url($confirmationurl, array('data' => $user->secret .'/'. $username)); - $data->link = $confirmationurl->out(false); + + $confirmationurl = new moodle_url($confirmationurl); + // Remove data parameter just in case it was included in the confirmation so we can add it manually later. + $confirmationurl->remove_params('data'); + $confirmationpath = $confirmationurl->out(false); + + // We need to custom encode the username to include trailing dots in the link. + // Because of this custom encoding we can't use moodle_url directly. + // Determine if a query string is present in the confirmation url. + $hasquerystring = strpos($confirmationpath, '?') !== false; + // Perform normal url encoding of the username first. + $username = urlencode($user->username); + // Prevent problems with trailing dots not being included as part of link in some mail clients. + $username = str_replace('.', '%2E', $username); + + $data->link = $confirmationpath . ( $hasquerystring ? '&' : '?') . 'data='. $user->secret .'/'. $username; $message = get_string('emailconfirmation', '', $data); $messagehtml = text_to_html(get_string('emailconfirmation', '', $data), false, false, true); diff --git a/lib/tests/behat/behat_data_generators.php b/lib/tests/behat/behat_data_generators.php index 4d7263a2db6..b54e3d6ae6a 100644 --- a/lib/tests/behat/behat_data_generators.php +++ b/lib/tests/behat/behat_data_generators.php @@ -163,7 +163,7 @@ class behat_data_generators extends behat_base { 'question categories' => array( 'datagenerator' => 'question_category', 'required' => array('name', 'contextlevel', 'reference'), - 'switchids' => array('questioncategory' => 'category') + 'switchids' => array('questioncategory' => 'parent') ), 'questions' => array( 'datagenerator' => 'question', diff --git a/lib/tests/behat/behat_navigation.php b/lib/tests/behat/behat_navigation.php index f4ae59a0b9c..a5b37569652 100644 --- a/lib/tests/behat/behat_navigation.php +++ b/lib/tests/behat/behat_navigation.php @@ -225,18 +225,38 @@ class behat_navigation extends behat_base { * * @Given /^I navigate to "(?P(?:[^"]|\\")*)" node in "(?P(?:[^"]|\\")*)"$/ * + * @todo MDL-57281 deprecate in Moodle 3.1 + * * @throws ExpectationException * @param string $nodetext navigation node to click. * @param string $parentnodes comma seperated list of parent nodes. * @return void */ public function i_navigate_to_node_in($nodetext, $parentnodes) { + // This step needs to be deprecated and replaced with one of: + // - I navigate to "PATH" in current page administration + // - I navigate to "PATH" in site administration + // - I navigate to course participants + // - I navigate to "PATH" in the course gradebook + // - I click on "LINK" "link" in the "Navigation" "block" . + $parentnodes = array_map('trim', explode('>', $parentnodes)); + $this->select_node_in_navigation($nodetext, $parentnodes); + } + /** + * Finds a node in the Navigation or Administration tree + * + * @param string $nodetext + * @param array $parentnodes + * @param string $nodetype node type (link or text) + * @return NodeElement|null + * @throws ExpectationException when one of the parent nodes is not found + */ + protected function find_node_in_navigation($nodetext, $parentnodes, $nodetype = 'link') { // Site admin is different and needs special treatment. $siteadminstr = get_string('administrationsite'); // Create array of all parentnodes. - $parentnodes = array_map('trim', explode('>', $parentnodes)); $countparentnode = count($parentnodes); // If JS is disabled and Site administration is not expanded we @@ -298,10 +318,21 @@ class behat_navigation extends behat_base { // Finally, click on requested node under navigation. $nodetextliteral = behat_context_helper::escape($nodetext); + $tagname = ($nodetype === 'link') ? 'a' : 'span'; $xpath = "/ul/li/p[contains(concat(' ', normalize-space(@class), ' '), ' tree_item ')]" . - "/a[normalize-space(.)=" . $nodetextliteral . "]"; - $nodetoclick = $node->find('xpath', $xpath); + "/{$tagname}[normalize-space(.)=" . $nodetextliteral . "]"; + return $node->find('xpath', $xpath); + } + /** + * Finds a node in the Navigation or Administration tree and clicks on it. + * + * @param string $nodetext + * @param array $parentnodes + * @throws ExpectationException + */ + protected function select_node_in_navigation($nodetext, $parentnodes) { + $nodetoclick = $this->find_node_in_navigation($nodetext, $parentnodes); // Throw exception if no node found. if (!$nodetoclick) { throw new ExpectationException('Navigation node "' . $nodetext . '" not found under "' . @@ -415,4 +446,91 @@ class behat_navigation extends behat_base { $this->execute('behat_general::i_click_on', array(".btn-navbar", "css_element")); } + + /** + * Go to current page setting item + * + * This can be used on front page, course, category or modules pages. + * + * @Given /^I navigate to "(?P(?:[^"]|\\")*)" in current page administration$/ + * + * @throws ExpectationException + * @param string $nodetext navigation node to click, may contain path, for example "Reports > Overview" + * @return void + */ + public function i_navigate_to_in_current_page_administration($nodetext) { + $parentnodes = array_map('trim', explode('>', $nodetext)); + // Find the name of the first category of the administration block tree. + $xpath = '//div[contains(@class,\'block_settings\')]//div[@id=\'settingsnav\']/ul/li[1]/p[1]/span'; + $node = $this->find('xpath', $xpath); + array_unshift($parentnodes, $node->getText()); + $lastnode = array_pop($parentnodes); + $this->select_node_in_navigation($lastnode, $parentnodes); + } + + /** + * Checks that current page administration contains text + * + * @Given /^"(?P(?:[^"]|\\")*)" "(?P[^"]*)" should exist in current page administration$/ + * + * @throws ExpectationException + * @param string $element The locator of the specified selector. + * This may be a path, for example "Subscription mode > Forced subscription" + * @param string $selectortype The selector type (link or text) + * @return void + */ + public function should_exist_in_current_page_administration($element, $selectortype) { + $parentnodes = array_map('trim', explode('>', $element)); + // Find the name of the first category of the administration block tree. + $xpath = '//div[contains(@class,\'block_settings\')]//div[@id=\'settingsnav\']/ul/li[1]/p[1]/span'; + $node = $this->find('xpath', $xpath); + array_unshift($parentnodes, $node->getText()); + $lastnode = array_pop($parentnodes); + + if (!$this->find_node_in_navigation($lastnode, $parentnodes, strtolower($selectortype))) { + throw new ExpectationException(ucfirst($selectortype) . ' "' . $element . + '" not found in current page administration"', $this->getSession()); + } + } + + /** + * Checks that current page administration contains text + * + * @Given /^"(?P(?:[^"]|\\")*)" "(?P[^"]*)" should not exist in current page administration$/ + * + * @throws ExpectationException + * @param string $element The locator of the specified selector. + * This may be a path, for example "Subscription mode > Forced subscription" + * @param string $selectortype The selector type (link or text) + * @return void + */ + public function should_not_exist_in_current_page_administration($element, $selectortype) { + $parentnodes = array_map('trim', explode('>', $element)); + // Find the name of the first category of the administration block tree. + $xpath = '//div[contains(@class,\'block_settings\')]//div[@id=\'settingsnav\']/ul/li[1]/p[1]/span'; + $node = $this->find('xpath', $xpath); + array_unshift($parentnodes, $node->getText()); + $lastnode = array_pop($parentnodes); + + if ($this->find_node_in_navigation($lastnode, $parentnodes, strtolower($selectortype))) { + throw new ExpectationException(ucfirst($selectortype) . ' "' . $element . + '" found in current page administration"', $this->getSession()); + } + } + + /** + * Go to site administration item + * + * @Given /^I navigate to "(?P(?:[^"]|\\")*)" in site administration$/ + * + * @throws ExpectationException + * @param string $nodetext navigation node to click, may contain path, for example "Reports > Overview" + * @return void + */ + public function i_navigate_to_in_site_administration($nodetext) { + $parentnodes = array_map('trim', explode('>', $nodetext)); + array_unshift($parentnodes, get_string('administrationsite')); + $lastnode = array_pop($parentnodes); + $this->select_node_in_navigation($lastnode, $parentnodes); + } } diff --git a/lib/tests/event_test.php b/lib/tests/event_test.php index f260cc61818..a2f2c2f1780 100644 --- a/lib/tests/event_test.php +++ b/lib/tests/event_test.php @@ -870,17 +870,23 @@ class core_event_testcase extends advanced_testcase { $observers = \core\event\manager::get_all_observers(); // Expected information from the workshop allocation scheduled observer. - $expected = array(); - $observer = new stdClass(); - $observer->callable = '\workshopallocation_scheduled\observer::workshop_viewed'; - $observer->priority = 0; - $observer->internal = true; - $observer->includefile = null; - $observer->plugintype = 'workshopallocation'; - $observer->plugin = 'scheduled'; - $expected[0] = $observer; + $expected = new stdClass(); + $expected->callable = '\workshopallocation_scheduled\observer::workshop_viewed'; + $expected->priority = 0; + $expected->internal = true; + $expected->includefile = null; + $expected->plugintype = 'workshopallocation'; + $expected->plugin = 'scheduled'; - $this->assertEquals($expected, $observers['\mod_workshop\event\course_module_viewed']); + // May be more than one observer for the mod_workshop event. + $found = false; + foreach ($observers['\mod_workshop\event\course_module_viewed'] as $observer) { + if ($expected == $observer) { + $found = true; + break; + } + } + $this->assertTrue($found); } /** diff --git a/lib/tests/fixtures/namespaced_form.php b/lib/tests/fixtures/namespaced_form.php new file mode 100644 index 00000000000..f6e63b19cb3 --- /dev/null +++ b/lib/tests/fixtures/namespaced_form.php @@ -0,0 +1,49 @@ +. + +/** + * A form inside a namespace to be used by unit tests. + * + * See issue MDL-56233 + * + * @package core + * @author Daniel Thee Roperto + * @copyright 2016 Catalyst IT + * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later + */ + +namespace local_unittests\namespaced_form; + +defined('MOODLE_INTERNAL') || die(); + +/** + * exampleform class. + * + * @package core + * @author Daniel Thee Roperto + * @copyright 2016 Catalyst IT + * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later + */ +class exampleform extends \moodleform { + /** + * Create a simple form definition. + */ + public function definition() { + $mform = $this->_form; + $mform->addElement('text', 'title', 'title_value'); + $mform->setType('title', PARAM_TEXT); + } +} diff --git a/lib/tests/formslib_test.php b/lib/tests/formslib_test.php index 842d02b3d16..155fe3d1b9b 100644 --- a/lib/tests/formslib_test.php +++ b/lib/tests/formslib_test.php @@ -629,6 +629,23 @@ class core_formslib_testcase extends advanced_testcase { $this->assertFalse($form->is_validated()); $this->assertNull($form->get_data()); } + + /** + * MDL-56233 - Tests mocking a form inside a namespace. + */ + public function test_mock_submit() { + require_once(__DIR__.'/fixtures/namespaced_form.php'); + \local_unittests\namespaced_form\exampleform::mock_submit(['title' => 'Mocked Value']); + $form = new \local_unittests\namespaced_form\exampleform(); + + // Here is the problem, this is the expected hidden field name. + $expected = '_qf__local_unittests_namespaced_form_exampleform'; + self::assertArrayHasKey($expected, $_POST); + + // This should work now, before it would fail. + self::assertTrue($form->is_submitted()); + self::assertSame('Mocked Value', $form->get_data()->title); + } } diff --git a/lib/tests/moodlelib_test.php b/lib/tests/moodlelib_test.php index af169a5de5e..f7e7352eaa6 100644 --- a/lib/tests/moodlelib_test.php +++ b/lib/tests/moodlelib_test.php @@ -2892,6 +2892,149 @@ class core_moodlelib_testcase extends advanced_testcase { $this->assertEventContextNotUsed($event); } + /** + * Data provider for test_generate_confirmation_link + * @return Array of confirmation urls and expected resultant confirmation links + */ + public function generate_confirmation_link_provider() { + global $CFG; + return [ + "Simple name" => [ + "username" => "simplename", + "confirmationurl" => null, + "expected" => $CFG->wwwroot . "/login/confirm.php?data=/simplename" + ], + "Period in between words in username" => [ + "username" => "period.inbetween", + "confirmationurl" => null, + "expected" => $CFG->wwwroot . "/login/confirm.php?data=/period%2Einbetween" + ], + "Trailing periods in username" => [ + "username" => "trailingperiods...", + "confirmationurl" => null, + "expected" => $CFG->wwwroot . "/login/confirm.php?data=/trailingperiods%2E%2E%2E" + ], + "At symbol in username" => [ + "username" => "at@symbol", + "confirmationurl" => null, + "expected" => $CFG->wwwroot . "/login/confirm.php?data=/at%40symbol" + ], + "Dash symbol in username" => [ + "username" => "has-dash", + "confirmationurl" => null, + "expected" => $CFG->wwwroot . "/login/confirm.php?data=/has-dash" + ], + "Underscore in username" => [ + "username" => "under_score", + "confirmationurl" => null, + "expected" => $CFG->wwwroot . "/login/confirm.php?data=/under_score" + ], + "Many different characters in username" => [ + "username" => "many_-.@characters@_@-..-..", + "confirmationurl" => null, + "expected" => $CFG->wwwroot . "/login/confirm.php?data=/many_-%2E%40characters%40_%40-%2E%2E-%2E%2E" + ], + "Custom relative confirmation url" => [ + "username" => "many_-.@characters@_@-..-..", + "confirmationurl" => "/custom/local/url.php", + "expected" => $CFG->wwwroot . "/custom/local/url.php?data=/many_-%2E%40characters%40_%40-%2E%2E-%2E%2E" + ], + "Custom relative confirmation url with parameters" => [ + "username" => "many_-.@characters@_@-..-..", + "confirmationurl" => "/custom/local/url.php?with=param", + "expected" => $CFG->wwwroot . "/custom/local/url.php?with=param&data=/many_-%2E%40characters%40_%40-%2E%2E-%2E%2E" + ], + "Custom local confirmation url" => [ + "username" => "many_-.@characters@_@-..-..", + "confirmationurl" => $CFG->wwwroot . "/custom/local/url.php", + "expected" => $CFG->wwwroot . "/custom/local/url.php?data=/many_-%2E%40characters%40_%40-%2E%2E-%2E%2E" + ], + "Custom local confirmation url with parameters" => [ + "username" => "many_-.@characters@_@-..-..", + "confirmationurl" => $CFG->wwwroot . "/custom/local/url.php?with=param", + "expected" => $CFG->wwwroot . "/custom/local/url.php?with=param&data=/many_-%2E%40characters%40_%40-%2E%2E-%2E%2E" + ], + "Custom external confirmation url" => [ + "username" => "many_-.@characters@_@-..-..", + "confirmationurl" => "http://moodle.org/custom/external/url.php", + "expected" => "http://moodle.org/custom/external/url.php?data=/many_-%2E%40characters%40_%40-%2E%2E-%2E%2E" + ], + "Custom external confirmation url with parameters" => [ + "username" => "many_-.@characters@_@-..-..", + "confirmationurl" => "http://moodle.org/ext.php?with=some¶m=eters", + "expected" => "http://moodle.org/ext.php?with=some¶m=eters&data=/many_-%2E%40characters%40_%40-%2E%2E-%2E%2E" + ], + "Custom external confirmation url with parameters" => [ + "username" => "many_-.@characters@_@-..-..", + "confirmationurl" => "http://moodle.org/ext.php?with=some&data=test", + "expected" => "http://moodle.org/ext.php?with=some&data=/many_-%2E%40characters%40_%40-%2E%2E-%2E%2E" + ], + ]; + } + + /** + * Test generate_confirmation_link + * @dataProvider generate_confirmation_link_provider + * @param string $username The name of the user + * @param string $confirmationurl The url the user should go to to confirm + * @param string $expected The expected url of the confirmation link + */ + public function test_generate_confirmation_link($username, $confirmationurl, $expected) { + $this->resetAfterTest(); + $sink = $this->redirectEmails(); + + $user = $this->getDataGenerator()->create_user( + [ + "username" => $username, + "confirmed" => false, + "email" => 'test@example.com', + ] + ); + + send_confirmation_email($user, $confirmationurl); + $sink->close(); + $messages = $sink->get_messages(); + $message = array_shift($messages); + $messagebody = quoted_printable_decode($message->body); + + $this->assertContains($expected, $messagebody); + } + + /** + * Test generate_confirmation_link with custom admin link + */ + public function test_generate_confirmation_link_with_custom_admin() { + global $CFG; + + $this->resetAfterTest(); + $sink = $this->redirectEmails(); + + $admin = $CFG->admin; + $CFG->admin = 'custom/admin/path'; + + $user = $this->getDataGenerator()->create_user( + [ + "username" => "many_-.@characters@_@-..-..", + "confirmed" => false, + "email" => 'test@example.com', + ] + ); + $confirmationurl = "/admin/test.php?with=params"; + $expected = $CFG->wwwroot . "/" . $CFG->admin . "/test.php?with=params&data=/many_-%2E%40characters%40_%40-%2E%2E-%2E%2E"; + + send_confirmation_email($user, $confirmationurl); + $sink->close(); + $messages = $sink->get_messages(); + $message = array_shift($messages); + $messagebody = quoted_printable_decode($message->body); + + $sink->close(); + $this->assertContains($expected, $messagebody); + + $CFG->admin = $admin; + } + + /** * Test remove_course_content deletes course contents * TODO Add asserts to verify other data related to course is deleted as well. diff --git a/login/signup.php b/login/signup.php index ad7d9454246..e14518006cd 100644 --- a/login/signup.php +++ b/login/signup.php @@ -44,8 +44,16 @@ $PAGE->https_required(); $PAGE->set_url('/login/signup.php'); $PAGE->set_context(context_system::instance()); -// Override wanted URL, we do not want to end up here again if user clicks "Login". -$SESSION->wantsurl = $CFG->wwwroot . '/'; +// If wantsurl is empty or /login/signup.php, override wanted URL. +// We do not want to end up here again if user clicks "Login". +if (empty($SESSION->wantsurl)) { + $SESSION->wantsurl = $CFG->wwwroot . '/'; +} else { + $wantsurl = new moodle_url($SESSION->wantsurl); + if ($PAGE->url->compare($wantsurl, URL_MATCH_BASE)) { + $SESSION->wantsurl = $CFG->wwwroot . '/'; + } +} if (isloggedin() and !isguestuser()) { // Prevent signing up when already logged in. diff --git a/login/tests/behat/change_password.feature b/login/tests/behat/change_password.feature index 0bddba3dd9f..2b24b35bb1c 100644 --- a/login/tests/behat/change_password.feature +++ b/login/tests/behat/change_password.feature @@ -49,9 +49,7 @@ Feature: Change password And the following "course enrolments" exist: | user | course | role | | testuser | c1 | student | - And I am on site homepage - And I expand "Courses" node - When I follow "Course 1" + When I follow "Log in" And I set the field "Username" to "testuser" And I set the field "Password" to "testuser" And I press "Log in" diff --git a/message/amd/build/message_area_messages.min.js b/message/amd/build/message_area_messages.min.js index f9076d24b81..0451bee952f 100644 --- a/message/amd/build/message_area_messages.min.js +++ b/message/amd/build/message_area_messages.min.js @@ -1 +1 @@ -define(["jquery","core/ajax","core/templates","core/notification","core/custom_interaction_events","core/auto_rows","core_message/message_area_actions","core/modal_factory","core/modal_events","core/str","core_message/message_area_events","core/backoff_timer"],function(a,b,c,d,e,f,g,h,i,j,k,l){function m(a){this.messageArea=a,this._init()}var n=500,o=50,p={BLOCKTIME:"[data-region='blocktime']",CANCELDELETEMESSAGES:"[data-action='cancel-delete-messages']",CONTACT:"[data-region='contact']",CONVERSATIONS:"[data-region='contacts'][data-region-content='conversations']",DELETEALLMESSAGES:"[data-action='delete-all-messages']",DELETEMESSAGES:"[data-action='delete-messages']",LOADINGICON:".loading-icon",MESSAGE:"[data-region='message']",MESSAGERESPONSE:"[data-region='response']",MESSAGES:"[data-region='messages']",MESSAGESAREA:"[data-region='messages-area']",MESSAGINGAREA:"[data-region='messaging-area']",SENDMESSAGE:"[data-action='send-message']",SENDMESSAGETEXT:"[data-region='send-message-txt']",SHOWCONTACTS:"[data-action='show-contacts']",STARTDELETEMESSAGES:"[data-action='start-delete-messages']"},q=1e3;return m.prototype._isSendingMessage=!1,m.prototype._isLoadingMessages=!1,m.prototype._numMessagesDisplayed=0,m.prototype._numMessagesToRetrieve=20,m.prototype._confirmationModal=null,m.prototype._latestMessageTimestamp=0,m.prototype._backoffTimer=null,m.prototype.messageArea=null,m.prototype._init=function(){e.define(this.messageArea.node,[e.events.activate,e.events.up,e.events.down,e.events.enter]),a(window).height()<=670&&(n=400),f.init(this.messageArea.node),this.messageArea.onCustomEvent(k.CONVERSATIONSELECTED,this._viewMessages.bind(this)),this.messageArea.onCustomEvent(k.SENDMESSAGE,this._viewMessages.bind(this)),this.messageArea.onCustomEvent(k.CHOOSEMESSAGESTODELETE,this._chooseMessagesToDelete.bind(this)),this.messageArea.onCustomEvent(k.CANCELDELETEMESSAGES,this._hideDeleteAction.bind(this)),this.messageArea.onDelegateEvent(e.events.activate,p.SENDMESSAGE,this._sendMessage.bind(this)),this.messageArea.onDelegateEvent(e.events.activate,p.STARTDELETEMESSAGES,this._startDeleting.bind(this)),this.messageArea.onDelegateEvent(e.events.activate,p.DELETEMESSAGES,this._deleteMessages.bind(this)),this.messageArea.onDelegateEvent(e.events.activate,p.DELETEALLMESSAGES,this._deleteAllMessages.bind(this)),this.messageArea.onDelegateEvent(e.events.activate,p.CANCELDELETEMESSAGES,this._triggerCancelMessagesToDelete.bind(this)),this.messageArea.onDelegateEvent(e.events.activate,p.MESSAGE,this._toggleMessage.bind(this)),this.messageArea.onDelegateEvent(e.events.activate,p.SHOWCONTACTS,this._hideMessagingArea.bind(this)),this.messageArea.onDelegateEvent(e.events.up,p.MESSAGE,this._selectPreviousMessage.bind(this)),this.messageArea.onDelegateEvent(e.events.down,p.MESSAGE,this._selectNextMessage.bind(this)),this.messageArea.onDelegateEvent("focus",p.SENDMESSAGETEXT,this._setMessaging.bind(this)),this.messageArea.onDelegateEvent("blur",p.SENDMESSAGETEXT,this._clearMessaging.bind(this)),this.messageArea.onDelegateEvent(e.events.enter,p.SENDMESSAGETEXT,this._sendMessageHandler.bind(this)),a(document).on(f.events.ROW_CHANGE,this._adjustMessagesAreaHeight.bind(this));var b=this.messageArea.find(p.MESSAGES);b.length&&(this._addScrollEventListener(b.find(p.MESSAGE).length),this._latestMessageTimestamp=b.find(p.MESSAGE+":last").data("timecreated")),this._backoffTimer=new l(this._loadNewMessages.bind(this),l.getIncrementalCallback(this.messageArea.pollmin*q,q,this.messageArea.pollmax*q,this.messageArea.polltimeout*q)),this._backoffTimer.start()},m.prototype._viewMessages=function(e,f){this._numMessagesDisplayed=0,this._backoffTimer.stop(),this._latestMessageTimestamp=0;var g=b.call([{methodname:"core_message_mark_all_messages_as_read",args:{useridto:this.messageArea.getCurrentUserId(),useridfrom:f}}]),h=0;return c.render("core/loading",{}).then(function(a,b){return c.replaceNodeContents(this.messageArea.find(p.MESSAGESAREA),a,b),g[0]}.bind(this)).then(function(){var b=this.messageArea.find(p.CONVERSATIONS+" "+p.CONTACT+"[data-userid='"+f+"']");return b.hasClass("unread")&&(b.removeClass("unread"),a(document).trigger("messagearea:conversationselected",f)),this._getMessages(f)}.bind(this)).then(function(a){return h=a.messages.length,c.render("core_message/message_area_messages_area",a)}).then(function(a,b){c.replaceNodeContents(this.messageArea.find(p.MESSAGESAREA),a,b),this._addScrollEventListener(h),this._backoffTimer.restart(),this.messageArea.find(p.SENDMESSAGETEXT).focus()}.bind(this)).fail(d.exception)},m.prototype._loadMessages=function(){if(this._isLoadingMessages)return!1;this._isLoadingMessages=!0;var b=0;return c.render("core/loading",{}).then(function(a,b){return c.prependNodeContents(this.messageArea.find(p.MESSAGES),"
"+a+"
",b),this._getMessages(this._getUserId())}.bind(this)).then(function(a){return b=a.messages.length,c.render("core_message/message_area_messages",a)}).then(function(d,e){if(this.messageArea.find(p.MESSAGES+" "+p.LOADINGICON).remove(),b>0){var f=this.messageArea.node.find(p.BLOCKTIME+":first"),g=a(d).find(p.BLOCKTIME+":first").addBack();f.html()==g.html()&&f.remove();var h=this.messageArea.find(p.MESSAGES)[0].scrollHeight;c.prependNodeContents(this.messageArea.find(p.MESSAGES),d,e);var i=this.messageArea.find(p.MESSAGES)[0].scrollHeight;this.messageArea.find(p.MESSAGES).scrollTop(i-h),this._numMessagesDisplayed+=b}this._isLoadingMessages=!1}.bind(this)).fail(d.exception)},m.prototype._loadNewMessages=function(){if(this._isLoadingMessages)return!1;if(!this._getUserId())return!1;this._isLoadingMessages=!0;var b=!1,e=this.messageArea.find(p.MESSAGES);if(0!==e.length){var f=e.scrollTop(),g=e.innerHeight(),h=e[0].scrollHeight;f+g>=h&&(b=!0)}var i=0;return this._getMessages(this._getUserId(),!0).then(function(a){var b=this.messageArea.find(p.MESSAGES);return a.messages=a.messages.filter(function(a){var c=""+a.id+a.isread,d=b.find(p.MESSAGE+'[data-id="'+c+'"]');return!d.length}),i=a.messages.length,c.render("core_message/message_area_messages",a)}.bind(this)).then(function(d,e){i>0&&(d=a(d),d.find(p.BLOCKTIME).remove(),c.appendNodeContents(this.messageArea.find(p.MESSAGES),d,e),b&&this._scrollBottom(),this._numMessagesDisplayed+=i,this._backoffTimer.restart())}.bind(this)).always(function(){this._isLoadingMessages=!1}.bind(this)).fail(d.exception)},m.prototype._getMessages=function(a,c){var e={currentuserid:this.messageArea.getCurrentUserId(),otheruserid:a,limitfrom:this._numMessagesDisplayed,limitnum:this._numMessagesToRetrieve,newest:!0};c&&(e.timefrom=this._latestMessageTimestamp,e.limitfrom=0,e.limitnum=0);var f=b.call([{methodname:"core_message_data_for_messagearea_messages",args:e}]);return f[0].then(function(a){var b=a.messages;if(b&&b.length){var c=b[b.length-1];c.timecreated>this._latestMessageTimestamp&&(this._latestMessageTimestamp=c.timecreated+1)}return a}.bind(this)).fail(function(a){this._backoffTimer.stop(),d.exception(a)}.bind(this))},m.prototype._sendMessage=function(){var a=this.messageArea.find(p.SENDMESSAGETEXT),c=a.val();if(""===c.trim())return!1;if(this._isSendingMessage)return!1;this._isSendingMessage=!0;var e=b.call([{methodname:"core_message_send_instant_messages",args:{messages:[{touserid:this._getUserId(),text:c}]}}]);return a.prop("disabled",!0),e[0].then(function(a){if(a.length<0)throw new Error("Invalid response");if(a[0].errormessage)throw new Error(a[0].errormessage);return this.messageArea.trigger(k.MESSAGESENT,[this._getUserId(),c]),this._addMessageToDom()}.bind(this)).then(function(){this._isSendingMessage=!1}.bind(this)).always(function(){a.prop("disabled",!1),a.focus()}).fail(d.exception)},m.prototype._chooseMessagesToDelete=function(){this.messageArea.find(p.MESSAGESAREA).addClass("editing"),this.messageArea.find(p.MESSAGE).attr("role","checkbox").attr("aria-checked","false")},m.prototype._deleteMessages=function(){var c=this.messageArea.getCurrentUserId(),e=this.messageArea.find(p.MESSAGE+"[aria-checked='true']"),f=[],g=[];e.each(function(b,d){var e=a(d),h=e.data("messageid"),i=e.data("messageread")?1:0;g.push(e),f.push({methodname:"core_message_delete_message",args:{messageid:h,userid:c,read:i}})}),f.length>0?b.call(f)[f.length-1].then(function(){var b=null,c=this.messageArea.find(p.MESSAGE),d=c.last(),e=g[g.length-1];a.each(g,function(a,b){b.remove()}),d.data("id")===e.data("id")&&(b=this.messageArea.find(p.MESSAGE).last()),a.each(g,function(a,b){var c=b.data("blocktime");0===this.messageArea.find(p.MESSAGE+"[data-blocktime='"+c+"']").length&&this.messageArea.find(p.BLOCKTIME+"[data-blocktime='"+c+"']").remove()}.bind(this)),0===this.messageArea.find(p.MESSAGE).length&&this.messageArea.find(p.CONVERSATIONS+" "+p.CONTACT+"[data-userid='"+this._getUserId()+"']").remove(),this.messageArea.trigger(k.MESSAGESDELETED,[this._getUserId(),b])}.bind(this),d.exception):this.messageArea.trigger(k.MESSAGESDELETED,this._getUserId()),this._hideDeleteAction()},m.prototype._addScrollEventListener=function(a){this._scrollBottom(),this._numMessagesDisplayed=a,e.define(this.messageArea.find(p.MESSAGES),[e.events.scrollTop]),this.messageArea.onCustomEvent(e.events.scrollTop,this._loadMessages.bind(this))},m.prototype._deleteAllMessages=function(){this._confirmationModal?this._confirmationModal.show():j.get_strings([{key:"confirm"},{key:"deleteallconfirm",component:"message"}]).done(function(a){h.create({title:a[0],type:h.types.CONFIRM,body:a[1]},this.messageArea.find(p.DELETEALLMESSAGES)).done(function(a){this._confirmationModal=a,a.getRoot().on(i.yes,function(){var a=this._getUserId(),c={methodname:"core_message_delete_conversation",args:{userid:this.messageArea.getCurrentUserId(),otheruserid:a}};b.call([c])[0].then(function(){this.messageArea.find(p.MESSAGESAREA).empty(),this.messageArea.trigger(k.CONVERSATIONDELETED,a),this._hideDeleteAction()}.bind(this),d.exception)}.bind(this)),a.show()}.bind(this))}.bind(this))},m.prototype._hideDeleteAction=function(){this.messageArea.find(p.MESSAGE).removeAttr("role").removeAttr("aria-checked"),this.messageArea.find(p.MESSAGESAREA).removeClass("editing")},m.prototype._triggerCancelMessagesToDelete=function(){this.messageArea.trigger(k.CANCELDELETEMESSAGES)},m.prototype._addMessageToDom=function(){var a=b.call([{methodname:"core_message_data_for_messagearea_get_most_recent_message",args:{currentuserid:this.messageArea.getCurrentUserId(),otheruserid:this._getUserId()}}]);return a[0].then(function(a){return c.render("core_message/message_area_message",a)}).then(function(a,b){c.appendNodeContents(this.messageArea.find(p.MESSAGES),a,b),this.messageArea.find(p.SENDMESSAGETEXT).val("").trigger("input"),this._scrollBottom()}.bind(this)).fail(d.exception)},m.prototype._getUserId=function(){return this.messageArea.find(p.MESSAGES).data("userid")},m.prototype._scrollBottom=function(){var a=this.messageArea.find(p.MESSAGES);0!==a.length&&a.scrollTop(a[0].scrollHeight)},m.prototype._selectPreviousMessage=function(b,c){var d=a(b.target).closest(p.MESSAGE);do d=d.prev();while(d.length&&!d.is(p.MESSAGE));d.focus(),c.originalEvent.preventDefault(),c.originalEvent.stopPropagation()},m.prototype._selectNextMessage=function(b,c){var d=a(b.target).closest(p.MESSAGE);do d=d.next();while(d.length&&!d.is(p.MESSAGE));d.focus(),c.originalEvent.preventDefault(),c.originalEvent.stopPropagation()},m.prototype._setMessaging=function(b){a(b.target).closest(p.MESSAGERESPONSE).addClass("messaging")},m.prototype._clearMessaging=function(b){a(b.target).closest(p.MESSAGERESPONSE).removeClass("messaging")},m.prototype._startDeleting=function(a){var b=new g(this.messageArea);b.chooseMessagesToDelete(),a.preventDefault()},m.prototype._isEditing=function(){return this.messageArea.find(p.MESSAGESAREA).hasClass("editing")},m.prototype._toggleMessage=function(b){if(this._isEditing()){var c=a(b.target).closest(p.MESSAGE);"true"===c.attr("aria-checked")?c.attr("aria-checked","false"):c.attr("aria-checked","true")}},m.prototype._adjustMessagesAreaHeight=function(){var a=this.messageArea.find(p.MESSAGES),b=this.messageArea.find(p.MESSAGERESPONSE),c=b.outerHeight(),d=c-o,e=n-d;a.outerHeight(e)},m.prototype._sendMessageHandler=function(a,b){b.originalEvent.preventDefault(),this._sendMessage()},m.prototype._hideMessagingArea=function(){this.messageArea.find(p.MESSAGINGAREA).removeClass("show-messages").addClass("hide-messages")},m}); \ No newline at end of file +define(["jquery","core/ajax","core/templates","core/notification","core/custom_interaction_events","core/auto_rows","core_message/message_area_actions","core/modal_factory","core/modal_events","core/str","core_message/message_area_events","core/backoff_timer"],function(a,b,c,d,e,f,g,h,i,j,k,l){function m(a){this.messageArea=a,this._init()}var n=500,o=50,p={BLOCKTIME:"[data-region='blocktime']",CANCELDELETEMESSAGES:"[data-action='cancel-delete-messages']",CONTACT:"[data-region='contact']",CONVERSATIONS:"[data-region='contacts'][data-region-content='conversations']",DELETEALLMESSAGES:"[data-action='delete-all-messages']",DELETEMESSAGES:"[data-action='delete-messages']",LOADINGICON:".loading-icon",MESSAGE:"[data-region='message']",MESSAGERESPONSE:"[data-region='response']",MESSAGES:"[data-region='messages']",MESSAGESAREA:"[data-region='messages-area']",MESSAGINGAREA:"[data-region='messaging-area']",SENDMESSAGE:"[data-action='send-message']",SENDMESSAGETEXT:"[data-region='send-message-txt']",SHOWCONTACTS:"[data-action='show-contacts']",STARTDELETEMESSAGES:"[data-action='start-delete-messages']"},q=1e3;return m.prototype._isSendingMessage=!1,m.prototype._isLoadingMessages=!1,m.prototype._numMessagesDisplayed=0,m.prototype._numMessagesToRetrieve=20,m.prototype._confirmationModal=null,m.prototype._latestMessageTimestamp=0,m.prototype._backoffTimer=null,m.prototype.messageArea=null,m.prototype._init=function(){e.define(this.messageArea.node,[e.events.activate,e.events.up,e.events.down,e.events.enter]),a(window).height()<=670&&(n=400),f.init(this.messageArea.node),this.messageArea.onCustomEvent(k.CONVERSATIONSELECTED,this._viewMessages.bind(this)),this.messageArea.onCustomEvent(k.SENDMESSAGE,this._viewMessages.bind(this)),this.messageArea.onCustomEvent(k.CHOOSEMESSAGESTODELETE,this._chooseMessagesToDelete.bind(this)),this.messageArea.onCustomEvent(k.CANCELDELETEMESSAGES,this._hideDeleteAction.bind(this)),this.messageArea.onDelegateEvent(e.events.activate,p.SENDMESSAGE,this._sendMessage.bind(this)),this.messageArea.onDelegateEvent(e.events.activate,p.STARTDELETEMESSAGES,this._startDeleting.bind(this)),this.messageArea.onDelegateEvent(e.events.activate,p.DELETEMESSAGES,this._deleteMessages.bind(this)),this.messageArea.onDelegateEvent(e.events.activate,p.DELETEALLMESSAGES,this._deleteAllMessages.bind(this)),this.messageArea.onDelegateEvent(e.events.activate,p.CANCELDELETEMESSAGES,this._triggerCancelMessagesToDelete.bind(this)),this.messageArea.onDelegateEvent(e.events.activate,p.MESSAGE,this._toggleMessage.bind(this)),this.messageArea.onDelegateEvent(e.events.activate,p.SHOWCONTACTS,this._hideMessagingArea.bind(this)),this.messageArea.onDelegateEvent(e.events.up,p.MESSAGE,this._selectPreviousMessage.bind(this)),this.messageArea.onDelegateEvent(e.events.down,p.MESSAGE,this._selectNextMessage.bind(this)),this.messageArea.onDelegateEvent("focus",p.SENDMESSAGETEXT,this._setMessaging.bind(this)),this.messageArea.onDelegateEvent("blur",p.SENDMESSAGETEXT,this._clearMessaging.bind(this)),this.messageArea.onDelegateEvent(e.events.enter,p.SENDMESSAGETEXT,this._sendMessageHandler.bind(this)),a(document).on(f.events.ROW_CHANGE,this._adjustMessagesAreaHeight.bind(this));var b=this.messageArea.find(p.MESSAGES);b.length&&(this._addScrollEventListener(b.find(p.MESSAGE).length),this._latestMessageTimestamp=b.find(p.MESSAGE+":last").data("timecreated")),this._backoffTimer=new l(this._loadNewMessages.bind(this),l.getIncrementalCallback(this.messageArea.pollmin*q,q,this.messageArea.pollmax*q,this.messageArea.polltimeout*q)),this._backoffTimer.start()},m.prototype._viewMessages=function(e,f){this._numMessagesDisplayed=0,this._backoffTimer.stop(),this._latestMessageTimestamp=0;var g=b.call([{methodname:"core_message_mark_all_messages_as_read",args:{useridto:this.messageArea.getCurrentUserId(),useridfrom:f}}]),h=0;return c.render("core/loading",{}).then(function(a,b){return c.replaceNodeContents(this.messageArea.find(p.MESSAGESAREA),a,b),g[0]}.bind(this)).then(function(){var b=this.messageArea.find(p.CONVERSATIONS+" "+p.CONTACT+"[data-userid='"+f+"']");return b.hasClass("unread")&&(b.removeClass("unread"),a(document).trigger("messagearea:conversationselected",f)),this._getMessages(f)}.bind(this)).then(function(a){return h=a.messages.length,c.render("core_message/message_area_messages_area",a)}).then(function(a,b){c.replaceNodeContents(this.messageArea.find(p.MESSAGESAREA),a,b),this._addScrollEventListener(h),this._backoffTimer.restart(),this.messageArea.find(p.SENDMESSAGETEXT).focus()}.bind(this)).fail(d.exception)},m.prototype._loadMessages=function(){if(this._isLoadingMessages)return!1;this._isLoadingMessages=!0;var b=0;return c.render("core/loading",{}).then(function(a,b){return c.prependNodeContents(this.messageArea.find(p.MESSAGES),"
"+a+"
",b),this._getMessages(this._getUserId())}.bind(this)).then(function(a){return b=a.messages.length,c.render("core_message/message_area_messages",a)}).then(function(d,e){if(this.messageArea.find(p.MESSAGES+" "+p.LOADINGICON).remove(),b>0){var f=a("
"+d+"
");this._hasMatchingBlockTime(this.messageArea.node,f,!0)&&this.messageArea.node.find(p.BLOCKTIME+":first").remove();var g=this.messageArea.find(p.MESSAGES)[0].scrollHeight;c.prependNodeContents(this.messageArea.find(p.MESSAGES),d,e);var h=this.messageArea.find(p.MESSAGES)[0].scrollHeight;this.messageArea.find(p.MESSAGES).scrollTop(h-g),this._numMessagesDisplayed+=b}this._isLoadingMessages=!1}.bind(this)).fail(d.exception)},m.prototype._loadNewMessages=function(){if(this._isLoadingMessages)return!1;if(!this._getUserId())return!1;this._isLoadingMessages=!0;var b=!1,e=this.messageArea.find(p.MESSAGES);if(0!==e.length){var f=e.scrollTop(),g=e.innerHeight(),h=e[0].scrollHeight;f+g>=h&&(b=!0)}var i=0;return this._getMessages(this._getUserId(),!0).then(function(a){var b=this.messageArea.find(p.MESSAGES);return a.messages=a.messages.filter(function(a){var c=""+a.id+a.isread,d=b.find(p.MESSAGE+'[data-id="'+c+'"]');return!d.length}),i=a.messages.length,c.render("core_message/message_area_messages",a)}.bind(this)).then(function(d,e){if(i>0){var f=a("
"+d+"
");this._hasMatchingBlockTime(this.messageArea.node,f,!1)&&f.find(p.BLOCKTIME+":first").remove(),c.appendNodeContents(this.messageArea.find(p.MESSAGES),f,e),b&&this._scrollBottom(),this._numMessagesDisplayed+=i,this._backoffTimer.restart()}}.bind(this)).always(function(){this._isLoadingMessages=!1}.bind(this)).fail(d.exception)},m.prototype._getMessages=function(a,c){var e={currentuserid:this.messageArea.getCurrentUserId(),otheruserid:a,limitfrom:this._numMessagesDisplayed,limitnum:this._numMessagesToRetrieve,newest:!0};c&&(e.timefrom=this._latestMessageTimestamp,e.limitfrom=0,e.limitnum=0);var f=b.call([{methodname:"core_message_data_for_messagearea_messages",args:e}]);return f[0].then(function(a){var b=a.messages;if(b&&b.length){var c=b[b.length-1];c.timecreated>this._latestMessageTimestamp&&(this._latestMessageTimestamp=c.timecreated+1)}return a}.bind(this)).fail(function(a){this._backoffTimer.stop(),d.exception(a)}.bind(this))},m.prototype._sendMessage=function(){var a=this.messageArea.find(p.SENDMESSAGETEXT),c=a.val();if(""===c.trim())return!1;if(this._isSendingMessage)return!1;this._isSendingMessage=!0;var e=b.call([{methodname:"core_message_send_instant_messages",args:{messages:[{touserid:this._getUserId(),text:c}]}}]);return a.prop("disabled",!0),e[0].then(function(a){if(a.length<0)throw new Error("Invalid response");if(a[0].errormessage)throw new Error(a[0].errormessage);return this.messageArea.trigger(k.MESSAGESENT,[this._getUserId(),c]),this._addMessageToDom()}.bind(this)).then(function(){this._isSendingMessage=!1}.bind(this)).always(function(){a.prop("disabled",!1),a.focus()}).fail(d.exception)},m.prototype._chooseMessagesToDelete=function(){this.messageArea.find(p.MESSAGESAREA).addClass("editing"),this.messageArea.find(p.MESSAGE).attr("role","checkbox").attr("aria-checked","false")},m.prototype._deleteMessages=function(){var c=this.messageArea.getCurrentUserId(),e=this.messageArea.find(p.MESSAGE+"[aria-checked='true']"),f=[],g=[];e.each(function(b,d){var e=a(d),h=e.data("messageid"),i=e.data("messageread")?1:0;g.push(e),f.push({methodname:"core_message_delete_message",args:{messageid:h,userid:c,read:i}})}),f.length>0?b.call(f)[f.length-1].then(function(){var b=null,c=this.messageArea.find(p.MESSAGE),d=c.last(),e=g[g.length-1];a.each(g,function(a,b){b.remove()}),d.data("id")===e.data("id")&&(b=this.messageArea.find(p.MESSAGE).last()),a.each(g,function(a,b){var c=b.data("blocktime");0===this.messageArea.find(p.MESSAGE+"[data-blocktime='"+c+"']").length&&this.messageArea.find(p.BLOCKTIME+"[data-blocktime='"+c+"']").remove()}.bind(this)),0===this.messageArea.find(p.MESSAGE).length&&this.messageArea.find(p.CONVERSATIONS+" "+p.CONTACT+"[data-userid='"+this._getUserId()+"']").remove(),this.messageArea.trigger(k.MESSAGESDELETED,[this._getUserId(),b])}.bind(this),d.exception):this.messageArea.trigger(k.MESSAGESDELETED,this._getUserId()),this._hideDeleteAction()},m.prototype._addScrollEventListener=function(a){this._scrollBottom(),this._numMessagesDisplayed=a,e.define(this.messageArea.find(p.MESSAGES),[e.events.scrollTop]),this.messageArea.onCustomEvent(e.events.scrollTop,this._loadMessages.bind(this))},m.prototype._deleteAllMessages=function(){this._confirmationModal?this._confirmationModal.show():j.get_strings([{key:"confirm"},{key:"deleteallconfirm",component:"message"}]).done(function(a){h.create({title:a[0],type:h.types.CONFIRM,body:a[1]},this.messageArea.find(p.DELETEALLMESSAGES)).done(function(a){this._confirmationModal=a,a.getRoot().on(i.yes,function(){var a=this._getUserId(),c={methodname:"core_message_delete_conversation",args:{userid:this.messageArea.getCurrentUserId(),otheruserid:a}};b.call([c])[0].then(function(){this.messageArea.find(p.MESSAGESAREA).empty(),this.messageArea.trigger(k.CONVERSATIONDELETED,a),this._hideDeleteAction()}.bind(this),d.exception)}.bind(this)),a.show()}.bind(this))}.bind(this))},m.prototype._hideDeleteAction=function(){this.messageArea.find(p.MESSAGE).removeAttr("role").removeAttr("aria-checked"),this.messageArea.find(p.MESSAGESAREA).removeClass("editing")},m.prototype._triggerCancelMessagesToDelete=function(){this.messageArea.trigger(k.CANCELDELETEMESSAGES)},m.prototype._addMessageToDom=function(){var a=b.call([{methodname:"core_message_data_for_messagearea_get_most_recent_message",args:{currentuserid:this.messageArea.getCurrentUserId(),otheruserid:this._getUserId()}}]);return a[0].then(function(a){return c.render("core_message/message_area_message",a)}).then(function(a,b){c.appendNodeContents(this.messageArea.find(p.MESSAGES),a,b),this.messageArea.find(p.SENDMESSAGETEXT).val("").trigger("input"),this._scrollBottom()}.bind(this)).fail(d.exception)},m.prototype._getUserId=function(){return this.messageArea.find(p.MESSAGES).data("userid")},m.prototype._scrollBottom=function(){var a=this.messageArea.find(p.MESSAGES);0!==a.length&&a.scrollTop(a[0].scrollHeight)},m.prototype._selectPreviousMessage=function(b,c){var d=a(b.target).closest(p.MESSAGE);do d=d.prev();while(d.length&&!d.is(p.MESSAGE));d.focus(),c.originalEvent.preventDefault(),c.originalEvent.stopPropagation()},m.prototype._selectNextMessage=function(b,c){var d=a(b.target).closest(p.MESSAGE);do d=d.next();while(d.length&&!d.is(p.MESSAGE));d.focus(),c.originalEvent.preventDefault(),c.originalEvent.stopPropagation()},m.prototype._setMessaging=function(b){a(b.target).closest(p.MESSAGERESPONSE).addClass("messaging")},m.prototype._clearMessaging=function(b){a(b.target).closest(p.MESSAGERESPONSE).removeClass("messaging")},m.prototype._startDeleting=function(a){var b=new g(this.messageArea);b.chooseMessagesToDelete(),a.preventDefault()},m.prototype._isEditing=function(){return this.messageArea.find(p.MESSAGESAREA).hasClass("editing")},m.prototype._toggleMessage=function(b){if(this._isEditing()){var c=a(b.target).closest(p.MESSAGE);"true"===c.attr("aria-checked")?c.attr("aria-checked","false"):c.attr("aria-checked","true")}},m.prototype._adjustMessagesAreaHeight=function(){var a=this.messageArea.find(p.MESSAGES),b=this.messageArea.find(p.MESSAGERESPONSE),c=b.outerHeight(),d=c-o,e=n-d;a.outerHeight(e)},m.prototype._sendMessageHandler=function(a,b){b.originalEvent.preventDefault(),this._sendMessage()},m.prototype._hideMessagingArea=function(){this.messageArea.find(p.MESSAGINGAREA).removeClass("show-messages").addClass("hide-messages")},m.prototype._hasMatchingBlockTime=function(a,b,c){var d,e,f,g;return c?(e=":first",g=":last"):(e=":last",g=":first"),d=a.find(p.BLOCKTIME+e),f=b.find(p.BLOCKTIME+g),!(!d.length||!f.length)&&d.data("blocktime")==f.data("blocktime")},m}); \ No newline at end of file diff --git a/message/amd/src/message_area_messages.js b/message/amd/src/message_area_messages.js index c4ba17a4b5b..94104750779 100644 --- a/message/amd/src/message_area_messages.js +++ b/message/amd/src/message_area_messages.js @@ -242,13 +242,9 @@ define(['jquery', 'core/ajax', 'core/templates', 'core/notification', 'core/cust SELECTORS.LOADINGICON).remove(); // Check if we got something to do. if (numberreceived > 0) { - // Let's check if we can remove the block time. - // First, get the block time that is currently being displayed. - var blocktime = this.messageArea.node.find(SELECTORS.BLOCKTIME + ":first"); - var newblocktime = $(html).find(SELECTORS.BLOCKTIME + ":first").addBack(); - if (blocktime.html() == newblocktime.html()) { - // Remove the block time as it's present above. - blocktime.remove(); + var newHtml = $('
' + html + '
'); + if (this._hasMatchingBlockTime(this.messageArea.node, newHtml, true)) { + this.messageArea.node.find(SELECTORS.BLOCKTIME + ':first').remove(); } // Get height before we add the messages. var oldheight = this.messageArea.find(SELECTORS.MESSAGES)[0].scrollHeight; @@ -313,11 +309,12 @@ define(['jquery', 'core/ajax', 'core/templates', 'core/notification', 'core/cust }.bind(this)).then(function(html, js) { // Check if we got something to do. if (numberreceived > 0) { - html = $(html); - // Remove the new block time as it's present above. - html.find(SELECTORS.BLOCKTIME).remove(); + var newHtml = $('
' + html + '
'); + if (this._hasMatchingBlockTime(this.messageArea.node, newHtml, false)) { + newHtml.find(SELECTORS.BLOCKTIME + ':first').remove(); + } // Show the new content. - Templates.appendNodeContents(this.messageArea.find(SELECTORS.MESSAGES), html, js); + Templates.appendNodeContents(this.messageArea.find(SELECTORS.MESSAGES), newHtml, js); // Scroll the new message into view. if (shouldScrollBottom) { this._scrollBottom(); @@ -810,6 +807,8 @@ define(['jquery', 'core/ajax', 'core/templates', 'core/notification', 'core/cust /** * Hide the messaging area. This only applies on smaller screen resolutions. + * + * @private */ Messages.prototype._hideMessagingArea = function() { this.messageArea.find(SELECTORS.MESSAGINGAREA) @@ -817,6 +816,40 @@ define(['jquery', 'core/ajax', 'core/templates', 'core/notification', 'core/cust .addClass('hide-messages'); }; + /** + * Checks if a day separator needs to be removed. + * + * Example - scrolling up and loading previous messages that belong to the + * same day as the last message that was previously shown, meaning we can + * remove the original separator. + * + * @param {jQuery} domHtml The HTML in the DOM. + * @param {jQuery} newHtml The HTML to compare to the DOM + * @param {boolean} loadingPreviousMessages Are we loading previous messages? + * @return {boolean} + * @private + */ + Messages.prototype._hasMatchingBlockTime = function(domHtml, newHtml, loadingPreviousMessages) { + var blockTime, blockTimePos, newBlockTime, newBlockTimePos; + + if (loadingPreviousMessages) { + blockTimePos = ':first'; + newBlockTimePos = ':last'; + } else { + blockTimePos = ':last'; + newBlockTimePos = ':first'; + } + + blockTime = domHtml.find(SELECTORS.BLOCKTIME + blockTimePos); + newBlockTime = newHtml.find(SELECTORS.BLOCKTIME + newBlockTimePos); + + if (blockTime.length && newBlockTime.length) { + return blockTime.data('blocktime') == newBlockTime.data('blocktime'); + } + + return false; + }; + return Messages; } ); diff --git a/message/output/email/db/upgrade.php b/message/output/email/db/upgrade.php index e1a5f2da1ee..9a6b61c9743 100644 --- a/message/output/email/db/upgrade.php +++ b/message/output/email/db/upgrade.php @@ -44,5 +44,8 @@ function xmldb_message_email_upgrade($oldversion) { // Moodle v3.1.0 release upgrade line. // Put any upgrade step following this. + // Automatically generated Moodle v3.2.0 release upgrade line. + // Put any upgrade step following this. + return true; } diff --git a/message/output/jabber/db/upgrade.php b/message/output/jabber/db/upgrade.php index 0570cc0c99a..438a0d3fb5a 100644 --- a/message/output/jabber/db/upgrade.php +++ b/message/output/jabber/db/upgrade.php @@ -44,5 +44,8 @@ function xmldb_message_jabber_upgrade($oldversion) { // Moodle v3.1.0 release upgrade line. // Put any upgrade step following this. + // Automatically generated Moodle v3.2.0 release upgrade line. + // Put any upgrade step following this. + return true; } diff --git a/message/output/popup/db/upgrade.php b/message/output/popup/db/upgrade.php index f3f24427bfb..ae50d394ab8 100644 --- a/message/output/popup/db/upgrade.php +++ b/message/output/popup/db/upgrade.php @@ -71,5 +71,8 @@ function xmldb_message_popup_upgrade($oldversion) { upgrade_plugin_savepoint(true, 2016052309, 'message', 'popup'); } + // Automatically generated Moodle v3.2.0 release upgrade line. + // Put any upgrade step following this. + return true; } diff --git a/mod/assign/db/upgrade.php b/mod/assign/db/upgrade.php index 53302a8a197..193b330f60d 100644 --- a/mod/assign/db/upgrade.php +++ b/mod/assign/db/upgrade.php @@ -230,5 +230,8 @@ function xmldb_assign_upgrade($oldversion) { upgrade_mod_savepoint(true, 2016100301, 'assign'); } + // Automatically generated Moodle v3.2.0 release upgrade line. + // Put any upgrade step following this. + return true; } diff --git a/mod/assign/feedback/comments/db/upgrade.php b/mod/assign/feedback/comments/db/upgrade.php index 1e0d2dddc49..93544a2172c 100644 --- a/mod/assign/feedback/comments/db/upgrade.php +++ b/mod/assign/feedback/comments/db/upgrade.php @@ -44,5 +44,8 @@ function xmldb_assignfeedback_comments_upgrade($oldversion) { // Moodle v3.1.0 release upgrade line. // Put any upgrade step following this. + // Automatically generated Moodle v3.2.0 release upgrade line. + // Put any upgrade step following this. + return true; } diff --git a/mod/assign/feedback/editpdf/db/upgrade.php b/mod/assign/feedback/editpdf/db/upgrade.php index c8bbaee9ec7..a3f4b5839e1 100644 --- a/mod/assign/feedback/editpdf/db/upgrade.php +++ b/mod/assign/feedback/editpdf/db/upgrade.php @@ -68,5 +68,8 @@ function xmldb_assignfeedback_editpdf_upgrade($oldversion) { // Moodle v3.1.0 release upgrade line. // Put any upgrade step following this. + // Automatically generated Moodle v3.2.0 release upgrade line. + // Put any upgrade step following this. + return true; } diff --git a/mod/assign/feedback/editpdf/tests/behat/annotate_pdf.feature b/mod/assign/feedback/editpdf/tests/behat/annotate_pdf.feature index f08b71d6d35..6f4ea2cf2b3 100644 --- a/mod/assign/feedback/editpdf/tests/behat/annotate_pdf.feature +++ b/mod/assign/feedback/editpdf/tests/behat/annotate_pdf.feature @@ -51,7 +51,7 @@ Feature: In an assignment, teacher can annotate PDF files during grading And I log in as "teacher1" And I follow "Course 1" And I follow "Test assignment name" - And I click on "View all submissions" "link" in the "Administration" "block" + And I navigate to "View all submissions" in current page administration And I click on "Edit" "link" in the "Submitted for grading" "table_row" And I click on "Grade" "link" in the "Submitted for grading" "table_row" And I should see "Page 1 of 3" @@ -127,7 +127,7 @@ Feature: In an assignment, teacher can annotate PDF files during grading And I log in as "teacher1" And I follow "Course 1" And I follow "Test assignment name" - And I click on "View all submissions" "link" in the "Administration" "block" + And I navigate to "View all submissions" in current page administration And I click on "Edit" "link" in the "Student 2" "table_row" And I click on "Grade" "link" in the "Student 2" "table_row" And I wait until the page is ready @@ -138,5 +138,5 @@ Feature: In an assignment, teacher can annotate PDF files during grading And I press "Ok" And I click on "Edit settings" "link" And I follow "Test assignment name" - And I click on "View all submissions" "link" in the "Administration" "block" + And I navigate to "View all submissions" in current page administration And I should see "View annotated PDF..." in the "student2@example.com" "table_row" diff --git a/mod/assign/feedback/editpdf/tests/behat/group_annotations.feature b/mod/assign/feedback/editpdf/tests/behat/group_annotations.feature index 6409f330caf..227999bdda6 100644 --- a/mod/assign/feedback/editpdf/tests/behat/group_annotations.feature +++ b/mod/assign/feedback/editpdf/tests/behat/group_annotations.feature @@ -49,7 +49,7 @@ Feature: In a group assignment, teacher can annotate PDF files for all users And I log in as "teacher1" And I follow "Course 1" And I follow "Test assignment name" - And I click on "View all submissions" "link" in the "Administration" "block" + And I navigate to "View all submissions" in current page administration And I click on "Grade" "link" in the "Submitted for grading" "table_row" And I wait until the page is ready And I click on ".navigate-next-button" "css_element" diff --git a/mod/assign/feedback/editpdf/tests/behat/view_previous_annotations.feature b/mod/assign/feedback/editpdf/tests/behat/view_previous_annotations.feature index 55a66555d52..b93403e3fd0 100644 --- a/mod/assign/feedback/editpdf/tests/behat/view_previous_annotations.feature +++ b/mod/assign/feedback/editpdf/tests/behat/view_previous_annotations.feature @@ -43,7 +43,7 @@ Feature: In an assignment, teacher can view the feedback for a previous attempt. And I log in as "teacher1" And I follow "Course 1" And I follow "Test assignment name" - And I click on "View all submissions" "link" in the "Administration" "block" + And I navigate to "View all submissions" in current page administration And I click on "Edit" "link" in the "Submitted for grading" "table_row" And I click on "Grade" "link" in the "Submitted for grading" "table_row" And I should see "Page 1 of 3" diff --git a/mod/assign/feedback/editpdf/yui/build/moodle-assignfeedback_editpdf-editor/moodle-assignfeedback_editpdf-editor-debug.js b/mod/assign/feedback/editpdf/yui/build/moodle-assignfeedback_editpdf-editor/moodle-assignfeedback_editpdf-editor-debug.js index b4b4e609093..4a3ade1b38c 100644 --- a/mod/assign/feedback/editpdf/yui/build/moodle-assignfeedback_editpdf-editor/moodle-assignfeedback_editpdf-editor-debug.js +++ b/mod/assign/feedback/editpdf/yui/build/moodle-assignfeedback_editpdf-editor/moodle-assignfeedback_editpdf-editor-debug.js @@ -3247,7 +3247,7 @@ EDITOR.prototype = { * @type String * @protected */ - lastanntationtool: "pen", + lastannotationtool: "pen", /** * The users comments quick list diff --git a/mod/assign/feedback/editpdf/yui/build/moodle-assignfeedback_editpdf-editor/moodle-assignfeedback_editpdf-editor-min.js b/mod/assign/feedback/editpdf/yui/build/moodle-assignfeedback_editpdf-editor/moodle-assignfeedback_editpdf-editor-min.js index 2d30f998b35..fd41cf8283f 100644 --- a/mod/assign/feedback/editpdf/yui/build/moodle-assignfeedback_editpdf-editor/moodle-assignfeedback_editpdf-editor-min.js +++ b/mod/assign/feedback/editpdf/yui/build/moodle-assignfeedback_editpdf-editor/moodle-assignfeedback_editpdf-editor-min.js @@ -2,7 +2,7 @@ YUI.add("moodle-assignfeedback_editpdf-editor",function(e,t){var n=M.cfg.wwwroot .erase(),this.editor.drawables.push(this.draw())},draw_current_edit:function(e){var t=e&&!1;return t},init_from_edit:function(e){var t=new M.assignfeedback_editpdf.rect;return t.bound([e.start,e.end]),this.gradeid=this.editor.get("gradeid"),this.pageno=this.editor.currentpage,this.x=t.x,this.y=t.y,this.endx=t.x+t.width,this.endy=t.y+t.height,this.colour=e.annotationcolour,this.path="",t.has_min_width()&&t.has_min_height()}}),M.assignfeedback_editpdf=M.assignfeedback_editpdf||{},M.assignfeedback_editpdf.annotation=y;var b=function(e){b.superclass.constructor.apply(this,[e])};b.NAME="annotationline",b.ATTRS={},e.extend(b,M.assignfeedback_editpdf.annotation,{draw:function(){var t,n;return t=new M.assignfeedback_editpdf.drawable(this.editor),n=this.editor.graphic.addShape({type:e.Path,fill:!1,stroke:{weight:p,color:l[this.colour]}}),n.moveTo(this.x,this.y),n.lineTo(this.endx,this.endy),n.end(),t.shapes.push(n),this.drawable=t,b.superclass.draw.apply(this)},draw_current_edit:function(t){var n=new M.assignfeedback_editpdf.drawable(this.editor),r;return r=this.editor.graphic.addShape({type:e.Path,fill:!1,stroke:{weight:p,color:l[t.annotationcolour]}}),r.moveTo(t.start.x,t.start.y),r.lineTo(t.end.x,t.end.y),r.end(),n.shapes.push(r),n},init_from_edit:function(e){return this.gradeid=this.editor.get("gradeid"),this.pageno=this.editor.currentpage,this.x=e.start.x,this.y=e.start.y,this.endx=e.end.x,this.endy=e.end.y,this.colour=e.annotationcolour,this.path="",this.endx-this.x!==0||this.endy-this.y!==0}}),M.assignfeedback_editpdf=M.assignfeedback_editpdf||{},M.assignfeedback_editpdf.annotationline=b;var w=function(e){w.superclass.constructor.apply(this,[e])};w.NAME="annotationrectangle",w.ATTRS={},e.extend(w,M.assignfeedback_editpdf.annotation,{draw:function(){var t,n,r;return t=new M.assignfeedback_editpdf.drawable(this.editor),n=new M.assignfeedback_editpdf.rect,n.bound([new M.assignfeedback_editpdf.point(this.x,this.y),new M.assignfeedback_editpdf.point(this.endx,this.endy)]),r=this.editor.graphic.addShape({type:e.Rect,width:n.width,height:n.height,stroke:{weight:p,color:l[this.colour]},x:n.x,y:n.y}),t.shapes.push(r),this.drawable=t,w.superclass.draw.apply(this)},draw_current_edit:function(t){var n=new M.assignfeedback_editpdf.drawable(this.editor),r,i;return i=new M.assignfeedback_editpdf.rect,i.bound([new M.assignfeedback_editpdf.point(t.start.x,t.start.y),new M.assignfeedback_editpdf.point(t.end.x,t.end.y)]),i.has_min_width()||i.set_min_width(),i.has_min_height()||i.set_min_height(),r=this.editor.graphic.addShape({type:e.Rect,width:i.width,height:i.height,stroke:{weight:p,color:l[t.annotationcolour]},x:i.x,y:i.y}),n.shapes.push(r),n}}),M.assignfeedback_editpdf=M.assignfeedback_editpdf||{},M.assignfeedback_editpdf.annotationrectangle=w;var E=function(e){E.superclass.constructor.apply(this,[e])};E.NAME="annotationoval",E.ATTRS={},e.extend(E,M.assignfeedback_editpdf.annotation,{draw:function(){var t,n,r;return t=new M.assignfeedback_editpdf.drawable(this.editor),n=new M.assignfeedback_editpdf.rect,n.bound([new M.assignfeedback_editpdf.point(this.x,this.y),new M.assignfeedback_editpdf.point(this.endx,this.endy)]),r=this.editor.graphic.addShape({type:e.Ellipse,width:n.width,height:n.height,stroke:{weight:p,color:l[this.colour]},x:n.x,y:n.y}),t.shapes.push(r),this.drawable=t,E.superclass.draw.apply(this)},draw_current_edit:function(t){var n=new M.assignfeedback_editpdf.drawable(this.editor),r,i;return i=new M.assignfeedback_editpdf.rect,i.bound([new M.assignfeedback_editpdf.point(t.start.x,t.start.y),new M.assignfeedback_editpdf.point(t.end.x,t.end.y)]),i.has_min_width()||i.set_min_width(),i.has_min_height()||i.set_min_height(),r=this.editor.graphic.addShape({type:e.Ellipse,width:i.width,height:i.height,stroke:{weight:p,color:l[t.annotationcolour]},x:i.x,y:i.y}),n.shapes.push(r),n}}),M.assignfeedback_editpdf=M.assignfeedback_editpdf||{},M.assignfeedback_editpdf.annotationoval=E;var S=function(e){S.superclass.constructor.apply(this,[e])};S.NAME="annotationpen",S.ATTRS={},e.extend(S,M.assignfeedback_editpdf.annotation,{draw:function(){var t,n,r,i,s;return t=new M.assignfeedback_editpdf.drawable(this.editor),n=this.editor.graphic.addShape({type:e.Path,fill:!1,stroke:{weight:p,color:l[this.colour]}}),r=!0,i=this.path.split(":"),e.each(i,function(e){s=e.split(","),r?(n.moveTo(s[0],s[1]),r=!1):n.lineTo(s[0],s[1])},this),n.end(),t.shapes.push(n),this.drawable=t,S.superclass.draw.apply(this)},draw_current_edit:function(t){var n=new M.assignfeedback_editpdf.drawable(this.editor),r,i;return r=this.editor.graphic.addShape({type:e.Path,fill:!1,stroke:{weight:p,color:l[t.annotationcolour]}}),i=!0,e.each(t.path,function(e){i?(r.moveTo(e.x,e.y),i=!1):r.lineTo(e.x,e.y)},this),r.end(),n.shapes.push(r),n},init_from_edit:function(e){var t=new M.assignfeedback_editpdf.rect,n=[],r=0;t.bound(e.path);for(r=0;r"),r.setStyles({position:"absolute",display:"inline-block",backgroundImage:"url("+this.editor.get_stamp_image_url(this.path)+")",width:this.endx-this.x,height:this.endy-this.y,backgroundSize:"100% 100%",zIndex:50}),n.append(r),r.setX(i.x),r.setY(i.y),t.store_position(r,i.x,i.y),this.editor.get("readonly")||(r.on("gesturemovestart",this.editor.edit_start,null,this.editor),r.on("gesturemove",this.editor.edit_move,null,this.editor),r.on("gesturemoveend",this.editor.edit_end,null,this.editor)),t.nodes.push(r),this.drawable=t,T.superclass.draw.apply(this)},draw_current_edit:function(t){var n=new M.assignfeedback_editpdf.rect,r=new M.assignfeedback_editpdf.drawable(this.editor),i=this.editor.get_dialogue_element(s.DRAWINGREGION),o,u;return n.bound([t.start,t.end]),u=this.editor.get_window_coordinates(new M.assignfeedback_editpdf.point(n.x,n.y)),o=e.Node.create("
"),o.setStyles({position:"absolute",display:"inline-block",backgroundImage:"url("+this.editor.get_stamp_image_url(t.stamp)+")",width:n.width,height:n.height,backgroundSize:"100% 100%",zIndex:50}),i.append(o),o.setX(u.x),o.setY(u.y),r.store_position(o,u.x,u.y),r.nodes.push(o),r},init_from_edit:function(e){var t=new M.assignfeedback_editpdf.rect;return t.bound([e.start,e.end]),t.width<40&&(t.width=40),t.height<40&&(t.height=40),this.gradeid=this.editor.get("gradeid"),this.pageno=this.editor.currentpage,this.x=t.x,this.y=t.y,this.endx=t.x+t.width,this.endy=t.y+t.height,this.colour=e.annotationcolour,this.path=e.stamp,!0},move:function(e,t){var n=e-this.x,r=t-this.y;this.x+=n,this.y+=r,this.endx+=n,this.endy+=r,this.drawable&&this.drawable.erase(),this.editor.drawables.push(this.draw())}}),M.assignfeedback_editpdf=M.assignfeedback_editpdf||{},M.assignfeedback_editpdf.annotationstamp=T;var N="Dropdown menu",C;C=function(e){e.draggable=!1,e.centered=!1,e.width="auto",e.visible=!1,e.footerContent="",C.superclass.constructor.apply(this,[e])},e.extend(C,M.core.dialogue,{initializer:function(t){var n,r,i,s;C.superclass.initializer.call(this,t),s=this.get("boundingBox"),s.addClass("assignfeedback_editpdf_dropdown"),n=this.get("buttonNode"),r=this.bodyNode,i=e.Node.create("

"),i.addClass("accesshide"),i.setHTML(this.get("headerText")),r.prepend(i),r.on("clickoutside",function(e){this.get("visible")&&e.target.get("id")!==n.get("id")&&e.target.ancestor().get("id")!==n.get("id")&&(e.preventDefault(),this.hide())},this),n.on("click",function(e){e.preventDefault(),this.show()},this),n.on("key",this.show,"enter,space",this)},show:function(){var t=this.get("buttonNode"),n=C.superclass.show.call(this);return this.align(t,[e.WidgetPositionAlign.TL,e.WidgetPositionAlign.BL]),n}},{NAME:N,ATTRS:{headerText:{value:""},buttonNode:{value:null}}}),e.Base.modifyAttrs(C,{modal:{getter:function(){return!1}}}),M.assignfeedback_editpdf=M.assignfeedback_editpdf||{},M.assignfeedback_editpdf.dropdown=C;var k="Colourpicker",L;L=function(e){L.superclass.constructor.apply(this,[e])},e.extend(L,M.assignfeedback_editpdf.dropdown,{initializer:function(t){var n=e.Node.create('