Proyectos de Subversion Moodle

Rev

| Ultima modificación | Ver Log |

Rev Autor Línea Nro. Línea
1441 ariadna 1
@gradepenalty @gradepenalty_duedate @penalty_rule
2
Feature: As an administrator
3
  I need to add new penalty rule
4
  I need to edit penalty rule
5
  I need to delete penalty rule
6
 
7
  Background:
8
    Given I log in as "admin"
9
    And the following "courses" exist:
10
      | fullname | shortname | format |
11
      | Course 1 | C1        | topics |
12
    And I navigate to "Grades > Grade penalties > Manage penalty plugins" in site administration
13
    And I click on "Enable Late submission penalties" "checkbox"
14
    And I reload the page
15
 
16
  @javascript
17
  Scenario: Edit, add, and delete and insert penalty rules
18
    When I navigate to "Grades > Grade penalties > Late submission penalties > Penalty rules" in site administration
19
    # Add 5 penalty rules.
20
    And I click on "Edit" "button"
21
    And I click on "Add rule" "button"
22
    And I click on "Add rule" "button"
23
    And I click on "Add rule" "button"
24
    And I click on "Add rule" "button"
25
    And I click on "Add rule" "button"
26
    And I set the following fields to these values:
27
      | overdueby[0][number]      |  1   |
28
      | penalty[0]                |  10  |
29
      | overdueby[1][number]      |  1   |
30
      | penalty[1]                |  10  |
31
    And I click on "Save changes" "button"
32
    Then I should see "The overdue amount must be greater than the amount for the rule above (1 day). The penalty must be greater than the penalty for the rule above (10.0%)."
33
    And I set the following fields to these values:
34
      | overdueby[1][number]      |  2   |
35
      | penalty[1]                |  20  |
36
      | overdueby[2][number]      |  3   |
37
      | penalty[2]                |  101 |
38
    And I click on "Save changes" "button"
39
    Then I should see "The penalty cannot be greater than 100.0%."
40
    And I set the following fields to these values:
41
      | overdueby[2][number]      |  3   |
42
      | penalty[2]                |  30  |
43
      | overdueby[3][number]      |  4   |
44
      | penalty[3]                |  40  |
45
      | overdueby[4][number]      |  5   |
46
      | penalty[4]                |  50  |
47
      | Final penalty rule        |  100 |
48
    And I click on "Save changes" "button"
49
    Then I should see "Changes saved"
50
    Then I should see "10%" in the "≤ 1 day" "table_row"
51
    Then I should see "20%" in the "≤ 2 days" "table_row"
52
    Then I should see "30%" in the "≤ 3 days" "table_row"
53
    Then I should see "40%" in the "≤ 4 days" "table_row"
54
    Then I should see "50%" in the "≤ 5 days" "table_row"
55
    Then I should see "100%" in the "> 5 days" "table_row"
56
 
57
  @javascript
58
  Scenario: Override penalty rules at a course context
59
    When I navigate to "Grades > Grade penalties > Late submission penalties > Penalty rules" in site administration
60
    And I click on "Edit" "button"
61
    # Add 5 penalty rules.
62
    And I click on "Add rule" "button"
63
    And I click on "Add rule" "button"
64
    And I click on "Add rule" "button"
65
    And I click on "Add rule" "button"
66
    And I click on "Add rule" "button"
67
    And I set the following fields to these values:
68
      | overdueby[0][number]      |  1   |
69
      | penalty[0]                |  10  |
70
      | overdueby[1][number]      |  2   |
71
      | penalty[1]                |  20  |
72
      | overdueby[2][number]      |  3   |
73
      | penalty[2]                |  30  |
74
      | overdueby[3][number]      |  4   |
75
      | penalty[3]                |  40  |
76
      | overdueby[4][number]      |  5   |
77
      | penalty[4]                |  50  |
78
      | Final penalty rule        |  100 |
79
    And I click on "Save changes" "button"
80
    # Override penalty rules at a course context.
81
    When I am on "Course 1" course homepage
82
    And I navigate to "Grade penalties > Penalty rules" in current page administration
83
    Then I should see "10%" in the "≤ 1 day" "table_row"
84
    Then I should see "20%" in the "≤ 2 days" "table_row"
85
    Then I should see "30%" in the "≤ 3 days" "table_row"
86
    Then I should see "40%" in the "≤ 4 days" "table_row"
87
    Then I should see "50%" in the "≤ 5 days" "table_row"
88
    Then I should see "100%" in the "> 5 days" "table_row"
89
    And I click on "Edit" "button"
90
    And I set the following fields to these values:
91
      | overdueby[0][number]      |  7   |
92
      | penalty[0]                |  20  |
93
      | overdueby[1][number]      |  8   |
94
      | penalty[1]                |  30  |
95
      | overdueby[2][number]      |  9   |
96
      | penalty[2]                |  40  |
97
      | overdueby[3][number]      |  10  |
98
      | penalty[3]                |  50  |
99
      | overdueby[4][number]      |  11  |
100
      | penalty[4]                |  60  |
101
      | Final penalty rule        |  100 |
102
    And I click on "Save changes" "button"
103
    Then I should see "Changes saved"
104
    Then I should see "20%" in the "≤ 7 days" "table_row"
105
    Then I should see "30%" in the "≤ 8 days" "table_row"
106
    Then I should see "40%" in the "≤ 9 days" "table_row"
107
    Then I should see "50%" in the "≤ 10 days" "table_row"
108
    Then I should see "60%" in the "≤ 11 days" "table_row"
109
    Then I should see "100%" in the "> 11 days" "table_row"
110
    # Reset.
111
    When I click on "Reset" "button"
112
    Then I click on "Continue" "button"
113
    Then I should see "10%" in the "≤ 1 day" "table_row"
114
    Then I should see "20%" in the "≤ 2 days" "table_row"
115
    Then I should see "30%" in the "≤ 3 days" "table_row"
116
    Then I should see "40%" in the "≤ 4 days" "table_row"
117
    Then I should see "50%" in the "≤ 5 days" "table_row"
118
    Then I should see "100%" in the "> 5 days" "table_row"