diff --git a/admin/settings/appearance.php b/admin/settings/appearance.php index 4aa50b4bcf3..707f07670ae 100644 --- a/admin/settings/appearance.php +++ b/admin/settings/appearance.php @@ -269,7 +269,6 @@ preferences,moodle|/user/preferences.php|t/preferences', $setting = new admin_setting_configcheckbox('cachejs', new lang_string('cachejs', 'admin'), new lang_string('cachejs_help', 'admin'), 1); $setting->set_updatedcallback('js_reset_all_caches'); $temp->add($setting); - $temp->add(new admin_setting_configcheckbox('modchooserdefault', new lang_string('modchooserdefault', 'admin'), new lang_string('configmodchooserdefault', 'admin'), 1)); $ADMIN->add('appearance', $temp); // Link to tag management interface. diff --git a/admin/tool/behat/tests/behat/edit_permissions.feature b/admin/tool/behat/tests/behat/edit_permissions.feature index 7394512c5ce..34c3997c98f 100644 --- a/admin/tool/behat/tests/behat/edit_permissions.feature +++ b/admin/tool/behat/tests/behat/edit_permissions.feature @@ -49,10 +49,14 @@ Feature: Edit capabilities Scenario: Module capabilities overrides Given I log in as "teacher1" + And the following "activity" exists: + | activity | forum | + | course | C1 | + | idnumber | 00001 | + | name | I'm the name | + | intro | I'm the introduction | + | section | 1 | And I am on "Course 1" course homepage with editing mode on - And I add a "Forum" to section "1" and I fill the form with: - | Forum name | I'm the name | - | Description | I'm the introduction | And I follow "I'm the name" And I navigate to "Permissions" in current page administration And I override the system permissions of "Student" role with: 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 3f1d88e0751..3e37c589c2e 100644 --- a/admin/tool/behat/tests/behat/get_and_set_fields.feature +++ b/admin/tool/behat/tests/behat/get_and_set_fields.feature @@ -115,15 +115,24 @@ Feature: Verify that all form fields values can be get and set | Wiki name | Test this one baby | | Default format | HTML | And I press "Cancel" - And I am on "Course 1" course homepage # Radio - Checking "I set the field" and "the field matches value". - And I add a "Choice" to section "1" and I fill the form with: - | Choice name | Test choice name | - | Description | Test choice description | - | Allow choice to be updated | Yes | - | Option 1 | one | - | Option 2 | two | - | Option 3 | three | + And the following "activity" exists: + | activity | choice | + | course | C1 | + | idnumber | choice1 | + | intro | Test choice description | + | name | Test choice name | + | choice1 | Option 1, Option 2, Option 3 | + | section | 1 | + | allowupdate | 1 | + And I am on "Course 1" course homepage + And I follow "Test choice name" + And I navigate to "Edit settings" in current page administration + And I set the field "Option 1" to "one" + And I set the field "Option 2" to "two" + And I set the field "Option 3" to "three" + And I press "Save and return to course" + And I am on "Course 1" course homepage And I follow "Test choice name" And I set the field "one" to "1" And I press "Save my choice" diff --git a/admin/tool/recyclebin/tests/behat/basic_functionality.feature b/admin/tool/recyclebin/tests/behat/basic_functionality.feature index ce2d8fd53f8..74c4e41fa01 100644 --- a/admin/tool/recyclebin/tests/behat/basic_functionality.feature +++ b/admin/tool/recyclebin/tests/behat/basic_functionality.feature @@ -43,10 +43,14 @@ Feature: Basic recycle bin functionality Scenario: Restore a deleted assignment Given I log in as "teacher1" + And the following "activity" exists: + | activity | assign | + | name | Test assign | + | intro | Test | + | course | C1 | + | idnumber | 0001 | + | section | 1 | And I am on "Course 1" course homepage with editing mode on - And I add a "Assignment" to section "1" and I fill the form with: - | Assignment name | Test assign | - | Description | Test | And I delete "Test assign" activity When I navigate to "Recycle bin" in current page administration Then I should see "Test assign" diff --git a/availability/tests/behat/edit_availability.feature b/availability/tests/behat/edit_availability.feature index 3c352278d60..a22b3d81aee 100644 --- a/availability/tests/behat/edit_availability.feature +++ b/availability/tests/behat/edit_availability.feature @@ -32,8 +32,16 @@ Feature: edit_availability Given the following config values are set as admin: | enableavailability | 0 | When I log in as "teacher1" + And the following "activity" exists: + | activity | page | + | course | C1 | + | idnumber | 0001 | + | section | 1 | + | name | Page1 | + | intro | pageintro | And I am on "Course 1" course homepage with editing mode on - And I add a "Page" to section "1" + And I follow "Page1" + And I navigate to "Edit settings" in current page administration Then "Restrict access" "fieldset" should not exist Given I am on "Course 1" course homepage @@ -43,8 +51,16 @@ Feature: edit_availability And the following config values are set as admin: | enableavailability | 1 | + And the following "activity" exists: + | activity | page | + | course | C1 | + | idnumber | 0002 | + | section | 1 | + | name | Page2 | + | intro | pageintro | And I am on "Course 1" course homepage - And I add a "Page" to section "1" + And I follow "Page2" + And I navigate to "Edit settings" in current page administration Then "Restrict access" "fieldset" should exist Given I am on "Course 1" course homepage diff --git a/backup/util/ui/tests/behat/duplicate_activities.feature b/backup/util/ui/tests/behat/duplicate_activities.feature index 9b1b9afd392..01a9e330f34 100644 --- a/backup/util/ui/tests/behat/duplicate_activities.feature +++ b/backup/util/ui/tests/behat/duplicate_activities.feature @@ -14,15 +14,15 @@ Feature: Duplicate activities And the following "course enrolments" exist: | user | course | role | | teacher1 | C1 | editingteacher | + And the following "activities" exist: + | activity | name | intro | course | idnumber | section | + | data | Test database name | Test database description | C1 | database1 | 1 | And I log in as "admin" And I set the following administration settings values: | backup_import_activities | 0 | And I log out And I log in as "teacher1" And I am on "Course 1" course homepage with editing mode on - And I add a "Database" to section "1" and I fill the form with: - | Name | Test database name | - | Description | Test database description | And I duplicate "Test database name" activity And I should see "Test database name (copy)" And I wait until section "1" is available diff --git a/backup/util/ui/tests/behat/import_course.feature b/backup/util/ui/tests/behat/import_course.feature index 52c1452106d..55d3271efa3 100644 --- a/backup/util/ui/tests/behat/import_course.feature +++ b/backup/util/ui/tests/behat/import_course.feature @@ -19,13 +19,11 @@ Feature: Import course's contents into another course Scenario: Import course's contents to another course Given I log in as "teacher1" + And the following "activities" exist: + | activity | name | intro | course | idnumber | section | + | data | Test database name | Test database description | C1 | database1 | 2 | + | forum | Test forum name | Test forum name description | C1 | forum1 | 1 | And I am on "Course 1" course homepage with editing mode on - And I add a "Database" to section "1" and I fill the form with: - | Name | Test database name | - | Description | Test database description | - And I add a "Forum" to section "2" and I fill the form with: - | Forum name | Test forum name | - | Description | Test forum description | And I add the "Comments" block And I add the "Recent blog entries" block And I turn editing mode off diff --git a/blocks/activity_results/tests/behat/addblockinactivity.feature b/blocks/activity_results/tests/behat/addblockinactivity.feature index 3191e13411d..3a4b42d432d 100644 --- a/blocks/activity_results/tests/behat/addblockinactivity.feature +++ b/blocks/activity_results/tests/behat/addblockinactivity.feature @@ -24,30 +24,16 @@ Feature: The activity results block displays student scores | student3 | C1 | student | | student4 | C1 | student | | student5 | C1 | student | + And the following "activities" exist: + | activity | name | intro | course | section | idnumber | assignsubmission_file_enabled | + | assign | Test assignment 1 | Offline text | C1 | 1 | assign1 | 0 | + | assign | Test assignment 2 | Offline text | C1 | 1 | assign2 | 0 | + | assign | Test assignment 3 | Offline text | C1 | 1 | assign3 | 0 | + And the following "activities" exist: + | activity | name | content | course | section | idnumber | + | page | Test page name | This is a page | C1 | 1 | page1 | And I log in as "teacher1" And I am on "Course 1" course homepage with editing mode on - And I add a "Assignment" to section "1" and I fill the form with: - | Assignment name | Test assignment 1 | - | Description | Offline text | - | assignsubmission_file_enabled | 0 | - And I am on "Course 1" course homepage - And I add a "Assignment" to section "1" and I fill the form with: - | Assignment name | Test assignment 2 | - | Description | Offline text | - | assignsubmission_file_enabled | 0 | - And I am on "Course 1" course homepage - And I add a "Assignment" to section "1" and I fill the form with: - | Assignment name | Test assignment 3 | - | Description | Offline text | - | assignsubmission_file_enabled | 0 | - And I am on "Course 1" course homepage - And I add a "Page" to section "1" - And I set the following fields to these values: - | Name | Test page name | - | Description | Test page description | - | Page content | This is a page | - And I press "Save and return to course" - And I am on "Course 1" course homepage And I should see "Test page name" And I navigate to "View > Grader report" in the course gradebook And I turn editing mode on diff --git a/blocks/activity_results/tests/behat/addunconfiguredblock.feature b/blocks/activity_results/tests/behat/addunconfiguredblock.feature index 0570dbddfea..c2e5b140a32 100644 --- a/blocks/activity_results/tests/behat/addunconfiguredblock.feature +++ b/blocks/activity_results/tests/behat/addunconfiguredblock.feature @@ -29,12 +29,15 @@ Feature: The activity results block doesn't displays student scores for unconfig Then I should see "Please configure this block and select which activity it should display results from." in the "Activity results" "block" Scenario: Try to configure the block on a resource page in a course without activities - Given I add a "Page" to section "1" - And I set the following fields to these values: - | Name | Test page name | - | Description | Test page description | - | page | This is a page | - And I press "Save and display" + Given the following "activity" exists: + | activity | page | + | course | C1 | + | idnumber | 0001 | + | name | Test page name | + | intro | Test page description | + | section | 1 | + | content | This is a page | + And I am on "Course 1" course homepage When I add the "Activity results" block And I configure the "Activity results" block And I should see "There are not yet any activities in this course." diff --git a/blocks/activity_results/tests/behat/addunsupportedactivity.feature b/blocks/activity_results/tests/behat/addunsupportedactivity.feature index 982510d3a90..4f9b286703a 100644 --- a/blocks/activity_results/tests/behat/addunsupportedactivity.feature +++ b/blocks/activity_results/tests/behat/addunsupportedactivity.feature @@ -18,10 +18,9 @@ Feature: The activity results block doesn't display student scores for unsupport And I am on "Course 1" course homepage with editing mode on Scenario: Try to configure the block to use an activity without grades - Given I add a "Assignment" to section "1" and I fill the form with: - | Assignment name | Test assignment | - | Description | Offline text | - | assignsubmission_file_enabled | 0 | + Given the following "activities" exist: + | activity | name | intro | course | section | idnumber | assignsubmission_file_enabled | + | assign | Test assignment | Offline text | C1 | 1 | assign1 | 0 | And I am on "Course 1" course homepage And I add the "Activity results" block And I configure the "Activity results" block diff --git a/blocks/activity_results/tests/behat/defaultsettings.feature b/blocks/activity_results/tests/behat/defaultsettings.feature index 3af9d0e39fc..6c32edaebfe 100644 --- a/blocks/activity_results/tests/behat/defaultsettings.feature +++ b/blocks/activity_results/tests/behat/defaultsettings.feature @@ -16,6 +16,16 @@ Feature: The activity results block can have administrator set defaults | user | course | role | | teacher1 | C1 | editingteacher | | student1 | C1 | student | + And the following "activity" exists: + | activity | assign | + | course | C1 | + | idnumber | 0001 | + | name | Test assignment | + | intro | Offline text | + | section | 1 | + | assignsubmission_file_enabled | 0 | + And I log in as "teacher1" + And I am on "Course 1" course homepage with editing mode on Scenario: Assign some site-wide defaults to the block. Given the following config values are set as admin: @@ -23,12 +33,6 @@ Feature: The activity results block can have administrator set defaults | config_showworst | 0 | block_activity_results | | config_gradeformat | 2 | block_activity_results | | config_nameformat | 2 | block_activity_results | - And I log in as "teacher1" - And I am on "Course 1" course homepage with editing mode on - And I add a "Assignment" to section "1" and I fill the form with: - | Assignment name | Test assignment | - | Description | Offline text | - | assignsubmission_file_enabled | 0 | And I am on "Course 1" course homepage And I add the "Activity results" block When I configure the "Activity results" block @@ -46,12 +50,6 @@ Feature: The activity results block can have administrator set defaults | config_showbest_locked | 1 | block_activity_results | | config_showworst | 0 | block_activity_results | | config_showworst_locked | 1 | block_activity_results | - And I log in as "teacher1" - And I am on "Course 1" course homepage with editing mode on - And I add a "Assignment" to section "1" and I fill the form with: - | Assignment name | Test assignment | - | Description | Offline text | - | assignsubmission_file_enabled | 0 | And I am on "Course 1" course homepage And I add the "Activity results" block When I configure the "Activity results" block diff --git a/blocks/activity_results/tests/behat/highscoreswithoutgroups.feature b/blocks/activity_results/tests/behat/highscoreswithoutgroups.feature index 9a18affe494..6af65257a1a 100644 --- a/blocks/activity_results/tests/behat/highscoreswithoutgroups.feature +++ b/blocks/activity_results/tests/behat/highscoreswithoutgroups.feature @@ -24,13 +24,11 @@ Feature: The activity results block displays student high scores | student3 | C1 | student | | student4 | C1 | student | | student5 | C1 | student | + And the following "activities" exist: + | activity | name | intro | course | section | idnumber | assignsubmission_file_enabled | + | assign | Test assignment | Offline text | C1 | 1 | assign1 | 0 | And I log in as "teacher1" And I am on "Course 1" course homepage with editing mode on - And I add a "Assignment" to section "1" and I fill the form with: - | Assignment name | Test assignment | - | Description | Offline text | - | assignsubmission_file_enabled | 0 | - And I am on "Course 1" course homepage 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" diff --git a/blocks/activity_results/tests/behat/highscoreswithscales.feature b/blocks/activity_results/tests/behat/highscoreswithscales.feature index 76d5b2ac88d..d560b0238e0 100644 --- a/blocks/activity_results/tests/behat/highscoreswithscales.feature +++ b/blocks/activity_results/tests/behat/highscoreswithscales.feature @@ -24,6 +24,13 @@ Feature: The activity results block displays students high scores in group as sc | student3 | C1 | student | | student4 | C1 | student | | student5 | C1 | student | + And the following "activity" exists: + | activity | assign | + | course | C1 | + | idnumber | 0001 | + | name | Test assignment | + | intro | Offline text | + | assignsubmission_file_enabled | 0 | And I log in as "teacher1" And I am on "Course 1" course homepage And I navigate to "Scales" in the course gradebook @@ -32,13 +39,13 @@ Feature: The activity results block displays students high scores in group as sc | Name | My Scale | | Scale | Disappointing, Not good enough, Average, Good, Very good, Excellent! | And I press "Save changes" - And I am on "Course 1" course homepage with editing mode on - And I add a "Assignment" to section "1" and I fill the form with: - | Assignment name | Test assignment | - | Description | Offline text | - | assignsubmission_file_enabled | 0 | + And I am on "Course 1" course homepage + And I follow "Test assignment" + And I navigate to "Edit settings" in current page administration + And I set the following fields to these values: | id_grade_modgrade_type | Scale | | id_grade_modgrade_scale | My Scale | + And I press "Save and return to course" And I am on "Course 1" course homepage And I navigate to "View > Grader report" in the course gradebook And I turn editing mode on @@ -48,7 +55,7 @@ Feature: The activity results block displays students high scores in group as sc And I give the grade "Average" to the user "Student 4" for the grade item "Test assignment" And I give the grade "Not good enough" to the user "Student 5" for the grade item "Test assignment" And I press "Save changes" - And I am on "Course 1" course homepage + And I am on "Course 1" course homepage with editing mode on Scenario: Configure the block on the course page to show 1 high score Given I add the "Activity results" block diff --git a/blocks/activity_results/tests/behat/highscoreswithscalesandgroups.feature b/blocks/activity_results/tests/behat/highscoreswithscalesandgroups.feature index bb9cb706e06..aa6a98e2472 100644 --- a/blocks/activity_results/tests/behat/highscoreswithscalesandgroups.feature +++ b/blocks/activity_results/tests/behat/highscoreswithscalesandgroups.feature @@ -41,22 +41,26 @@ Feature: The activity results block displays student in group high scores as sca | student4 | G2 | | student5 | G3 | | student6 | G3 | + And the following "activities" exist: + | activity | name | intro | course | section | idnumber | + | assign | Test assignment | Offline text | C1 | 1 | assign1 | And I log in as "teacher1" - And I am on "Course 1" course homepage + And I am on "Course 1" course homepage with editing mode on 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 | | Scale | Disappointing, Not good enough, Average, Good, Very good, Excellent! | And I press "Save changes" - And I am on "Course 1" course homepage with editing mode on - And I add a "Assignment" to section "1" and I fill the form with: - | Assignment name | Test assignment | - | Description | Offline text | + And I am on "Course 1" course homepage + And I follow "Test assignment" + And I navigate to "Edit settings" in current page administration + And I set the following fields to these values: | assignsubmission_file_enabled | 0 | | id_grade_modgrade_type | Scale | | id_grade_modgrade_scale | My Scale | | Group mode | Separate groups | + And I press "Save and return to course" And I am on "Course 1" course homepage And I navigate to "View > Grader report" in the course gradebook And I turn editing mode on diff --git a/blocks/activity_results/tests/behat/highscoreswithseperategroups.feature b/blocks/activity_results/tests/behat/highscoreswithseperategroups.feature index 754a6140ecd..1b8953be518 100644 --- a/blocks/activity_results/tests/behat/highscoreswithseperategroups.feature +++ b/blocks/activity_results/tests/behat/highscoreswithseperategroups.feature @@ -41,14 +41,17 @@ Feature: The activity results block displays student in separate groups scores | student4 | G2 | | student5 | G3 | | student6 | G3 | + And the following "activity" exists: + | activity | assign | + | course | C1 | + | idnumber | 0001 | + | name | Test assignment | + | intro | Offline text | + | section | 1 | + | assignsubmission_file_enabled | 0 | + | groupmode | 1 | And I log in as "teacher1" And I am on "Course 1" course homepage with editing mode on - And I add a "Assignment" to section "1" and I fill the form with: - | Assignment name | Test assignment | - | Description | Offline text | - | assignsubmission_file_enabled | 0 | - | Group mode | Separate groups | - And I am on "Course 1" course homepage 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" diff --git a/blocks/activity_results/tests/behat/highscoreswithvisiblegroups.feature b/blocks/activity_results/tests/behat/highscoreswithvisiblegroups.feature index 3eca15e95e6..b7f5e965703 100644 --- a/blocks/activity_results/tests/behat/highscoreswithvisiblegroups.feature +++ b/blocks/activity_results/tests/behat/highscoreswithvisiblegroups.feature @@ -41,13 +41,16 @@ Feature: The activity results block displays student in visible groups scores | student4 | G2 | | student5 | G3 | | student6 | G3 | + And the following "activities" exist: + | activity | name | intro | course | idnumber | section | assignsubmission_file_enabled | + | assign | Test assignment | Test assignment | C1 | assign1 | 1 | 0 | And I log in as "teacher1" And I am on "Course 1" course homepage with editing mode on - And I add a "Assignment" to section "1" and I fill the form with: - | Assignment name | Test assignment | - | Description | Offline text | - | assignsubmission_file_enabled | 0 | + And I follow "Test assignment" + And I navigate to "Edit settings" in current page administration + And I set the following fields to these values: | Group mode | Visible groups | + And I press "Save and return to course" And I am on "Course 1" course homepage And I navigate to "View > Grader report" in the course gradebook And I turn editing mode on diff --git a/blocks/activity_results/tests/behat/lowscoreswithoutgroups.feature b/blocks/activity_results/tests/behat/lowscoreswithoutgroups.feature index 6c24497b142..1c0577d61e9 100644 --- a/blocks/activity_results/tests/behat/lowscoreswithoutgroups.feature +++ b/blocks/activity_results/tests/behat/lowscoreswithoutgroups.feature @@ -24,13 +24,16 @@ Feature: The activity results block displays student low scores | student3 | C1 | student | | student4 | C1 | student | | student5 | C1 | student | + And the following "activity" exists: + | activity | assign | + | course | C1 | + | idnumber | 0001 | + | name | Test assignment | + | intro | Offline text | + | section | 1 | + | assignsubmission_file_enabled | 0 | And I log in as "teacher1" And I am on "Course 1" course homepage with editing mode on - And I add a "Assignment" to section "1" and I fill the form with: - | Assignment name | Test assignment | - | Description | Offline text | - | assignsubmission_file_enabled | 0 | - And I am on "Course 1" course homepage 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" diff --git a/blocks/activity_results/tests/behat/lowscoreswithscales.feature b/blocks/activity_results/tests/behat/lowscoreswithscales.feature index e4880575f3b..66ba066c72e 100644 --- a/blocks/activity_results/tests/behat/lowscoreswithscales.feature +++ b/blocks/activity_results/tests/behat/lowscoreswithscales.feature @@ -24,6 +24,14 @@ Feature: The activity results block displays student low scores as scales | student3 | C1 | student | | student4 | C1 | student | | student5 | C1 | student | + Given the following "activity" exists: + | activity | assign | + | name | Test assignment | + | intro | Offline text | + | course | C1 | + | idnumber | 0001 | + | section | 1 | + | assignsubmission_file_enabled | 0 | And I log in as "teacher1" And I am on "Course 1" course homepage And I navigate to "Scales" in the course gradebook @@ -33,12 +41,12 @@ Feature: The activity results block displays student low scores as scales | Scale | Disappointing, Not good enough, Average, Good, Very good, Excellent! | And I press "Save changes" And I am on "Course 1" course homepage with editing mode on - And I add a "Assignment" to section "1" and I fill the form with: - | Assignment name | Test assignment | - | Description | Offline text | - | assignsubmission_file_enabled | 0 | + And I follow "Test assignment" + And I navigate to "Edit settings" in current page administration + And I set the following fields to these values: | id_grade_modgrade_type | Scale | | id_grade_modgrade_scale | My Scale | + And I press "Save and return to course" And I am on "Course 1" course homepage And I navigate to "View > Grader report" in the course gradebook And I turn editing mode on diff --git a/blocks/activity_results/tests/behat/lowscoreswithscalesandgroups.feature b/blocks/activity_results/tests/behat/lowscoreswithscalesandgroups.feature index a1e378a85dd..47f55beb4fd 100644 --- a/blocks/activity_results/tests/behat/lowscoreswithscalesandgroups.feature +++ b/blocks/activity_results/tests/behat/lowscoreswithscalesandgroups.feature @@ -41,6 +41,14 @@ Feature: The activity results block displays students in groups low scores as sc | student4 | G2 | | student5 | G3 | | student6 | G3 | + And the following "activity" exists: + | activity | assign | + | course | C1 | + | idnumber | 0001 | + | name | Test assignment | + | description | Offline text | + | assignsubmission_file_enabled | 0 | + | groupmode | 1 | And I log in as "teacher1" And I am on "Course 1" course homepage And I navigate to "Scales" in the course gradebook @@ -49,14 +57,13 @@ Feature: The activity results block displays students in groups low scores as sc | Name | My Scale | | Scale | Disappointing, Not good enough, Average, Good, Very good, Excellent! | And I press "Save changes" - And I am on "Course 1" course homepage with editing mode on - And I add a "Assignment" to section "1" and I fill the form with: - | Assignment name | Test assignment | - | Description | Offline text | - | assignsubmission_file_enabled | 0 | + And I am on "Course 1" course homepage + And I follow "Test assignment" + And I navigate to "Edit settings" in current page administration + And I set the following fields to these values: | id_grade_modgrade_type | Scale | | id_grade_modgrade_scale | My Scale | - | Group mode | Separate groups | + And I press "Save and return to course" And I am on "Course 1" course homepage And I navigate to "View > Grader report" in the course gradebook And I turn editing mode on @@ -67,7 +74,7 @@ Feature: The activity results block displays students in groups low scores as sc And I give the grade "Good" to the user "Student 5" for the grade item "Test assignment" And I give the grade "Average" to the user "Student 6" for the grade item "Test assignment" And I press "Save changes" - And I am on "Course 1" course homepage + And I am on "Course 1" course homepage with editing mode on Scenario: Try to configure the block on the course page to show 1 low score Given I add the "Activity results" block diff --git a/blocks/activity_results/tests/behat/lowscoreswithseperategroups.feature b/blocks/activity_results/tests/behat/lowscoreswithseperategroups.feature index 5575855345c..eadf2e9b0d9 100644 --- a/blocks/activity_results/tests/behat/lowscoreswithseperategroups.feature +++ b/blocks/activity_results/tests/behat/lowscoreswithseperategroups.feature @@ -41,14 +41,11 @@ Feature: The activity results block displays students in separate groups scores | student4 | G2 | | student5 | G3 | | student6 | G3 | + And the following "activities" exist: + | activity | course | idnumber | name | intro | assignsubmission_file_enabled | groupmode | + | assign | C1 | a1 | Test assignment | Offline text | 0 | 1 | And I log in as "teacher1" And I am on "Course 1" course homepage with editing mode on - And I add a "Assignment" to section "1" and I fill the form with: - | Assignment name | Test assignment | - | Description | Offline text | - | assignsubmission_file_enabled | 0 | - | Group mode | Separate groups | - And I am on "Course 1" course homepage 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" diff --git a/blocks/activity_results/tests/behat/lowscoreswithvisiblegroups.feature b/blocks/activity_results/tests/behat/lowscoreswithvisiblegroups.feature index ee5cb5e22d1..13ed3f897fb 100644 --- a/blocks/activity_results/tests/behat/lowscoreswithvisiblegroups.feature +++ b/blocks/activity_results/tests/behat/lowscoreswithvisiblegroups.feature @@ -41,14 +41,17 @@ Feature: The activity results block displays student in visible groups low score | student4 | G2 | | student5 | G3 | | student6 | G3 | + And the following "activity" exists: + | activity | assign | + | course | C1 | + | idnumber | 0001 | + | name | Test assignment | + | intro | Offline text | + | section | 1 | + | assignsubmission_file_enabled | 0 | + | groupmode | 2 | And I log in as "teacher1" And I am on "Course 1" course homepage with editing mode on - And I add a "Assignment" to section "1" and I fill the form with: - | Assignment name | Test assignment | - | Description | Offline text | - | assignsubmission_file_enabled | 0 | - | Group mode | Visible groups | - And I am on "Course 1" course homepage 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" diff --git a/blocks/blog_menu/tests/behat/block_blog_menu_activity.feature b/blocks/blog_menu/tests/behat/block_blog_menu_activity.feature index 586e00c51ec..40e676f6bb7 100644 --- a/blocks/blog_menu/tests/behat/block_blog_menu_activity.feature +++ b/blocks/blog_menu/tests/behat/block_blog_menu_activity.feature @@ -18,12 +18,16 @@ Feature: Enable Block blog menu in an activity | teacher1 | C1 | editingteacher | | student1 | C1 | student | | student2 | C1 | student | + Given the following "activity" exists: + | activity | assign | + | name | Test assignment 1 | + | intro | Offline text | + | course | C1 | + | idnumber | 0001 | + | section | 1 | + | assignsubmission_file_enabled | 0 | And I log in as "teacher1" And I am on "Course 1" course homepage with editing mode on - And I add a "Assignment" to section "1" and I fill the form with: - | Assignment name | Test assignment 1 | - | Description | Offline text | - | assignsubmission_file_enabled | 0 | And I follow "Test assignment 1" And I add the "Blog menu" block And I log out diff --git a/blocks/blog_recent/tests/behat/block_blog_recent_activity.feature b/blocks/blog_recent/tests/behat/block_blog_recent_activity.feature index 09112b7162c..70407adb747 100644 --- a/blocks/blog_recent/tests/behat/block_blog_recent_activity.feature +++ b/blocks/blog_recent/tests/behat/block_blog_recent_activity.feature @@ -18,12 +18,16 @@ Feature: Students can use the recent blog entries block to view recent entries o | teacher1 | C1 | editingteacher | | student1 | C1 | student | | student2 | C1 | student | + And the following "activity" exists: + | activity | assign | + | course | C1 | + | idnumber | 0001 | + | name | Test assignment 1 | + | intro | Offline text | + | section | 1 | + | assignsubmission_file_enabled | 0 | And I log in as "teacher1" And I am on "Course 1" course homepage with editing mode on - And I add a "Assignment" to section "1" and I fill the form with: - | Assignment name | Test assignment 1 | - | Description | Offline text | - | assignsubmission_file_enabled | 0 | And I follow "Test assignment 1" And I add the "Blog menu" block And I add the "Recent blog entries" block diff --git a/blocks/section_links/tests/behat/block_section_links_course.feature b/blocks/section_links/tests/behat/block_section_links_course.feature index 5ef506d9a89..c1fd0b2b03c 100644 --- a/blocks/section_links/tests/behat/block_section_links_course.feature +++ b/blocks/section_links/tests/behat/block_section_links_course.feature @@ -14,12 +14,11 @@ Feature: The section links block allows users to quickly navigate around a moodl And the following "course enrolments" exist: | user | course | role | | teacher1 | C1 | editingteacher | + And the following "activities" exist: + | activity | name | intro | course | section | idnumber | assignsubmission_file_enabled | + | assign | Test assignment 1 | Offline text | C1 | 5 | assign1 | 0 | And I log in as "teacher1" And I am on "Course 1" course homepage with editing mode on - And I add a "Assignment" to section "5" and I fill the form with: - | Assignment name | Test assignment 1 | - | Description | Offline text | - | assignsubmission_file_enabled | 0 | Scenario: Add the section links block to a course. Given I add the "Section links" block diff --git a/blocks/tests/behat/manage_blocks.feature b/blocks/tests/behat/manage_blocks.feature index afc49fd3497..e3903a9ce64 100644 --- a/blocks/tests/behat/manage_blocks.feature +++ b/blocks/tests/behat/manage_blocks.feature @@ -14,15 +14,18 @@ Feature: Block appearances And the following "course enrolments" exist: | user | course | role | | teacher1 | C1 | editingteacher | + And the following "activities" exist: + | activity | name | description | course | idnumber | section | + | survey | Test survey name | Test survey description | C1 | survey1 | 1 | + | book | Test book name | Test book description | C1 | book1 | 1 | And I log in as "admin" - And I am on "Course 1" course homepage with editing mode on - And I add a "Survey" to section "1" and I fill the form with: - | Name | Test survey name | + And I am on "Course 1" course homepage + And I follow "Test survey name" + And I navigate to "Edit settings" in current page administration + And I set the following fields to these values: | Survey type | ATTLS (20 item version) | - | Description | Test survey description | - And I add a "Book" to section "1" and I fill the form with: - | Name | Test book name | - | Description | Test book description | + And I press "Save and return to course" + And I am on "Course 1" course homepage with editing mode on And I follow "Test book name" And I set the following fields to these values: | Chapter title | Book title | diff --git a/blocks/tests/behat/return_block_original_state.feature b/blocks/tests/behat/return_block_original_state.feature index 79c4b97a904..c0f45f5f121 100644 --- a/blocks/tests/behat/return_block_original_state.feature +++ b/blocks/tests/behat/return_block_original_state.feature @@ -8,6 +8,10 @@ Feature: The context of a block can always be returned to it's original state. Given the following "courses" exist: | fullname | shortname | category | | Course 1 | C1 | 0 | + And the following "activities" exist: + | activity | name | intro | course | section | idnumber | + | assign | Assignment1 | Description | C1 | 1 | assign1 | + | assign | Assignment2 | Description | C1 | 1 | assign1 | And I log in as "admin" When I am on "Course 1" course homepage with editing mode on And I add the "Tags" block @@ -18,9 +22,6 @@ Feature: The context of a block can always be returned to it's original state. | Display on page types | Any page | And I press "Save changes" And I am on "Course 1" course homepage - And I add a "Assignment" to section "1" and I fill the form with: - | Assignment name | Assignment1 | - | Description | Description | And I follow "Assignment1" And I configure the "Tags" block And I set the following fields to these values: @@ -32,9 +33,6 @@ Feature: The context of a block can always be returned to it's original state. And I navigate to course participants And "Tags" "block" should not exist And I am on "Course 1" course homepage - And I add a "Assignment" to section "1" and I fill the form with: - | Assignment name | Assignment2 | - | Description | Description | And I follow "Assignment2" And I should see "Tags" in the "Tags" "block" And I configure the "Tags" block diff --git a/completion/tests/behat/completion_no_calendar_capabilities.feature b/completion/tests/behat/completion_no_calendar_capabilities.feature index f690f76e556..f9f73e64d85 100644 --- a/completion/tests/behat/completion_no_calendar_capabilities.feature +++ b/completion/tests/behat/completion_no_calendar_capabilities.feature @@ -14,8 +14,25 @@ Feature: Completion with no calendar capabilites And the following "course enrolments" exist: | user | course | role | | teacher1 | C1 | editingteacher | + And the following "activity" exists: + | activity | forum | + | course | C1 | + | idnumber | 00001 | + | name | Test forum name | + | intro | Test forum name description | + | section | 1 | + | completion | 2 | And I log in as "admin" And I am on "Course 1" course homepage + And I follow "Test forum name" + And I navigate to "Edit settings" in current page administration + And I set the following fields to these values: + | id_completionexpected_enabled | 1 | + | id_completionexpected_day | 1 | + | id_completionexpected_month | 1 | + | id_completionexpected_year | 2017 | + And I press "Save and return to course" + And I am on "Course 1" course homepage And I navigate to "Users > Permissions" in current page administration And I override the system permissions of "Teacher" role with: | capability | permission | @@ -23,17 +40,6 @@ Feature: Completion with no calendar capabilites And I log out Scenario: Editing completion date - Given I log in as "admin" - And I am on "Course 1" course homepage with editing mode on - When I add a "Forum" to section "1" and I fill the form with: - | Forum name | Test forum name | - | Description | Test forum description | - | Completion tracking | Show activity as complete when conditions are met | - | id_completionexpected_enabled | 1 | - | id_completionexpected_day | 1 | - | id_completionexpected_month | 1 | - | id_completionexpected_year | 2017 | - And I log out When I log in as "teacher1" And I am on "Course 1" course homepage with editing mode on And I follow "Test forum name" diff --git a/course/renderer.php b/course/renderer.php index c17897f5f56..23c9b2427c1 100644 --- a/course/renderer.php +++ b/course/renderer.php @@ -272,100 +272,21 @@ class core_course_renderer extends plugin_renderer_base { * @return string */ function course_section_add_cm_control($course, $section, $sectionreturn = null, $displayoptions = array()) { - global $CFG, $USER; - // The returned control HTML can be one of the following: // - Only the non-ajax control (select menus of activities and resources) with a noscript fallback for non js clients. + // Please note that non-ajax control has been deprecated and it will be removed in the future. + // - Only the ajax control (the link which when clicked produces the activity chooser modal). No noscript fallback. - // - [Behat only]: The non-ajax control and optionally the ajax control (depending on site settings). If included, the link - // takes priority and the non-ajax control is wrapped in a