source: moodle/trunk/fuentes/blocks/activity_results/tests/behat/lowscoreswithscalesandgroups.feature @ 1331

Last change on this file since 1331 was 1331, checked in by jrpelegrina, 3 years ago

Updated to moodle 3.0.3

File size: 6.7 KB
RevLine 
[1331]1@block @block_activity_results
2Feature: The activity results block displays student scores as scales
3  In order to be display student scores as scales
4  As a user
5  I need to see the activity results block
6
7  Background:
8    Given the following "users" exist:
9      | username | firstname | lastname | email | idnumber |
10      | teacher1 | Teacher | 1 | teacher1@example.com | T1 |
11      | student1 | Student | 1 | student1@example.com | S1 |
12      | student2 | Student | 2 | student2@example.com | S2 |
13      | student3 | Student | 3 | student3@example.com | S3 |
14      | student4 | Student | 4 | student4@example.com | S4 |
15      | student5 | Student | 5 | student5@example.com | S5 |
16      | student6 | Student | 6 | student6@example.com | S6 |
17    And the following "courses" exist:
18      | fullname | shortname | category |
19      | Course 1 | C1 | 0 |
20    And the following "groups" exist:
21      | name | course | idnumber |
22      | Group 1 | C1 | G1 |
23      | Group 2 | C1 | G2 |
24      | Group 3 | C1 | G3 |
25      | Group 4 | C1 | G4 |
26      | Group 5 | C1 | G5 |
27    And the following "course enrolments" exist:
28      | user | course | role |
29      | teacher1 | C1 | editingteacher |
30      | student1 | C1 | student |
31      | student2 | C1 | student |
32      | student3 | C1 | student |
33      | student4 | C1 | student |
34      | student5 | C1 | student |
35      | student6 | C1 | student |
36    And the following "group members" exist:
37      | user     | group   |
38      | student1 | G1 |
39      | student2 | G1 |
40      | student3 | G2 |
41      | student4 | G2 |
42      | student5 | G3 |
43      | student6 | G3 |
44    And I log in as "teacher1"
45    And I follow "Course 1"
46    And I navigate to "Grades" node in "Course administration"
47    And I navigate to "Scales" node in "Grade administration"
48    And I press "Add a new scale"
49    And I set the following fields to these values:
50      | Name | My Scale |
51      | Scale | Disappointing, Not good enough, Average, Good, Very good, Excellent! |
52    And I press "Save changes"
53    And I follow "Course 1"
54    And I turn editing mode on
55    And I add a "Assignment" to section "1" and I fill the form with:
56      | Assignment name | Test assignment |
57      | Description | Offline text |
58      | assignsubmission_file_enabled | 0 |
59      | id_grade_modgrade_type | Scale |
60      | id_grade_modgrade_scale | My Scale |
61      | Group mode | Separate groups |
62    And I follow "Course 1"
63    And I navigate to "Grades" node in "Course administration"
64    And I turn editing mode on
65    And I give the grade "Excellent!" to the user "Student 1" for the grade item "Test assignment"
66    And I give the grade "Very good" to the user "Student 2" for the grade item "Test assignment"
67    And I give the grade "Very good" to the user "Student 3" for the grade item "Test assignment"
68    And I give the grade "Good" to the user "Student 4" for the grade item "Test assignment"
69    And I give the grade "Good" to the user "Student 5" for the grade item "Test assignment"
70    And I give the grade "Average" to the user "Student 6" for the grade item "Test assignment"
71    And I press "Save changes"
72    And I follow "Course 1"
73
74  Scenario: Try to configure the block on the course page to show 1 low score
75    Given I add the "Activity results" block
76    When I configure the "Activity results" block
77    And I set the following fields to these values:
78      | id_config_showbest | 0 |
79      | id_config_showworst | 1 |
80      | id_config_nameformat | Display full names |
81      | id_config_usegroups | Yes |
82    And I press "Save changes"
83    Then I should see "Group 3" in the "Activity results" "block"
84    And I should see "Good" in the "Activity results" "block"
85    And I log out
86    And I log in as "student5"
87    And I follow "Course 1"
88    And I should see "Student 6" in the "Activity results" "block"
89    And I should see "Average" in the "Activity results" "block"
90
91  Scenario: Try to configure the block on the course page to show multiple high scores using full names
92    Given I add the "Activity results" block
93    When I configure the "Activity results" block
94    And I set the following fields to these values:
95      | id_config_showbest | 0 |
96      | id_config_showworst | 2 |
97      | id_config_nameformat | Display full names |
98      | id_config_usegroups | Yes |
99    And I press "Save changes"
100    Then I should see "Group 2" in the "Activity results" "block"
101    And I should see "Very good" in the "Activity results" "block"
102    And I should see "Group 3" in the "Activity results" "block"
103    And I should see "Good" in the "Activity results" "block"
104    And I log out
105    And I log in as "student3"
106    And I follow "Course 1"
107    And I should see "Student 3" in the "Activity results" "block"
108    And I should see "Very good" in the "Activity results" "block"
109    And I should see "Student 4" in the "Activity results" "block"
110    And I should see "Good" in the "Activity results" "block"
111
112  Scenario: Try to configure the block on the course page to show multiple high scores using ID numbers
113    Given I add the "Activity results" block
114    When I configure the "Activity results" block
115    And I set the following fields to these values:
116      | id_config_showbest | 0 |
117      | id_config_showworst | 2 |
118      | id_config_nameformat | Display only ID numbers |
119      | id_config_usegroups | Yes |
120    And I press "Save changes"
121    Then I should see "Group" in the "Activity results" "block"
122    And I should see "Very good" in the "Activity results" "block"
123    And I should see "Good" in the "Activity results" "block"
124    And I log out
125    And I log in as "student5"
126    And I follow "Course 1"
127    And I should see "User S5" in the "Activity results" "block"
128    And I should see "Good" in the "Activity results" "block"
129    And I should see "User S6" in the "Activity results" "block"
130    And I should see "Average" in the "Activity results" "block"
131
132  Scenario: Try to configure the block on the course page to show multiple high scores using anonymous names
133    Given I add the "Activity results" block
134    When I configure the "Activity results" block
135    And I set the following fields to these values:
136      | id_config_showbest | 0 |
137      | id_config_showworst | 2 |
138      | id_config_nameformat | Anonymous results |
139      | id_config_usegroups | Yes |
140    And I press "Save changes"
141    Then I should see "Group" in the "Activity results" "block"
142    And I should see "Very good" in the "Activity results" "block"
143    And I should see "Good" in the "Activity results" "block"
144    And I log out
145    And I log in as "student5"
146    And I follow "Course 1"
147    And I should see "User" in the "Activity results" "block"
148    And I should see "Good" in the "Activity results" "block"
149    And I should see "Average" in the "Activity results" "block"
150
Note: See TracBrowser for help on using the repository browser.