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 high scores
3
  In order to be display student scores
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 the following "activities" exist:
28
      | activity   | name            | intro          | course | section | idnumber | assignsubmission_file_enabled |
29
      | assign     | Test assignment | Offline text   | C1     | 1       | assign1  | 0                             |
30
    And the following "grade grades" exist:
31
      | gradeitem       | user     | grade |
32
      | Test assignment | student1 | 90.00 |
33
      | Test assignment | student2 | 80.00 |
34
      | Test assignment | student3 | 70.00 |
35
      | Test assignment | student4 | 60.00 |
36
      | Test assignment | student5 | 50.00 |
37
    And I log in as "teacher1"
38
    And I am on "Course 1" course homepage with editing mode on
39
 
40
  Scenario: Configure the block on the course page to show 0 high scores
41
    Given I add the "Activity results" block to the default region with:
42
      | config_showbest | 0 |
43
      | config_showworst | 0 |
44
      | config_gradeformat | Percentages |
45
      | config_nameformat | Display full names |
46
    Then I should see "This block's configuration currently does not allow it to show any results." in the "Activity results" "block"
47
 
48
  Scenario: Configure the block on the course page to show 1 high score
49
    Given I add the "Activity results" block to the default region with:
50
      | config_showbest | 1 |
51
      | config_showworst | 0 |
52
      | config_gradeformat | Percentages |
53
      | config_nameformat | Display full names |
54
      | config_decimalpoints | 0 |
55
    Then I should see "Student 1" in the "Activity results" "block"
56
    And I should see "90%" in the "Activity results" "block"
57
 
58
  Scenario: Try to configure the block on the course page to show 1 high score as a fraction
59
    Given I add the "Activity results" block to the default region with:
60
      | config_showbest | 1 |
61
      | config_showworst | 0 |
62
      | config_gradeformat | Fractions |
63
      | config_nameformat | Display full names |
64
    Then I should see "Student 1" in the "Activity results" "block"
65
    And I should see "90.00/100.00" in the "Activity results" "block"
66
 
67
  Scenario: Try to configure the block on the course page to show 1 high score as a absolute numbers
68
    Given I add the "Activity results" block to the default region with:
69
      | config_showbest | 1 |
70
      | config_showworst | 0 |
71
      | config_gradeformat | Absolute numbers |
72
      | config_nameformat | Display full names |
73
    Then I should see "Student 1" in the "Activity results" "block"
74
    And I should see "90.00" in the "Activity results" "block"
75
 
76
  Scenario: Try to configure the block on the course page to show multiple high scores as percentages
77
    Given I add the "Activity results" block to the default region with:
78
      | config_showbest | 3 |
79
      | config_showworst | 0 |
80
      | config_gradeformat | Percentages |
81
      | config_nameformat | Display full names |
82
      | config_decimalpoints | 0 |
83
    Then I should see "Student 1" in the "Activity results" "block"
84
    And I should see "90%" in the "Activity results" "block"
85
    And I should see "Student 2" in the "Activity results" "block"
86
    And I should see "80%" in the "Activity results" "block"
87
    And I should see "Student 3" in the "Activity results" "block"
88
    And I should see "70%" in the "Activity results" "block"
89
 
90
  Scenario: Try to configure the block on the course page to show multiple high scores as fractions
91
    Given I add the "Activity results" block to the default region with:
92
      | config_showbest | 3 |
93
      | config_showworst | 0 |
94
      | config_gradeformat | Fractions |
95
      | config_nameformat | Display full names |
96
    Then I should see "Student 1" in the "Activity results" "block"
97
    And I should see "90.00/100.00" in the "Activity results" "block"
98
    And I should see "Student 2" in the "Activity results" "block"
99
    And I should see "80.00/100.00" in the "Activity results" "block"
100
    And I should see "Student 3" in the "Activity results" "block"
101
    And I should see "70.00/100.00" in the "Activity results" "block"
102
 
103
  Scenario: Try to configure the block on the course page to show multiple high scores as absolute numbers
104
    Given I add the "Activity results" block to the default region with:
105
      | config_showbest | 3 |
106
      | config_showworst | 0 |
107
      | config_gradeformat | Absolute numbers |
108
      | config_nameformat | Display full names |
109
    Then I should see "Student 1" in the "Activity results" "block"
110
    And I should see "90.00" in the "Activity results" "block"
111
    And I should see "Student 2" in the "Activity results" "block"
112
    And I should see "80.00" in the "Activity results" "block"
113
    And I should see "Student 3" in the "Activity results" "block"
114
    And I should see "70.00" in the "Activity results" "block"
115
 
116
  Scenario: Try to configure the block on the course page to show multiple high scores using ID numbers
117
    Given the following config values are set as admin:
118
      | showuseridentity | idnumber,email |
119
    And I add the "Activity results" block to the default region with:
120
      | config_showbest | 3 |
121
      | config_showworst | 0 |
122
      | config_gradeformat | Percentages |
123
      | config_nameformat | Display only ID numbers |
124
    Then I should see "User S1" in the "Activity results" "block"
125
    And I should see "90.00%" in the "Activity results" "block"
126
    And I should see "User S2" in the "Activity results" "block"
127
    And I should see "80.00%" in the "Activity results" "block"
128
    And I should see "User S3" in the "Activity results" "block"
129
    And I should see "70.00%" in the "Activity results" "block"
130
 
131
  Scenario: Try to configure the block on the course page to show multiple high scores using anonymous names
132
    Given I add the "Activity results" block to the default region with:
133
      | config_showbest | 3 |
134
      | config_showworst | 0 |
135
      | config_gradeformat | Percentages |
136
      | config_nameformat | Anonymous results |
137
    Then I should see "User" in the "Activity results" "block"
138
    And I should see "90.00%" in the "Activity results" "block"
139
    And I should see "80.00%" in the "Activity results" "block"
140
    And I should see "70.00%" in the "Activity results" "block"