diff --git a/blocks/activity_results/edit_form.php b/blocks/activity_results/edit_form.php index 0342ee6d567..def729c258c 100644 --- a/blocks/activity_results/edit_form.php +++ b/blocks/activity_results/edit_form.php @@ -124,4 +124,13 @@ class block_activity_results_edit_form extends block_edit_form { $mform->freeze('config_decimalpoints'); } } + + /** + * Display the configuration form when block is being added to the page + * + * @return bool + */ + public static function display_form_when_adding(): bool { + return true; + } } \ No newline at end of file diff --git a/blocks/activity_results/tests/behat/addblockinactivity.feature b/blocks/activity_results/tests/behat/addblockinactivity.feature index c9d32db7c27..1a7cf4d9901 100644 --- a/blocks/activity_results/tests/behat/addblockinactivity.feature +++ b/blocks/activity_results/tests/behat/addblockinactivity.feature @@ -47,15 +47,12 @@ Feature: The activity results block displays student scores Scenario: Configure the block on a non-graded activity to show 3 high scores Given I am on the "Test page name" "page activity" page - And I add the "Activity results" block - When I configure the "Activity results" block - And I set the following fields to these values: + And I add the "Activity results" block to the default region with: | config_activitygradeitemid | Test assignment 1 | | config_showbest | 3 | | config_showworst | 0 | | config_gradeformat | Absolute numbers | | config_nameformat | Display full names | - And I press "Save changes" Then I should see "Student 1" in the "Activity results" "block" And I should see "90.00" in the "Activity results" "block" And I should see "Student 2" in the "Activity results" "block" @@ -63,26 +60,24 @@ Feature: The activity results block displays student scores And I should see "Student 3" in the "Activity results" "block" And I should see "70.00" in the "Activity results" "block" + @javascript Scenario: Block should select current activity by default - Given I am on the "Test assignment 1" "assign activity" page - When I add the "Activity results" block - And I configure the "Activity results" block - Then the field "config_activitygradeitemid" matches value "Test assignment 1" - And I press "Cancel" + Given I click on "Test assignment 1" "link" in the "region-main" "region" + When I add the "Activity results..." block + Then the field "config_activitygradeitemid" in the "Add Activity results block" "dialogue" matches value "Test assignment 1" + And I click on "Save changes" "button" in the "Add Activity results block" "dialogue" And I am on "Course 1" course homepage - And I am on the "Test assignment 2" "assign activity" page - And I add the "Activity results" block - And I configure the "Activity results" block - And the field "config_activitygradeitemid" matches value "Test assignment 2" - And I press "Cancel" + And I click on "Test assignment 2" "link" in the "region-main" "region" + And I add the "Activity results..." block + And the field "config_activitygradeitemid" in the "Add Activity results block" "dialogue" matches value "Test assignment 2" + And I click on "Save changes" "button" in the "Add Activity results block" "dialogue" And I am on "Course 1" course homepage - And I am on the "Test assignment 3" "assign activity" page - And I add the "Activity results" block - And I configure the "Activity results" block - And the field "config_activitygradeitemid" matches value "Test assignment 3" - And I press "Cancel" + And I click on "Test assignment 3" "link" in the "region-main" "region" + And I add the "Activity results..." block + And the field "config_activitygradeitemid" in the "Add Activity results block" "dialogue" matches value "Test assignment 3" + And I click on "Save changes" "button" in the "Add Activity results block" "dialogue" And I am on "Course 1" course homepage - And I am on the "Test page name" "page activity" page - And I add the "Activity results" block - And I configure the "Activity results" block - And the field "config_activitygradeitemid" does not match value "Test page name" + And I click on "Test page name" "link" in the "region-main" "region" + And I add the "Activity results..." block + And the field "config_activitygradeitemid" in the "Add Activity results block" "dialogue" does not match value "Test page name" + And I click on "Save changes" "button" in the "Add Activity results block" "dialogue" diff --git a/blocks/activity_results/tests/behat/addunconfiguredblock.feature b/blocks/activity_results/tests/behat/addunconfiguredblock.feature index c2e5b140a32..c10100512c2 100644 --- a/blocks/activity_results/tests/behat/addunconfiguredblock.feature +++ b/blocks/activity_results/tests/behat/addunconfiguredblock.feature @@ -17,10 +17,16 @@ Feature: The activity results block doesn't displays student scores for unconfig And I log in as "teacher1" And I am on "Course 1" course homepage with editing mode on - Scenario: Add the block to a the course + Scenario: Add the block to a the course with Javascript disabled Given I add the "Activity results" block Then I should see "Please configure this block and select which activity it should display results from." in the "Activity results" "block" + @javascript + Scenario: Add the block to a the course with Javascript enabled + Given I add the "Activity results" block to the default region with: + | config_showbest | 3 | + 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 the course page in a course without activities Given 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 aba0c34c46e..d16005a59a6 100644 --- a/blocks/activity_results/tests/behat/highscoreswithoutgroups.feature +++ b/blocks/activity_results/tests/behat/highscoreswithoutgroups.feature @@ -39,63 +39,48 @@ Feature: The activity results block displays student high scores And I am on "Course 1" course homepage Scenario: Configure the block on the course page to show 0 high scores - Given I add the "Activity results" block - When I configure the "Activity results" block - And I set the following fields to these values: + Given I add the "Activity results" block to the default region with: | config_showbest | 0 | | config_showworst | 0 | | config_gradeformat | Percentages | | config_nameformat | Display full names | - And I press "Save changes" Then I should see "This block's configuration currently does not allow it to show any results." in the "Activity results" "block" Scenario: Configure the block on the course page to show 1 high score - Given I add the "Activity results" block - When I configure the "Activity results" block - And I set the following fields to these values: + Given I add the "Activity results" block to the default region with: | config_showbest | 1 | | config_showworst | 0 | | config_gradeformat | Percentages | | config_nameformat | Display full names | | config_decimalpoints | 0 | - And I press "Save changes" Then I should see "Student 1" in the "Activity results" "block" And I should see "90%" in the "Activity results" "block" Scenario: Try to configure the block on the course page to show 1 high score as a fraction - Given I add the "Activity results" block - When I configure the "Activity results" block - And I set the following fields to these values: + Given I add the "Activity results" block to the default region with: | config_showbest | 1 | | config_showworst | 0 | | config_gradeformat | Fractions | | config_nameformat | Display full names | - And I press "Save changes" Then I should see "Student 1" in the "Activity results" "block" And I should see "90.00/100.00" in the "Activity results" "block" Scenario: Try to configure the block on the course page to show 1 high score as a absolute numbers - Given I add the "Activity results" block - When I configure the "Activity results" block - And I set the following fields to these values: + Given I add the "Activity results" block to the default region with: | config_showbest | 1 | | config_showworst | 0 | | config_gradeformat | Absolute numbers | | config_nameformat | Display full names | - And I press "Save changes" Then I should see "Student 1" in the "Activity results" "block" And I should see "90.00" in the "Activity results" "block" Scenario: Try to configure the block on the course page to show multiple high scores as percentages - Given I add the "Activity results" block - When I configure the "Activity results" block - And I set the following fields to these values: + Given I add the "Activity results" block to the default region with: | config_showbest | 3 | | config_showworst | 0 | | config_gradeformat | Percentages | | config_nameformat | Display full names | | config_decimalpoints | 0 | - And I press "Save changes" Then I should see "Student 1" in the "Activity results" "block" And I should see "90%" in the "Activity results" "block" And I should see "Student 2" in the "Activity results" "block" @@ -104,14 +89,11 @@ Feature: The activity results block displays student high scores And I should see "70%" in the "Activity results" "block" Scenario: Try to configure the block on the course page to show multiple high scores as fractions - Given I add the "Activity results" block - When I configure the "Activity results" block - And I set the following fields to these values: + Given I add the "Activity results" block to the default region with: | config_showbest | 3 | | config_showworst | 0 | | config_gradeformat | Fractions | | config_nameformat | Display full names | - And I press "Save changes" Then I should see "Student 1" in the "Activity results" "block" And I should see "90.00/100.00" in the "Activity results" "block" And I should see "Student 2" in the "Activity results" "block" @@ -120,14 +102,11 @@ Feature: The activity results block displays student high scores And I should see "70.00/100.00" in the "Activity results" "block" Scenario: Try to configure the block on the course page to show multiple high scores as absolute numbers - Given I add the "Activity results" block - When I configure the "Activity results" block - And I set the following fields to these values: + Given I add the "Activity results" block to the default region with: | config_showbest | 3 | | config_showworst | 0 | | config_gradeformat | Absolute numbers | | config_nameformat | Display full names | - And I press "Save changes" Then I should see "Student 1" in the "Activity results" "block" And I should see "90.00" in the "Activity results" "block" And I should see "Student 2" in the "Activity results" "block" @@ -138,14 +117,11 @@ Feature: The activity results block displays student high scores Scenario: Try to configure the block on the course page to show multiple high scores using ID numbers Given the following config values are set as admin: | showuseridentity | idnumber,email | - And I add the "Activity results" block - When I configure the "Activity results" block - And I set the following fields to these values: + And I add the "Activity results" block to the default region with: | config_showbest | 3 | | config_showworst | 0 | | config_gradeformat | Percentages | | config_nameformat | Display only ID numbers | - And I press "Save changes" Then I should see "User S1" in the "Activity results" "block" And I should see "90.00%" in the "Activity results" "block" And I should see "User S2" in the "Activity results" "block" @@ -154,14 +130,11 @@ Feature: The activity results block displays student high scores And I should see "70.00%" in the "Activity results" "block" Scenario: Try to configure the block on the course page to show multiple high scores using anonymous names - Given I add the "Activity results" block - When I configure the "Activity results" block - And I set the following fields to these values: + Given I add the "Activity results" block to the default region with: | config_showbest | 3 | | config_showworst | 0 | | config_gradeformat | Percentages | | config_nameformat | Anonymous results | - And I press "Save changes" Then I should see "User" in the "Activity results" "block" And I should see "90.00%" in the "Activity results" "block" And I should see "80.00%" in the "Activity results" "block" diff --git a/blocks/activity_results/tests/behat/highscoreswithscales.feature b/blocks/activity_results/tests/behat/highscoreswithscales.feature index 0af28c4aee5..493ec00d2c9 100644 --- a/blocks/activity_results/tests/behat/highscoreswithscales.feature +++ b/blocks/activity_results/tests/behat/highscoreswithscales.feature @@ -58,25 +58,19 @@ Feature: The activity results block displays students high scores in group as sc 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 - When I configure the "Activity results" block - And I set the following fields to these values: + Given I add the "Activity results" block to the default region with: | config_showbest | 1 | | config_showworst | 0 | | config_nameformat | Display full names | | config_decimalpoints | 0 | - And I press "Save changes" Then I should see "Student 1" in the "Activity results" "block" And I should see "Excellent!" in the "Activity results" "block" Scenario: Try to configure the block on the course page to show multiple high scores using full names - Given I add the "Activity results" block - When I configure the "Activity results" block - And I set the following fields to these values: + Given I add the "Activity results" block to the default region with: | config_showbest | 3 | | config_showworst | 0 | | config_nameformat | Display full names | - And I press "Save changes" Then I should see "Student 1" in the "Activity results" "block" And I should see "Excellent!" in the "Activity results" "block" And I should see "Student 2" in the "Activity results" "block" @@ -87,13 +81,10 @@ Feature: The activity results block displays students high scores in group as sc Scenario: Try to configure the block on the course page to show multiple high scores using ID numbers Given the following config values are set as admin: | showuseridentity | idnumber,email | - And I add the "Activity results" block - When I configure the "Activity results" block - And I set the following fields to these values: + And I add the "Activity results" block to the default region with: | config_showbest | 3 | | config_showworst | 0 | | config_nameformat | Display only ID numbers | - And I press "Save changes" Then I should see "User S1" in the "Activity results" "block" And I should see "Excellent!" in the "Activity results" "block" And I should see "User S2" in the "Activity results" "block" @@ -102,13 +93,10 @@ Feature: The activity results block displays students high scores in group as sc And I should see "Good" in the "Activity results" "block" Scenario: Try to configure the block on the course page to show multiple high scores using anonymous names - Given I add the "Activity results" block - When I configure the "Activity results" block - And I set the following fields to these values: + Given I add the "Activity results" block to the default region with: | config_showbest | 3 | | config_showworst | 0 | | config_nameformat | Anonymous results | - And I press "Save changes" Then I should see "User" in the "Activity results" "block" And I should not see "Student 1" in the "Activity results" "block" And I should see "Excellent!" in the "Activity results" "block" diff --git a/blocks/activity_results/tests/behat/highscoreswithscalesandgroups.feature b/blocks/activity_results/tests/behat/highscoreswithscalesandgroups.feature index d3b3b686341..0713734e817 100644 --- a/blocks/activity_results/tests/behat/highscoreswithscalesandgroups.feature +++ b/blocks/activity_results/tests/behat/highscoreswithscalesandgroups.feature @@ -44,6 +44,7 @@ Feature: The activity results block displays student in group high scores as sca And the following "activities" exist: | activity | name | intro | course | section | idnumber | | assign | Test assignment | Offline text | C1 | 1 | assign1 | + And I change window size to "large" And I log in as "teacher1" And I am on "Course 1" course homepage with editing mode on And I navigate to "Scales" in the course gradebook @@ -73,14 +74,11 @@ Feature: The activity results block displays student in group high scores as sca And I am on "Course 1" course homepage Scenario: Try to configure the block on the course page to show 1 high score - Given I add the "Activity results" block - When I configure the "Activity results" block - And I set the following fields to these values: + Given I add the "Activity results" block to the default region with: | config_showbest | 1 | | config_showworst | 0 | | config_nameformat | Display full names | | config_usegroups | Yes | - And I press "Save changes" Then I should see "Group 1" in the "Activity results" "block" And I should see "Excellent!" in the "Activity results" "block" And I log out @@ -90,14 +88,11 @@ Feature: The activity results block displays student in group high scores as sca And I should see "Excellent!" in the "Activity results" "block" Scenario: Try to configure the block on the course page to show multiple high scores using full names - Given I add the "Activity results" block - When I configure the "Activity results" block - And I set the following fields to these values: + Given I add the "Activity results" block to the default region with: | config_showbest | 3 | | config_showworst | 0 | | config_nameformat | Display full names | | config_usegroups | Yes | - And I press "Save changes" Then I should see "Group 1" in the "Activity results" "block" And I should see "Excellent!" in the "Activity results" "block" And I should see "Group 2" in the "Activity results" "block" @@ -115,14 +110,11 @@ Feature: The activity results block displays student in group high scores as sca Scenario: Try to configure the block on the course page to show multiple high scores using ID numbers Given the following config values are set as admin: | showuseridentity | idnumber,email | - And I add the "Activity results" block - When I configure the "Activity results" block - And I set the following fields to these values: + And I add the "Activity results" block to the default region with: | config_showbest | 3 | | config_showworst | 0 | | config_nameformat | Display only ID numbers | | config_usegroups | Yes | - And I press "Save changes" Then I should see "Group" in the "Activity results" "block" And I should see "Excellent!" in the "Activity results" "block" And I should see "Very good" in the "Activity results" "block" @@ -138,14 +130,11 @@ Feature: The activity results block displays student in group high scores as sca And I should see "Very good" in the "Activity results" "block" Scenario: Try to configure the block on the course page to show multiple high scores using anonymous names - Given I add the "Activity results" block - When I configure the "Activity results" block - And I set the following fields to these values: + Given I add the "Activity results" block to the default region with: | config_showbest | 3 | | config_showworst | 0 | | config_nameformat | Anonymous results | | config_usegroups | Yes | - And I press "Save changes" Then I should see "Group" in the "Activity results" "block" And I should see "Excellent!" in the "Activity results" "block" And I should see "Very good" in the "Activity results" "block" diff --git a/blocks/activity_results/tests/behat/highscoreswithseperategroups.feature b/blocks/activity_results/tests/behat/highscoreswithseperategroups.feature index daa5d10a11d..a0c854d458f 100644 --- a/blocks/activity_results/tests/behat/highscoreswithseperategroups.feature +++ b/blocks/activity_results/tests/behat/highscoreswithseperategroups.feature @@ -63,29 +63,23 @@ Feature: The activity results block displays student in separate groups scores And I am on "Course 1" course homepage Scenario: Configure the block on the course page to show 1 high score - Given I add the "Activity results" block - When I configure the "Activity results" block - And I set the following fields to these values: + Given I add the "Activity results" block to the default region with: | config_showbest | 1 | | config_showworst | 0 | | config_gradeformat | Percentages | | config_nameformat | Display full names | | config_decimalpoints | 0 | | config_usegroups | Yes | - And I press "Save changes" Then I should see "Group 1" in the "Activity results" "block" And I should see "95%" in the "Activity results" "block" Scenario: Try to configure the block on the course page to show 1 high score as a fraction - Given I add the "Activity results" block - When I configure the "Activity results" block - And I set the following fields to these values: + Given I add the "Activity results" block to the default region with: | config_showbest | 1 | | config_showworst | 0 | | config_gradeformat | Fractions | | config_nameformat | Display full names | | config_usegroups | Yes | - And I press "Save changes" Then I should see "Group 1" in the "Activity results" "block" And I should see "95.00/100.00" in the "Activity results" "block" And I log out @@ -95,15 +89,12 @@ Feature: The activity results block displays student in separate groups scores And I should see "100.00/100.00" in the "Activity results" "block" Scenario: Try to configure the block on the course page to show 1 high score as a absolute numbers - Given I add the "Activity results" block - When I configure the "Activity results" block - And I set the following fields to these values: + Given I add the "Activity results" block to the default region with: | config_showbest | 1 | | config_showworst | 0 | | config_gradeformat | Absolute numbers | | config_nameformat | Display full names | | config_usegroups | Yes | - And I press "Save changes" Then I should see "Group 1" in the "Activity results" "block" And I should see "95.00" in the "Activity results" "block" And I log out @@ -113,16 +104,13 @@ Feature: The activity results block displays student in separate groups scores And I should see "100.00" in the "Activity results" "block" Scenario: Try to configure the block on the course page to show multiple high scores as percentages - Given I add the "Activity results" block - When I configure the "Activity results" block - And I set the following fields to these values: + Given I add the "Activity results" block to the default region with: | config_showbest | 3 | | config_showworst | 0 | | config_gradeformat | Percentages | | config_nameformat | Display full names | | config_decimalpoints | 0 | | config_usegroups | Yes | - And I press "Save changes" Then I should see "Group 1" in the "Activity results" "block" And I should see "95%" in the "Activity results" "block" And I should see "Group 2" in the "Activity results" "block" @@ -138,15 +126,12 @@ Feature: The activity results block displays student in separate groups scores And I should see "90%" in the "Activity results" "block" Scenario: Try to configure the block on the course page to show multiple high scores as fractions - Given I add the "Activity results" block - When I configure the "Activity results" block - And I set the following fields to these values: + Given I add the "Activity results" block to the default region with: | config_showbest | 3 | | config_showworst | 0 | | config_gradeformat | Fractions | | config_nameformat | Display full names | | config_usegroups | Yes | - And I press "Save changes" Then I should see "Group 1" in the "Activity results" "block" And I should see "95.00/100.00" in the "Activity results" "block" And I should see "Group 2" in the "Activity results" "block" @@ -162,15 +147,12 @@ Feature: The activity results block displays student in separate groups scores And I should see "80.00/100.00" in the "Activity results" "block" Scenario: Try to configure the block on the course page to show multiple high scores as absolute numbers - Given I add the "Activity results" block - When I configure the "Activity results" block - And I set the following fields to these values: + Given I add the "Activity results" block to the default region with: | config_showbest | 3 | | config_showworst | 0 | | config_gradeformat | Absolute numbers | | config_nameformat | Display full names | | config_usegroups | Yes | - And I press "Save changes" Then I should see "Group 1" in the "Activity results" "block" And I should see "95.00" in the "Activity results" "block" And I should see "Group 2" in the "Activity results" "block" @@ -188,15 +170,12 @@ Feature: The activity results block displays student in separate groups scores Scenario: Try to configure the block on the course page to show multiple high scores using ID numbers Given the following config values are set as admin: | showuseridentity | idnumber,email | - And I add the "Activity results" block - When I configure the "Activity results" block - And I set the following fields to these values: + And I add the "Activity results" block to the default region with: | config_showbest | 3 | | config_showworst | 0 | | config_gradeformat | Percentages | | config_nameformat | Display only ID numbers | | config_usegroups | Yes | - And I press "Save changes" Then I should see "Group" in the "Activity results" "block" And I should see "95.00%" in the "Activity results" "block" And I should see "85.00%" in the "Activity results" "block" @@ -212,15 +191,12 @@ Feature: The activity results block displays student in separate groups scores And I should see "90.00%" in the "Activity results" "block" Scenario: Try to configure the block on the course page to show multiple high scores using anonymous names - Given I add the "Activity results" block - When I configure the "Activity results" block - And I set the following fields to these values: + Given I add the "Activity results" block to the default region with: | config_showbest | 3 | | config_showworst | 0 | | config_gradeformat | Percentages | | config_nameformat | Anonymous results | | config_usegroups | Yes | - And I press "Save changes" Then I should see "Group" in the "Activity results" "block" And I should see "95.00%" in the "Activity results" "block" And I should see "85.00%" in the "Activity results" "block" diff --git a/blocks/activity_results/tests/behat/highscoreswithvisiblegroups.feature b/blocks/activity_results/tests/behat/highscoreswithvisiblegroups.feature index 6b3103b0af3..ee396e360fe 100644 --- a/blocks/activity_results/tests/behat/highscoreswithvisiblegroups.feature +++ b/blocks/activity_results/tests/behat/highscoreswithvisiblegroups.feature @@ -64,29 +64,23 @@ Feature: The activity results block displays student in visible groups scores And I am on "Course 1" course homepage Scenario: Configure the block on the course page to show 1 high score - Given I add the "Activity results" block - When I configure the "Activity results" block - And I set the following fields to these values: + Given I add the "Activity results" block to the default region with: | config_showbest | 1 | | config_showworst | 0 | | config_gradeformat | Percentages | | config_nameformat | Display full names | | config_decimalpoints | 0 | | config_usegroups | Yes | - And I press "Save changes" Then I should see "Group 1" in the "Activity results" "block" And I should see "95%" in the "Activity results" "block" Scenario: Try to configure the block on the course page to show 1 high score as a fraction - Given I add the "Activity results" block - When I configure the "Activity results" block - And I set the following fields to these values: + Given I add the "Activity results" block to the default region with: | config_showbest | 1 | | config_showworst | 0 | | config_gradeformat | Fractions | | config_nameformat | Display full names | | config_usegroups | Yes | - And I press "Save changes" And I log out Then I log in as "student1" And I am on "Course 1" course homepage @@ -94,15 +88,12 @@ Feature: The activity results block displays student in visible groups scores And I should see "95.00/100.00" in the "Activity results" "block" Scenario: Try to configure the block on the course page to show 1 high score as a absolute numbers - Given I add the "Activity results" block - When I configure the "Activity results" block - And I set the following fields to these values: + Given I add the "Activity results" block to the default region with: | config_showbest | 1 | | config_showworst | 0 | | config_gradeformat | Absolute numbers | | config_nameformat | Display full names | | config_usegroups | Yes | - And I press "Save changes" And I log out Then I log in as "student1" And I am on "Course 1" course homepage @@ -110,16 +101,13 @@ Feature: The activity results block displays student in visible groups scores And I should see "95.00" in the "Activity results" "block" Scenario: Try to configure the block on the course page to show multiple high scores as percentages - Given I add the "Activity results" block - When I configure the "Activity results" block - And I set the following fields to these values: + Given I add the "Activity results" block to the default region with: | config_showbest | 3 | | config_showworst | 0 | | config_gradeformat | Percentages | | config_nameformat | Display full names | | config_decimalpoints | 0 | | config_usegroups | Yes | - And I press "Save changes" And I log out Then I log in as "student1" And I am on "Course 1" course homepage @@ -131,15 +119,12 @@ Feature: The activity results block displays student in visible groups scores And I should see "75%" in the "Activity results" "block" Scenario: Try to configure the block on the course page to show multiple high scores as fractions - Given I add the "Activity results" block - When I configure the "Activity results" block - And I set the following fields to these values: + Given I add the "Activity results" block to the default region with: | config_showbest | 3 | | config_showworst | 0 | | config_gradeformat | Fractions | | config_nameformat | Display full names | | config_usegroups | Yes | - And I press "Save changes" And I log out Then I log in as "student1" And I am on "Course 1" course homepage @@ -151,15 +136,12 @@ Feature: The activity results block displays student in visible groups scores And I should see "75.00/100.00" in the "Activity results" "block" Scenario: Try to configure the block on the course page to show multiple high scores as absolute numbers - Given I add the "Activity results" block - When I configure the "Activity results" block - And I set the following fields to these values: + Given I add the "Activity results" block to the default region with: | config_showbest | 3 | | config_showworst | 0 | | config_gradeformat | Absolute numbers | | config_nameformat | Display full names | | config_usegroups | Yes | - And I press "Save changes" And I log out Then I log in as "student1" And I am on "Course 1" course homepage @@ -173,15 +155,12 @@ Feature: The activity results block displays student in visible groups scores Scenario: Try to configure the block on the course page to show multiple high scores using ID numbers Given the following config values are set as admin: | showuseridentity | idnumber,email | - And I add the "Activity results" block - When I configure the "Activity results" block - And I set the following fields to these values: + And I add the "Activity results" block to the default region with: | config_showbest | 3 | | config_showworst | 0 | | config_gradeformat | Percentages | | config_nameformat | Display only ID numbers | | config_usegroups | Yes | - And I press "Save changes" And I log out Then I log in as "student1" And I am on "Course 1" course homepage @@ -191,15 +170,12 @@ Feature: The activity results block displays student in visible groups scores And I should see "75.00%" in the "Activity results" "block" Scenario: Try to configure the block on the course page to show multiple high scores using anonymous names - Given I add the "Activity results" block - When I configure the "Activity results" block - And I set the following fields to these values: + Given I add the "Activity results" block to the default region with: | config_showbest | 3 | | config_showworst | 0 | | config_gradeformat | Percentages | | config_nameformat | Anonymous results | | config_usegroups | Yes | - And I press "Save changes" And I log out Then I log in as "student1" And I am on "Course 1" course homepage diff --git a/blocks/activity_results/tests/behat/lowscoreswithoutgroups.feature b/blocks/activity_results/tests/behat/lowscoreswithoutgroups.feature index 4ed74d718d6..2b7a95d2646 100644 --- a/blocks/activity_results/tests/behat/lowscoreswithoutgroups.feature +++ b/blocks/activity_results/tests/behat/lowscoreswithoutgroups.feature @@ -44,52 +44,40 @@ Feature: The activity results block displays student low scores And I am on "Course 1" course homepage Scenario: Configure the block on the course page to show 1 low score - Given I add the "Activity results" block - When I configure the "Activity results" block - And I set the following fields to these values: + Given I add the "Activity results" block to the default region with: | config_showbest | 0 | | config_showworst | 1 | | config_gradeformat | Percentages | | config_nameformat | Display full names | | config_decimalpoints | 0 | - And I press "Save changes" Then I should see "Student 5" in the "Activity results" "block" And I should see "50%" in the "Activity results" "block" Scenario: Try to configure the block on the course page to show 1 low score as a fraction - Given I add the "Activity results" block - When I configure the "Activity results" block - And I set the following fields to these values: + Given I add the "Activity results" block to the default region with: | config_showbest | 0 | | config_showworst | 1 | | config_gradeformat | Fractions | | config_nameformat | Display full names | - And I press "Save changes" Then I should see "Student 5" in the "Activity results" "block" And I should see "50.00/100.00" in the "Activity results" "block" Scenario: Try to configure the block on the course page to show 1 low score as a absolute number - Given I add the "Activity results" block - When I configure the "Activity results" block - And I set the following fields to these values: + Given I add the "Activity results" block to the default region with: | config_showbest | 0 | | config_showworst | 1 | | config_gradeformat | Absolute numbers | | config_nameformat | Display full names | - And I press "Save changes" Then I should see "Student 5" in the "Activity results" "block" And I should see "50.00" in the "Activity results" "block" Scenario: Try to configure the block on the course page to show multiple low scores as percentages - Given I add the "Activity results" block - When I configure the "Activity results" block - And I set the following fields to these values: + Given I add the "Activity results" block to the default region with: | config_showbest | 0 | | config_showworst | 3 | | config_gradeformat | Percentages | | config_nameformat | Display full names | | config_decimalpoints | 0 | - And I press "Save changes" Then I should see "Student 5" in the "Activity results" "block" And I should see "50%" in the "Activity results" "block" And I should see "Student 4" in the "Activity results" "block" @@ -98,14 +86,11 @@ Feature: The activity results block displays student low scores And I should see "70%" in the "Activity results" "block" Scenario: Try to configure the block on the course page to show multiple low scores as fractions - Given I add the "Activity results" block - When I configure the "Activity results" block - And I set the following fields to these values: + Given I add the "Activity results" block to the default region with: | config_showbest | 0 | | config_showworst | 3 | | config_gradeformat | Fractions | | config_nameformat | Display full names | - And I press "Save changes" Then I should see "Student 5" in the "Activity results" "block" And I should see "50.00/100.00" in the "Activity results" "block" And I should see "Student 4" in the "Activity results" "block" @@ -114,14 +99,11 @@ Feature: The activity results block displays student low scores And I should see "70.00/100.00" in the "Activity results" "block" Scenario: Try to configure the block on the course page to show multiple low scores as absolute numbers - Given I add the "Activity results" block - When I configure the "Activity results" block - And I set the following fields to these values: + Given I add the "Activity results" block to the default region with: | config_showbest | 0 | | config_showworst | 3 | | config_gradeformat | Absolute numbers | | config_nameformat | Display full names | - And I press "Save changes" Then I should see "Student 5" in the "Activity results" "block" And I should see "50.00" in the "Activity results" "block" And I should see "Student 4" in the "Activity results" "block" @@ -132,14 +114,11 @@ Feature: The activity results block displays student low scores Scenario: Try to configure the block on the course page to show multiple low scores using ID numbers Given the following config values are set as admin: | showuseridentity | idnumber,email | - And I add the "Activity results" block - When I configure the "Activity results" block - And I set the following fields to these values: + And I add the "Activity results" block to the default region with: | config_showbest | 0 | | config_showworst | 3 | | config_gradeformat | Percentages | | config_nameformat | Display only ID numbers | - And I press "Save changes" Then I should see "User S5" in the "Activity results" "block" And I should see "50.00%" in the "Activity results" "block" And I should see "User S4" in the "Activity results" "block" @@ -148,14 +127,11 @@ Feature: The activity results block displays student low scores And I should see "70.00%" in the "Activity results" "block" Scenario: Try to configure the block on the course page to show multiple low scores using anonymous names - Given I add the "Activity results" block - When I configure the "Activity results" block - And I set the following fields to these values: + Given I add the "Activity results" block to the default region with: | config_showbest | 0 | | config_showworst | 3 | | config_gradeformat | Percentages | | config_nameformat | Anonymous results | - And I press "Save changes" Then I should see "User" in the "Activity results" "block" And I should see "50.00%" in the "Activity results" "block" And I should see "60.00%" in the "Activity results" "block" diff --git a/blocks/activity_results/tests/behat/lowscoreswithscales.feature b/blocks/activity_results/tests/behat/lowscoreswithscales.feature index 54b5654b232..95efff20f6f 100644 --- a/blocks/activity_results/tests/behat/lowscoreswithscales.feature +++ b/blocks/activity_results/tests/behat/lowscoreswithscales.feature @@ -58,26 +58,20 @@ Feature: The activity results block displays student low scores as scales And I am on "Course 1" course homepage Scenario: Configure the block on the course page to show 1 low score - Given I add the "Activity results" block - When I configure the "Activity results" block - And I set the following fields to these values: + Given I add the "Activity results" block to the default region with: | config_showbest | 0 | | config_showworst | 1 | | config_gradeformat | Percentages | | config_nameformat | Display full names | | config_decimalpoints | 0 | - And I press "Save changes" Then I should see "Student 5" in the "Activity results" "block" And I should see "Not good enough" in the "Activity results" "block" Scenario: Try to configure the block on the course page to show multiple low scores using full names - Given I add the "Activity results" block - When I configure the "Activity results" block - And I set the following fields to these values: + Given I add the "Activity results" block to the default region with: | config_showbest | 0 | | config_showworst | 3 | | config_nameformat | Display full names | - And I press "Save changes" Then I should see "Student 5" in the "Activity results" "block" And I should see "Not good enough" in the "Activity results" "block" And I should see "Student 4" in the "Activity results" "block" @@ -88,13 +82,10 @@ Feature: The activity results block displays student low scores as scales Scenario: Try to configure the block on the course page to show multiple low scores using ID numbers Given the following config values are set as admin: | showuseridentity | idnumber,email | - And I add the "Activity results" block - When I configure the "Activity results" block - And I set the following fields to these values: + And I add the "Activity results" block to the default region with: | config_showbest | 0 | | config_showworst | 3 | | config_nameformat | Display only ID numbers | - And I press "Save changes" Then I should see "User S5" in the "Activity results" "block" And I should see "Not good enough" in the "Activity results" "block" And I should see "User S4" in the "Activity results" "block" @@ -103,13 +94,10 @@ Feature: The activity results block displays student low scores as scales And I should see "Good" in the "Activity results" "block" Scenario: Try to configure the block on the course page to show multiple low scores using anonymous names - Given I add the "Activity results" block - When I configure the "Activity results" block - And I set the following fields to these values: + Given I add the "Activity results" block to the default region with: | config_showbest | 0 | | config_showworst | 3 | | config_nameformat | Anonymous results | - And I press "Save changes" Then I should see "User" in the "Activity results" "block" And I should not see "Student 5" in the "Activity results" "block" And I should see "Not good enough" in the "Activity results" "block" diff --git a/blocks/activity_results/tests/behat/lowscoreswithscalesandgroups.feature b/blocks/activity_results/tests/behat/lowscoreswithscalesandgroups.feature index f0f20b47f2c..67c711eda83 100644 --- a/blocks/activity_results/tests/behat/lowscoreswithscalesandgroups.feature +++ b/blocks/activity_results/tests/behat/lowscoreswithscalesandgroups.feature @@ -49,6 +49,7 @@ Feature: The activity results block displays students in groups low scores as sc | description | Offline text | | assignsubmission_file_enabled | 0 | | groupmode | 1 | + And I change window size to "large" And I log in as "teacher1" And I am on "Course 1" course homepage And I navigate to "Scales" in the course gradebook @@ -77,14 +78,11 @@ Feature: The activity results block displays students in groups low scores as sc And I am on "Course 1" course homepage Scenario: Try to configure the block on the course page to show 1 low score - Given I add the "Activity results" block - When I configure the "Activity results" block - And I set the following fields to these values: + Given I add the "Activity results" block to the default region with: | config_showbest | 0 | | config_showworst | 1 | | config_nameformat | Display full names | | config_usegroups | Yes | - And I press "Save changes" Then I should see "Group 3" in the "Activity results" "block" And I should see "Good" in the "Activity results" "block" And I log out @@ -94,14 +92,11 @@ Feature: The activity results block displays students in groups low scores as sc And I should see "Average" in the "Activity results" "block" Scenario: Try to configure the block on the course page to show multiple high scores using full names - Given I add the "Activity results" block - When I configure the "Activity results" block - And I set the following fields to these values: + Given I add the "Activity results" block to the default region with: | config_showbest | 0 | | config_showworst | 2 | | config_nameformat | Display full names | | config_usegroups | Yes | - And I press "Save changes" Then I should see "Group 2" in the "Activity results" "block" And I should see "Very good" in the "Activity results" "block" And I should see "Group 3" in the "Activity results" "block" @@ -117,14 +112,11 @@ Feature: The activity results block displays students in groups low scores as sc Scenario: Try to configure the block on the course page to show multiple high scores using ID numbers Given the following config values are set as admin: | showuseridentity | idnumber,email | - And I add the "Activity results" block - When I configure the "Activity results" block - And I set the following fields to these values: + And I add the "Activity results" block to the default region with: | config_showbest | 0 | | config_showworst | 2 | | config_nameformat | Display only ID numbers | | config_usegroups | Yes | - And I press "Save changes" Then I should see "Group" in the "Activity results" "block" And I should see "Very good" in the "Activity results" "block" And I should see "Good" in the "Activity results" "block" @@ -139,14 +131,11 @@ Feature: The activity results block displays students in groups low scores as sc And I should see "Average" in the "Activity results" "block" Scenario: Try to configure the block on the course page to show multiple high scores using anonymous names - Given I add the "Activity results" block - When I configure the "Activity results" block - And I set the following fields to these values: + Given I add the "Activity results" block to the default region with: | config_showbest | 0 | | config_showworst | 2 | | config_nameformat | Anonymous results | | config_usegroups | Yes | - And I press "Save changes" Then I should see "Group" in the "Activity results" "block" And I should see "Very good" in the "Activity results" "block" And I should see "Good" in the "Activity results" "block" diff --git a/blocks/activity_results/tests/behat/lowscoreswithseperategroups.feature b/blocks/activity_results/tests/behat/lowscoreswithseperategroups.feature index 2214a8704aa..b9f4ef7300d 100644 --- a/blocks/activity_results/tests/behat/lowscoreswithseperategroups.feature +++ b/blocks/activity_results/tests/behat/lowscoreswithseperategroups.feature @@ -57,29 +57,23 @@ Feature: The activity results block displays students in separate groups scores And I am on "Course 1" course homepage Scenario: Configure the block on the course page to show 1 low score - Given I add the "Activity results" block - When I configure the "Activity results" block - And I set the following fields to these values: + Given I add the "Activity results" block to the default region with: | config_showbest | 0 | | config_showworst | 1 | | config_gradeformat | Percentages | | config_nameformat | Display full names | | config_decimalpoints | 0 | | config_usegroups | Yes | - And I press "Save changes" Then I should see "Group 3" in the "Activity results" "block" And I should see "75%" in the "Activity results" "block" Scenario: Try to configure the block on the course page to show 1 low score as a fraction - Given I add the "Activity results" block - When I configure the "Activity results" block - And I set the following fields to these values: + Given I add the "Activity results" block to the default region with: | config_showbest | 0 | | config_showworst | 1 | | config_gradeformat | Fractions | | config_nameformat | Display full names | | config_usegroups | Yes | - And I press "Save changes" Then I should see "Group 3" in the "Activity results" "block" And I should see "75.00/100.00" in the "Activity results" "block" And I log out @@ -89,15 +83,12 @@ Feature: The activity results block displays students in separate groups scores And I should see "70.00/100.00" in the "Activity results" "block" Scenario: Try to configure the block on the course page to show 1 low score as a absolute numbers - Given I add the "Activity results" block - When I configure the "Activity results" block - And I set the following fields to these values: + Given I add the "Activity results" block to the default region with: | config_showbest | 0 | | config_showworst | 1 | | config_gradeformat | Absolute numbers | | config_nameformat | Display full names | | config_usegroups | Yes | - And I press "Save changes" Then I should see "Group 3" in the "Activity results" "block" And I should see "75.00" in the "Activity results" "block" And I log out @@ -107,16 +98,13 @@ Feature: The activity results block displays students in separate groups scores And I should see "70.00" in the "Activity results" "block" Scenario: Try to configure the block on the course page to show multiple low scores as percentages - Given I add the "Activity results" block - When I configure the "Activity results" block - And I set the following fields to these values: + Given I add the "Activity results" block to the default region with: | config_showbest | 0 | | config_showworst | 2 | | config_gradeformat | Percentages | | config_nameformat | Display full names | | config_decimalpoints | 0 | | config_usegroups | Yes | - And I press "Save changes" Then I should see "Group 2" in the "Activity results" "block" And I should see "85%" in the "Activity results" "block" And I should see "Group 3" in the "Activity results" "block" @@ -130,15 +118,12 @@ Feature: The activity results block displays students in separate groups scores And I should see "80%" in the "Activity results" "block" Scenario: Try to configure the block on the course page to show multiple low scores as fractions - Given I add the "Activity results" block - When I configure the "Activity results" block - And I set the following fields to these values: + Given I add the "Activity results" block to the default region with: | config_showbest | 0 | | config_showworst | 2 | | config_gradeformat | Fractions | | config_nameformat | Display full names | | config_usegroups | Yes | - And I press "Save changes" Then I should see "Group 2" in the "Activity results" "block" And I should see "85.00/100.00" in the "Activity results" "block" And I should see "Group 3" in the "Activity results" "block" @@ -152,15 +137,12 @@ Feature: The activity results block displays students in separate groups scores And I should see "80.00/100.00" in the "Activity results" "block" Scenario: Try to configure the block on the course page to show multiple low scores as absolute numbers - Given I add the "Activity results" block - When I configure the "Activity results" block - And I set the following fields to these values: + Given I add the "Activity results" block to the default region with: | config_showbest | 0 | | config_showworst | 2 | | config_gradeformat | Absolute numbers | | config_nameformat | Display full names | | config_usegroups | Yes | - And I press "Save changes" Then I should see "Group 2" in the "Activity results" "block" And I should see "85.00" in the "Activity results" "block" And I should see "Group 3" in the "Activity results" "block" @@ -176,15 +158,12 @@ Feature: The activity results block displays students in separate groups scores Scenario: Try to configure the block on the course page to show multiple low scores using ID numbers Given the following config values are set as admin: | showuseridentity | idnumber,email | - And I add the "Activity results" block - When I configure the "Activity results" block - And I set the following fields to these values: + And I add the "Activity results" block to the default region with: | config_showbest | 0 | | config_showworst | 2 | | config_gradeformat | Percentages | | config_nameformat | Display only ID numbers | | config_usegroups | Yes | - And I press "Save changes" Then I should see "Group" in the "Activity results" "block" And I should see "85.00%" in the "Activity results" "block" And I should see "75.00%" in the "Activity results" "block" @@ -199,15 +178,12 @@ Feature: The activity results block displays students in separate groups scores And I should see "90.00%" in the "Activity results" "block" Scenario: Try to configure the block on the course page to show multiple low scores using anonymous names - Given I add the "Activity results" block - When I configure the "Activity results" block - And I set the following fields to these values: + Given I add the "Activity results" block to the default region with: | config_showbest | 0 | | config_showworst | 2 | | config_gradeformat | Percentages | | config_nameformat | Anonymous results | | config_usegroups | Yes | - And I press "Save changes" Then I should see "Group" in the "Activity results" "block" And I should see "85.00%" in the "Activity results" "block" And I should see "75.00%" in the "Activity results" "block" diff --git a/blocks/activity_results/tests/behat/lowscoreswithvisiblegroups.feature b/blocks/activity_results/tests/behat/lowscoreswithvisiblegroups.feature index 253f1c5b3d9..cb9a3a52772 100644 --- a/blocks/activity_results/tests/behat/lowscoreswithvisiblegroups.feature +++ b/blocks/activity_results/tests/behat/lowscoreswithvisiblegroups.feature @@ -63,29 +63,23 @@ Feature: The activity results block displays student in visible groups low score And I am on "Course 1" course homepage Scenario: Configure the block on the course page to show 1 low score - Given I add the "Activity results" block - When I configure the "Activity results" block - And I set the following fields to these values: + Given I add the "Activity results" block to the default region with: | config_showbest | 0 | | config_showworst | 1 | | config_gradeformat | Percentages | | config_nameformat | Display full names | | config_decimalpoints | 0 | | config_usegroups | Yes | - And I press "Save changes" Then I should see "Group 3" in the "Activity results" "block" And I should see "75%" in the "Activity results" "block" Scenario: Try to configure the block on the course page to show 1 low score as a fraction - Given I add the "Activity results" block - When I configure the "Activity results" block - And I set the following fields to these values: + Given I add the "Activity results" block to the default region with: | config_showbest | 0 | | config_showworst | 1 | | config_gradeformat | Fractions | | config_nameformat | Display full names | | config_usegroups | Yes | - And I press "Save changes" And I log out Then I log in as "student1" And I am on "Course 1" course homepage @@ -93,15 +87,12 @@ Feature: The activity results block displays student in visible groups low score And I should see "75.00/100.00" in the "Activity results" "block" Scenario: Try to configure the block on the course page to show 1 low score as a absolute numbers - Given I add the "Activity results" block - When I configure the "Activity results" block - And I set the following fields to these values: + Given I add the "Activity results" block to the default region with: | config_showbest | 0 | | config_showworst | 1 | | config_gradeformat | Absolute numbers | | config_nameformat | Display full names | | config_usegroups | Yes | - And I press "Save changes" And I log out Then I log in as "student1" And I am on "Course 1" course homepage @@ -109,16 +100,13 @@ Feature: The activity results block displays student in visible groups low score And I should see "75.00" in the "Activity results" "block" Scenario: Try to configure the block on the course page to show multiple low scores as percentages - Given I add the "Activity results" block - When I configure the "Activity results" block - And I set the following fields to these values: + Given I add the "Activity results" block to the default region with: | config_showbest | 0 | | config_showworst | 2 | | config_gradeformat | Percentages | | config_nameformat | Display full names | | config_decimalpoints | 0 | | config_usegroups | Yes | - And I press "Save changes" Then I should see "Group 2" in the "Activity results" "block" And I should see "85%" in the "Activity results" "block" And I should see "Group 3" in the "Activity results" "block" @@ -132,15 +120,12 @@ Feature: The activity results block displays student in visible groups low score And I should see "75%" in the "Activity results" "block" Scenario: Try to configure the block on the course page to show multiple low scores as fractions - Given I add the "Activity results" block - When I configure the "Activity results" block - And I set the following fields to these values: + Given I add the "Activity results" block to the default region with: | config_showbest | 0 | | config_showworst | 2 | | config_gradeformat | Fractions | | config_nameformat | Display full names | | config_usegroups | Yes | - And I press "Save changes" And I log out Then I log in as "student1" And I am on "Course 1" course homepage @@ -150,15 +135,12 @@ Feature: The activity results block displays student in visible groups low score And I should see "75.00/100.00" in the "Activity results" "block" Scenario: Try to configure the block on the course page to show multiple low scores as absolute numbers - Given I add the "Activity results" block - When I configure the "Activity results" block - And I set the following fields to these values: + Given I add the "Activity results" block to the default region with: | config_showbest | 0 | | config_showworst | 2 | | config_gradeformat | Absolute numbers | | config_nameformat | Display full names | | config_usegroups | Yes | - And I press "Save changes" And I log out Then I log in as "student1" And I am on "Course 1" course homepage @@ -170,15 +152,12 @@ Feature: The activity results block displays student in visible groups low score Scenario: Try to configure the block on the course page to show multiple low scores using ID numbers Given the following config values are set as admin: | showuseridentity | idnumber,email | - And I add the "Activity results" block - When I configure the "Activity results" block - And I set the following fields to these values: + And I add the "Activity results" block to the default region with: | config_showbest | 0 | | config_showworst | 2 | | config_gradeformat | Percentages | | config_nameformat | Display only ID numbers | | config_usegroups | Yes | - And I press "Save changes" And I log out Then I log in as "student1" And I am on "Course 1" course homepage @@ -187,15 +166,12 @@ Feature: The activity results block displays student in visible groups low score And I should see "75.00%" in the "Activity results" "block" Scenario: Try to configure the block on the course page to show multiple low scores using anonymous names - Given I add the "Activity results" block - When I configure the "Activity results" block - And I set the following fields to these values: + Given I add the "Activity results" block to the default region with: | config_showbest | 0 | | config_showworst | 2 | | config_gradeformat | Percentages | | config_nameformat | Anonymous results | | config_usegroups | Yes | - And I press "Save changes" And I log out Then I log in as "student1" And I am on "Course 1" course homepage