Proyectos de Subversion Moodle

Rev

| Ultima modificación | Ver Log |

Rev Autor Línea Nro. Línea
1 efrain 1
@core_grades @javascript
2
Feature: Grade item validation
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 on the grade item form
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 "grade categories" exist:
20
      | fullname   | course |
21
      | Category 1 | C1     |
22
    And I log in as "admin"
23
    And I navigate to "Grades > Scales" in site administration
24
    And I press "Add a new scale"
25
    And I set the following fields to these values:
26
      | Name  | ABCDEF      |
27
      | Scale | F,E,D,C,B,A |
28
    And I press "Save changes"
29
    And I press "Add a new scale"
30
    And I set the following fields to these values:
31
      | Name  | Letter scale                              |
32
      | Scale | Disappointing, Good, Very good, Excellent |
33
    And I press "Save changes"
34
    And I am on the "Course 1" "grades > gradebook setup" page
35
    And I choose the "Add grade item" item in the "Add" action menu
36
    And I set the following fields to these values:
37
      | Item name | MI 1 |
38
    And I click on "Save" "button" in the "New grade item" "dialogue"
39
 
40
  Scenario: Being able to change the grade type, scale and maximum grade for a manual grade item when there are no grades
41
    Given I click on grade item menu "MI 1" of type "gradeitem" on "setup" page
42
    And I choose "Edit grade item" in the open action menu
43
    When I should not see "Some grades have already been awarded, so the grade type"
44
    Then I set the field "Grade type" to "Scale"
45
    And I click on "Save" "button" in the "Edit grade item" "dialogue"
46
    And I should see "Scale must be selected"
47
    And I set the field "Scale" to "ABCDEF"
48
    And I click on "Save" "button" in the "Edit grade item" "dialogue"
49
    And I should not see "You cannot change the type, as grades already exist for this item"
50
    And I click on grade item menu "MI 1" of type "gradeitem" on "setup" page
51
    And I choose "Edit grade item" in the open action menu
52
    And I should not see "Some grades have already been awarded, so the grade type"
53
    And I set the field "Scale" to "Letter scale"
54
    And I click on "Save" "button" in the "Edit grade item" "dialogue"
55
    And I should not see "You cannot change the scale, as grades already exist for this item"
56
 
57
  Scenario: Attempting to change a manual item's grade type when grades already exist
58
    Given I navigate to "View > Grader report" in the course gradebook
59
    And I turn editing mode on
60
    And I give the grade "20.00" to the user "Student 1" for the grade item "MI 1"
61
    And I press "Save changes"
62
    And I navigate to "Setup > Gradebook setup" in the course gradebook
63
    And I click on grade item menu "MI 1" of type "gradeitem" on "setup" page
64
    When I choose "Edit grade item" in the open action menu
65
    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."
66
    And "//div[contains(concat(' ', normalize-space(@class), ' '), 'felement') and contains(text(), 'Value')]" "xpath_element" should exist
67
 
68
  Scenario: Attempting to change a manual item's scale when grades already exist
69
    Given I click on grade item menu "MI 1" of type "gradeitem" on "setup" page
70
    And I choose "Edit grade item" in the open action menu
71
    And I set the field "Grade type" to "Scale"
72
    And I set the field "Scale" to "ABCDEF"
73
    And I click on "Save" "button" in the "Edit grade item" "dialogue"
74
    And I navigate to "View > Grader report" in the course gradebook
75
    And I turn editing mode on
76
    And I give the grade "C" to the user "Student 1" for the grade item "MI 1"
77
    And I press "Save changes"
78
    And I navigate to "Setup > Gradebook setup" in the course gradebook
79
    And I click on grade item menu "MI 1" of type "gradeitem" on "setup" page
80
    And I choose "Edit grade item" in the open action menu
81
    Then I should see "Some grades have already been awarded, so the grade type and scale cannot be changed."
82
    And "//div[contains(concat(' ', normalize-space(@class), ' '), 'felement') and contains(text(), 'ABCDEF')]" "xpath_element" should exist
83
 
84
  Scenario: Attempting to change a manual item's maximum grade when no rescaling option has been chosen
85
    Given I navigate to "View > Grader report" in the course gradebook
86
    And I turn editing mode on
87
    And I give the grade "20.00" to the user "Student 1" for the grade item "MI 1"
88
    And I press "Save changes"
89
    And I navigate to "Setup > Gradebook setup" in the course gradebook
90
    And I click on grade item menu "MI 1" of type "gradeitem" on "setup" page
91
    When I choose "Edit grade item" in the open action menu
92
    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."
93
    And I should see "Choose" in the "Rescale existing grades" "field"
94
    And the "Maximum grade" "field" should be disabled
95
 
96
  Scenario: As a teacher confirm that I can delete items within the gradebook
97
    Given I navigate to "Setup > Gradebook setup" in the course gradebook
98
    And the following should exist in the "setup-grades" table:
99
      | Name         |
100
      | Course       |
101
      | MI 1         |
102
      | Category 1   |
103
      | Course total |
104
    And I click on grade item menu "MI 1" of type "gradeitem" on "setup" page
105
    And I choose "Delete" in the open action menu
106
    And "Confirm" "dialogue" should exist
107
    When I click on "Delete" "button" in the "Confirm" "dialogue"
108
    And I wait to be redirected
109
    And the following should not exist in the "setup-grades" table:
110
      | Name |
111
      | MI 1 |
112
    When I click on grade item menu "Category 1" of type "category" on "setup" page
113
    And I choose "Delete" in the open action menu
114
    And "Confirm" "dialogue" should exist
115
    And I click on "Delete" "button" in the "Confirm" "dialogue"
116
    And I wait to be redirected
117
    And the following should not exist in the "setup-grades" table:
118
      | Name       |
119
      | Category 1 |