Proyectos de Subversion Moodle

Rev

Rev 1 | | Comparar con el anterior | Ultima modificación | Ver Log |

Rev Autor Línea Nro. Línea
1 efrain 1
@core_form
2
Feature: Using the activity grade form element
3
  In order to ensure validation is provided to the teacher
4
  As a teacher
5
  I need to know why I can not add/edit values in the form element
6
 
7
  Background:
8
    Given the following "users" exist:
9
      | username | firstname | lastname | email                |
10
      | student1 | Student   | 1        | student1@example.com |
11
      | teacher1 | Teacher   | 1        | teacher1@example.com |
12
    And the following "courses" exist:
13
      | fullname | shortname | category | groupmode |
14
      | Course 1 | C1        | 0        | 1         |
15
    And the following "course enrolments" exist:
16
      | user     | course | role           |
17
      | teacher1 | C1     | editingteacher |
18
      | student1 | C1     | student        |
19
    And the following "scales" exist:
20
      | name         | scale                                     |
21
      | ABCDEF       | F,E,D,C,B,A                               |
22
      | Letter scale | Disappointing, Good, Very good, Excellent |
23
    And the following "activities" exist:
24
      | activity | course | section | name                 | intro                       | idnumber | type    | groupmode |
25
      | assign   | C1     | 1       | Test assignment name | Test assignment description |          |         |           |
26
      | forum    | C1     | 1       | Test forum name      |                             | forum1   | general | 0         |
27
    And the following "mod_forum > discussions" exist:
28
      | user     | forum  | name               | message            |
29
      | student1 | forum1 | Discussion subject | Discussion message |
30
 
31
  @javascript
32
  Scenario: Being able to change the grade type, scale and maximum grade when there are no grades
33
    Given I am on the "Test forum name" "forum activity editing" page logged in as teacher1
34
    And I set the following fields to these values:
35
      | Ratings > Aggregate type        | Average of ratings |
36
      | id_scale_modgrade_type          | Point              |
37
      | Ratings > scale[modgrade_point] | 60                 |
38
    And I press "Save and return to course"
39
    And I am on the "Test forum name" "forum activity editing" page
40
    When I expand all fieldsets
41
    Then I should not see "Some grades have already been awarded, so the grade type"
42
    And I set the field "id_scale_modgrade_type" to "Scale"
43
    And I set the field "Ratings > scale[modgrade_scale]" to "ABCDEF"
44
    And I press "Save and display"
45
    And I should not see "You cannot change the type, as grades already exist for this item"
46
    And I navigate to "Settings" in current page administration
47
    And I expand all fieldsets
48
    And I should not see "Some grades have already been awarded, so the grade type"
49
    And I set the field "Ratings > scale[modgrade_scale]" to "Letter scale"
50
    And I press "Save and display"
51
    And I should not see "You cannot change the scale, as grades already exist for this item"
52
    And I navigate to "Settings" in current page administration
53
    And I expand all fieldsets
54
    And I should not see "Some grades have already been awarded, so the grade type"
55
    And I set the field "id_scale_modgrade_type" to "Point"
56
    And I set the field "Ratings > Maximum grade" to "50"
57
    And I press "Save and display"
58
    And I should not see "You must choose whether to rescale existing grades or not"
59
 
60
  @javascript
61
  Scenario: Attempting to change the scale when grades already exist in rating activity
62
    Given I am on the "Test forum name" "forum activity editing" page logged in as teacher1
63
    And I set the following fields to these values:
64
      | Ratings > Aggregate type        | Average of ratings |
65
      | id_scale_modgrade_type          | Scale              |
66
      | Ratings > scale[modgrade_scale] | ABCDEF             |
67
    And I press "Save and display"
68
    And I follow "Discussion subject"
69
    And I set the field "rating" to "D"
70
    And I am on the "Test forum name" "forum activity editing" page
71
    When I expand all fieldsets
72
    Then I should see "Some grades have already been awarded, so the grade type and scale cannot be changed"
73
    # Try saving the form and visiting it back to verify that everything is working ok.
74
    And I press "Save and display"
75
    And I should not see "When selecting a ratings aggregate type you must also select"
76
    And I navigate to "Settings" in current page administration
77
    And I expand all fieldsets
78
    And the field "Ratings > Aggregate type" matches value "Average of ratings"
79
    And the field "id_scale_modgrade_type" matches value "Scale"
80
    And the field "Ratings > scale[modgrade_scale]" matches value "ABCDEF"
81
 
82
  @javascript
83
  Scenario: Attempting to change the scale when grades already exist in non-rating activity
84
    Given I am on the "Test assignment name" "assign activity" page logged in as "teacher1"
85
    And I navigate to "Settings" in current page administration
86
    And I set the following fields to these values:
87
      | grade[modgrade_type] | Scale |
88
      | grade[modgrade_scale] | ABCDEF |
89
    And I press "Save and display"
90
    And I am on the "Test assignment name" "assign activity" page
1441 ariadna 91
    And I go to "Student 1" "Test assignment name" activity advanced grading page
1 efrain 92
    And I set the field "Grade" to "C"
93
    And I press "Save changes"
94
    And I follow "Edit settings"
95
    When I expand all fieldsets
96
    Then I should see "Some grades have already been awarded, so the grade type and scale cannot be changed"
97
    # Try saving the form and visiting it back to verify everything is working ok.
98
    And I press "Save and display"
99
    And I navigate to "Settings" in current page administration
100
    And I expand all fieldsets
101
    And the field "grade[modgrade_type]" matches value "Scale"
102
    And the field "grade[modgrade_scale]" matches value "ABCDEF"
103
 
104
  @javascript
105
  Scenario: Attempting to change the maximum grade when ratings exist
106
    Given I am on the "Test forum name" "forum activity editing" page logged in as teacher1
107
    And I set the following fields to these values:
108
      | Ratings > Aggregate type        | Average of ratings |
109
      | id_scale_modgrade_type          | Point              |
110
      | Ratings > scale[modgrade_point] | 100                |
111
    And I press "Save and display"
112
    And I follow "Discussion subject"
113
    And I set the field "rating" to "100"
114
    And I am on the "Test forum name" "forum activity editing" page
115
    When I expand all fieldsets
116
    Then I should see "You cannot change the type, as grades already exist for this item."
117
    And the "Maximum grade" "field" should be disabled
118
 
119
  @javascript
120
  Scenario: Attempting to change the maximum grade when no rescaling option has been chosen
121
    Given I am on the "Test assignment name" "assign activity" page logged in as teacher1
1441 ariadna 122
    And I go to "Student 1" "Test assignment name" activity advanced grading page
1 efrain 123
    And I set the field "Grade out of 100" to "50"
124
    And I press "Save changes"
125
    And I follow "Edit settings"
126
    When I expand all fieldsets
127
    Then I should see "Some grades have already been awarded, so the grade type cannot be changed. If you wish to change the maximum grade, you must first choose whether or not to rescale existing grades."