MDL-52873 forms: Generate unique id attributes for modgrade elements
[moodle.git] / blocks / activity_results / tests / behat / lowscoreswithscales.feature
CommitLineData
fd027cd1
SB
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 And the following "courses" exist:
17 | fullname | shortname | category |
18 | Course 1 | C1 | 0 |
19 And the following "course enrolments" exist:
20 | user | course | role |
21 | teacher1 | C1 | editingteacher |
22 | student1 | C1 | student |
23 | student2 | C1 | student |
24 | student3 | C1 | student |
25 | student4 | C1 | student |
26 | student5 | C1 | student |
27 And I log in as "teacher1"
28 And I follow "Course 1"
29 And I navigate to "Grades" node in "Course administration"
30 And I navigate to "Scales" node in "Grade administration"
31 And I press "Add a new scale"
32 And I set the following fields to these values:
33 | Name | My Scale |
34 | Scale | Disappointing, Not good enough, Average, Good, Very good, Excellent! |
35 And I press "Save changes"
36 And I follow "Course 1"
37 And I turn editing mode on
38 And I add a "Assignment" to section "1" and I fill the form with:
39 | Assignment name | Test assignment |
40 | Description | Offline text |
41 | assignsubmission_file_enabled | 0 |
d84c64b7
DM
42 | id_grade_modgrade_type | Scale |
43 | id_grade_modgrade_scale | My Scale |
fd027cd1
SB
44 And I follow "Course 1"
45 And I navigate to "Grades" node in "Course administration"
46 And I turn editing mode on
47 And I give the grade "Excellent!" to the user "Student 1" for the grade item "Test assignment"
48 And I give the grade "Very good" to the user "Student 2" for the grade item "Test assignment"
49 And I give the grade "Good" to the user "Student 3" for the grade item "Test assignment"
50 And I give the grade "Average" to the user "Student 4" for the grade item "Test assignment"
51 And I give the grade "Not good enough" to the user "Student 5" for the grade item "Test assignment"
52 And I press "Save changes"
53 And I follow "Course 1"
54
55 Scenario: Configure the block on the course page to show 1 low score
56 Given I add the "Activity results" block
57 When I configure the "Activity results" block
58 And I set the following fields to these values:
59 | id_config_showbest | 0 |
60 | id_config_showworst | 1 |
61 | id_config_gradeformat | Percentages |
62 | id_config_nameformat | Display full names |
63 | id_config_decimalpoints | 0 |
64 And I press "Save changes"
65 Then I should see "Student 5" in the "Activity results" "block"
66 And I should see "Not good enough" in the "Activity results" "block"
67
68 Scenario: Try to configure the block on the course page to show multiple low scores using full names
69 Given I add the "Activity results" block
70 When I configure the "Activity results" block
71 And I set the following fields to these values:
72 | id_config_showbest | 0 |
73 | id_config_showworst | 3 |
74 | id_config_nameformat | Display full names |
75 And I press "Save changes"
76 Then I should see "Student 5" in the "Activity results" "block"
77 And I should see "Not good enough" in the "Activity results" "block"
78 And I should see "Student 4" in the "Activity results" "block"
79 And I should see "Average" in the "Activity results" "block"
80 And I should see "Student 3" in the "Activity results" "block"
81 And I should see "Good" in the "Activity results" "block"
82
83 Scenario: Try to configure the block on the course page to show multiple low scores using ID numbers
84 Given I add the "Activity results" block
85 When I configure the "Activity results" block
86 And I set the following fields to these values:
87 | id_config_showbest | 0 |
88 | id_config_showworst | 3 |
89 | id_config_nameformat | Display only ID numbers |
90 And I press "Save changes"
91 Then I should see "User S5" in the "Activity results" "block"
92 And I should see "Not good enough" in the "Activity results" "block"
93 And I should see "User S4" in the "Activity results" "block"
94 And I should see "Average" in the "Activity results" "block"
95 And I should see "User S3" in the "Activity results" "block"
96 And I should see "Good" in the "Activity results" "block"
97
98 Scenario: Try to configure the block on the course page to show multiple low scores using anonymous names
99 Given I add the "Activity results" block
100 When I configure the "Activity results" block
101 And I set the following fields to these values:
102 | id_config_showbest | 0 |
103 | id_config_showworst | 3 |
104 | id_config_nameformat | Anonymous results |
105 And I press "Save changes"
106 Then I should see "User" in the "Activity results" "block"
107 And I should not see "Student 5" in the "Activity results" "block"
108 And I should see "Not good enough" in the "Activity results" "block"
109 And I should not see "Student 4" in the "Activity results" "block"
110 And I should see "Average" in the "Activity results" "block"
111 And I should not see "Student 3" in the "Activity results" "block"
112 And I should see "Good" in the "Activity results" "block"