Proyectos de Subversion Moodle

Rev

| Ultima modificación | Ver Log |

Rev Autor Línea Nro. Línea
1 efrain 1
@block @block_activity_results @javascript
2
Feature: The activity results block displays student in group high 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 the following "activities" exist:
45
      | activity   | name               | intro          | course | section | idnumber |
46
      | assign     | Test assignment    | Offline text   | C1     | 1       | assign1  |
47
    And the following "scales" exist:
48
      | name     | scale                                                                |
49
      | My Scale | Disappointing, Not good enough, Average, Good, Very good, Excellent! |
50
    And I change window size to "large"
51
    And I am on the "Test assignment" "assign activity editing" page logged in as teacher1
52
    And I set the following fields to these values:
53
      | assignsubmission_file_enabled | 0 |
54
      | id_grade_modgrade_type | Scale |
55
      | id_grade_modgrade_scale | My Scale |
56
      | Group mode | Separate groups |
57
    And I press "Save and return to course"
58
    And I turn editing mode on
59
    And I am on the "Course 1" "grades > Grader report > View" page
60
    And I give the grade "Excellent!" to the user "Student 1" for the grade item "Test assignment"
61
    And I give the grade "Very good" to the user "Student 2" for the grade item "Test assignment"
62
    And I give the grade "Very good" to the user "Student 3" for the grade item "Test assignment"
63
    And I give the grade "Good" to the user "Student 4" for the grade item "Test assignment"
64
    And I give the grade "Good" to the user "Student 5" for the grade item "Test assignment"
65
    And I give the grade "Average" to the user "Student 6" for the grade item "Test assignment"
66
    And I press "Save changes"
67
    And I am on "Course 1" course homepage
68
 
69
  Scenario: Try to configure the block on the course page to show 1 high score
70
    Given I add the "Activity results" block to the default region with:
71
      | config_showbest | 1 |
72
      | config_showworst | 0 |
73
      | config_nameformat | Display full names |
74
      | config_usegroups | Yes |
75
    Then I should see "Group 1" in the "Activity results" "block"
76
    And I should see "Excellent!" in the "Activity results" "block"
77
    And I am on the "Course 1" course page logged in as student1
78
    And I should see "Student 1" in the "Activity results" "block"
79
    And I should see "Excellent!" in the "Activity results" "block"
80
 
81
  Scenario: Try to configure the block on the course page to show multiple high scores using full names
82
    Given I add the "Activity results" block to the default region with:
83
      | config_showbest | 3 |
84
      | config_showworst | 0 |
85
      | config_nameformat | Display full names |
86
      | config_usegroups | Yes |
87
    Then I should see "Group 1" in the "Activity results" "block"
88
    And I should see "Excellent!" in the "Activity results" "block"
89
    And I should see "Group 2" in the "Activity results" "block"
90
    And I should see "Very good" in the "Activity results" "block"
91
    And I should see "Group 3" in the "Activity results" "block"
92
    And I should see "Good" in the "Activity results" "block"
93
    And I am on the "Course 1" course page logged in as student3
94
    And I should see "Student 3" in the "Activity results" "block"
95
    And I should see "Very good" in the "Activity results" "block"
96
    And I should see "Student 4" in the "Activity results" "block"
97
    And I should see "Good" in the "Activity results" "block"
98
 
99
  Scenario: Try to configure the block on the course page to show multiple high scores using ID numbers
100
    Given the following config values are set as admin:
101
      | showuseridentity | idnumber,email |
102
    And I add the "Activity results" block to the default region with:
103
      | config_showbest | 3 |
104
      | config_showworst | 0 |
105
      | config_nameformat | Display only ID numbers |
106
      | config_usegroups | Yes |
107
    Then I should see "Group" in the "Activity results" "block"
108
    And I should see "Excellent!" in the "Activity results" "block"
109
    And I should see "Very good" in the "Activity results" "block"
110
    And I should see "Good" in the "Activity results" "block"
111
    # Students cannot see user identity fields.
112
    And I am on the "Course 1" course page logged in as student1
113
    And I should see "User" in the "Activity results" "block"
114
    And I should not see "User S1" in the "Activity results" "block"
115
    And I should see "Excellent!" in the "Activity results" "block"
116
    And I should not see "User S2" in the "Activity results" "block"
117
    And I should see "Very good" in the "Activity results" "block"
118
 
119
  Scenario: Try to configure the block on the course page to show multiple high scores using anonymous names
120
    Given I add the "Activity results" block to the default region with:
121
      | config_showbest | 3 |
122
      | config_showworst | 0 |
123
      | config_nameformat | Anonymous results |
124
      | config_usegroups | Yes |
125
    Then I should see "Group" in the "Activity results" "block"
126
    And I should see "Excellent!" in the "Activity results" "block"
127
    And I should see "Very good" in the "Activity results" "block"
128
    And I should see "Good" in the "Activity results" "block"
129
    And I am on the "Course 1" course page logged in as student1
130
    And I should see "User" in the "Activity results" "block"
131
    And I should see "Excellent!" in the "Activity results" "block"
132
    And I should see "Very good" in the "Activity results" "block"