1 @block @block_activity_results @javascript
2 Feature: The activity results block displays student in visible groups low scores
3 In order to be display student scores
5 I need to see the activity results block
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 |
20 And the following "groups" exist:
21 | name | course | idnumber |
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:
44 And the following "activity" exists:
48 | name | Test assignment |
49 | assignsubmission_file_enabled | 0 |
51 And the following "grade grades" exist:
52 | gradeitem | user | grade |
53 | Test assignment | student1 | 100.00 |
54 | Test assignment | student2 | 90.00 |
55 | Test assignment | student3 | 90.00 |
56 | Test assignment | student4 | 80.00 |
57 | Test assignment | student5 | 80.00 |
58 | Test assignment | student6 | 70.00 |
59 And I log in as "teacher1"
60 And I am on "Course 1" course homepage with editing mode on
62 Scenario: Configure the block on the course page to show 1 low score
63 Given I add the "Activity results" block to the default region with:
64 | config_showbest | 0 |
65 | config_showworst | 1 |
66 | config_gradeformat | Percentages |
67 | config_nameformat | Display full names |
68 | config_decimalpoints | 0 |
69 | config_usegroups | Yes |
70 Then I should see "Group 3" in the "Activity results" "block"
71 And I should see "75%" in the "Activity results" "block"
73 Scenario: Try to configure the block on the course page to show 1 low score as a fraction
74 Given I add the "Activity results" block to the default region with:
75 | config_showbest | 0 |
76 | config_showworst | 1 |
77 | config_gradeformat | Fractions |
78 | config_nameformat | Display full names |
79 | config_usegroups | Yes |
80 Then I am on the "Course 1" course page logged in as student1
81 And I should see "Group 3" in the "Activity results" "block"
82 And I should see "75.00/100.00" in the "Activity results" "block"
84 Scenario: Try to configure the block on the course page to show 1 low score as a absolute numbers
85 Given I add the "Activity results" block to the default region with:
86 | config_showbest | 0 |
87 | config_showworst | 1 |
88 | config_gradeformat | Absolute numbers |
89 | config_nameformat | Display full names |
90 | config_usegroups | Yes |
91 When I am on the "Course 1" course page logged in as student1
92 Then I should see "Group 3" in the "Activity results" "block"
93 And I should see "75.00" in the "Activity results" "block"
95 Scenario: Try to configure the block on the course page to show multiple low scores as percentages
96 Given I add the "Activity results" block to the default region with:
97 | config_showbest | 0 |
98 | config_showworst | 2 |
99 | config_gradeformat | Percentages |
100 | config_nameformat | Display full names |
101 | config_decimalpoints | 0 |
102 | config_usegroups | Yes |
103 Then I should see "Group 2" in the "Activity results" "block"
104 And I should see "85%" in the "Activity results" "block"
105 And I should see "Group 3" in the "Activity results" "block"
106 And I should see "75%" in the "Activity results" "block"
107 And I am on the "Course 1" course page logged in as student5
108 Then I should see "Group 2" in the "Activity results" "block"
109 And I should see "85%" in the "Activity results" "block"
110 And I should see "Group 3" in the "Activity results" "block"
111 And I should see "75%" in the "Activity results" "block"
113 Scenario: Try to configure the block on the course page to show multiple low scores as fractions
114 Given I add the "Activity results" block to the default region with:
115 | config_showbest | 0 |
116 | config_showworst | 2 |
117 | config_gradeformat | Fractions |
118 | config_nameformat | Display full names |
119 | config_usegroups | Yes |
120 Then I am on the "Course 1" course page logged in as student1
121 And I should see "Group 2" in the "Activity results" "block"
122 And I should see "85.00/100.00" in the "Activity results" "block"
123 And I should see "Group 3" in the "Activity results" "block"
124 And I should see "75.00/100.00" in the "Activity results" "block"
126 Scenario: Try to configure the block on the course page to show multiple low scores as absolute numbers
127 Given I add the "Activity results" block to the default region with:
128 | config_showbest | 0 |
129 | config_showworst | 2 |
130 | config_gradeformat | Absolute numbers |
131 | config_nameformat | Display full names |
132 | config_usegroups | Yes |
133 Then I am on the "Course 1" course page logged in as student1
134 And I should see "Group 2" in the "Activity results" "block"
135 And I should see "85.00" in the "Activity results" "block"
136 And I should see "Group 3" in the "Activity results" "block"
137 And I should see "75.00" in the "Activity results" "block"
139 Scenario: Try to configure the block on the course page to show multiple low scores using ID numbers
140 Given the following config values are set as admin:
141 | showuseridentity | idnumber,email |
142 And I add the "Activity results" block to the default region with:
143 | config_showbest | 0 |
144 | config_showworst | 2 |
145 | config_gradeformat | Percentages |
146 | config_nameformat | Display only ID numbers |
147 | config_usegroups | Yes |
148 Then I am on the "Course 1" course page logged in as student1
149 And I should see "Group" in the "Activity results" "block"
150 And I should see "85.00%" in the "Activity results" "block"
151 And I should see "75.00%" in the "Activity results" "block"
153 Scenario: Try to configure the block on the course page to show multiple low scores using anonymous names
154 Given I add the "Activity results" block to the default region with:
155 | config_showbest | 0 |
156 | config_showworst | 2 |
157 | config_gradeformat | Percentages |
158 | config_nameformat | Anonymous results |
159 | config_usegroups | Yes |
160 Then I am on the "Course 1" course page logged in as student1
161 And I should see "Group" in the "Activity results" "block"
162 And I should see "85.00%" in the "Activity results" "block"
163 And I should see "75.00%" in the "Activity results" "block"