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 @core_completion
2
Feature: Allow to mark course as completed without cron for activity completion criteria
3
  In order for students to see instant course completion updates
4
  I need to be able update completion state without cron
5
 
6
  Background:
7
    Given the following "courses" exist:
8
      | fullname          | shortname | category | enablecompletion |
9
      | Completion course | CC1       | 0        | 1                |
10
    And the following "users" exist:
11
      | username | firstname | lastname  | email                |
12
      | student1 | Student   | First     | student1@example.com |
13
      | student2 | Student   | Second    | student2@example.com |
14
      | teacher1 | Teacher   | First     | teacher1@example.com |
15
    And the following "course enrolments" exist:
16
      | user     | course | role           |
17
      | student1 | CC1    | student        |
18
      | student2 | CC1    | student        |
19
      | teacher1 | CC1    | editingteacher |
20
    And the following "activity" exists:
21
      | activity                            | assign                      |
22
      | course                              | CC1                         |
23
      | name                                | Test assignment name        |
24
      | idnumber                            | assign1                     |
25
    And the following "blocks" exist:
26
      | blockname        | contextlevel | reference | pagetypepattern | defaultregion |
27
      | completionstatus | Course       | CC1       | course-view-*   | side-pre      |
28
    And I am on the "Test assignment name" "assign activity editing" page logged in as admin
29
    And I click on "Expand all" "link" in the "region-main" "region"
30
    And I set the field "Add requirements" to "1"
31
    And I set the field "completionusegrade" to "1"
32
    And I press "Save and return to course"
33
    And I navigate to "Course completion" in current page administration
34
    And I expand all fieldsets
35
    And I set the field "Assignment - Test assignment name" to "1"
36
    And I press "Save changes"
37
 
38
  @javascript
39
  Scenario: Update course completion when student marks activity as complete
40
    Given I am on the "Test assignment name" "assign activity editing" page logged in as teacher1
41
    And I click on "Expand all" "link" in the "region-main" "region"
42
    And I set the field "Students must manually mark the activity as done" to "1"
43
    And I press "Save and return to course"
44
    When I am on the "Completion course" course page logged in as student1
45
    And I should see "Status: Not yet started"
46
    And I press "Mark as done"
47
    And I wait until "Done" "button" exists
48
    And "Mark as done" "button" should not exist
49
    And I reload the page
50
    Then I should see "Status: Complete"
51
 
52
  @javascript
53
  Scenario: Update course completion when teacher grades a single assignment
54
    Given I am on the "Test assignment name" "assign activity" page logged in as teacher1
1441 ariadna 55
    And I go to "student1@example.com" "Test assignment name" activity advanced grading page
1 efrain 56
    And I set the field "Grade out of 100" to "40"
57
    And I click on "Save changes" "button"
58
    And I am on "Completion course" course homepage
59
    When I am on the "Completion course" course page logged in as student1
60
    Then I should see "Status: Complete"
61
 
62
  @javascript
63
  Scenario: Update course completion with multiple activity criteria
64
    Given the following "activity" exists:
65
      | activity                            | assign                      |
66
      | course                              | CC1                         |
67
      | name                                | Test assignment name2       |
68
      | idnumber                            | assign2                     |
69
    And I am on the "Test assignment name2" "assign activity editing" page logged in as admin
70
    And I click on "Expand all" "link" in the "region-main" "region"
71
    And I set the field "Add requirements" to "1"
72
    And I set the field "completionusegrade" to "1"
73
    And I press "Save and return to course"
74
    And I navigate to "Course completion" in current page administration
75
    And I should see "Course completion settings" in the "tertiary-navigation" "region"
76
    And I expand all fieldsets
77
    And I set the field "Assignment - Test assignment name" to "1"
78
    And I set the field "Assignment - Test assignment name2" to "1"
79
    And I press "Save changes"
80
    And I am on the "Test assignment name" "assign activity" page
1441 ariadna 81
    And I go to "student1@example.com" "Test assignment name" activity advanced grading page
1 efrain 82
    And I set the field "Grade out of 100" to "40"
83
    And I click on "Save changes" "button"
84
    And I am on the "Completion course" course page logged in as student1
85
    And I should see "Status: In progress"
86
    And I am on the "Test assignment name2" "assign activity" page logged in as teacher1
1441 ariadna 87
    And I go to "student1@example.com" "Test assignment name2" activity advanced grading page
1 efrain 88
    And I set the field "Grade out of 100" to "40"
89
    And I click on "Save changes" "button"
90
    When I am on the "Completion course" course page logged in as student1
91
    Then I should see "Status: Complete"
92
 
93
  @javascript
94
  Scenario: Course completion should not be updated when teacher grades assignment on course grader report page
95
    Given I am on the "Completion course" "grades > Grader report > View" page logged in as "teacher1"
96
    And I turn editing mode on
97
    And I give the grade "57" to the user "Student First" for the grade item "Test assignment name"
98
    And I press "Save changes"
99
    When I am on the "Completion course" course page logged in as student1
100
    Then I should see "Status: Pending"
101
    And I run the scheduled task "core\task\completion_regular_task"
102
    And I wait "1" seconds
103
    And I run the scheduled task "core\task\completion_regular_task"
104
    And I reload the page
105
    And I should see "Status: Complete"
106
 
107
  @javascript
108
  Scenario: Course completion should not be updated when teacher grades assignment on activity grader report page
109
    Given I am on the "Completion course" "grades > Single View > View" page logged in as "teacher1"
110
    And I click on "Users" "link" in the ".page-toggler" "css_element"
111
    And I turn editing mode on
1441 ariadna 112
    And I click on "Student First" in the "Search users" search combo box
1 efrain 113
    And I set the field "Override for Test assignment name" to "1"
114
    When I set the following fields to these values:
115
      | Grade for Test assignment name | 10.00 |
116
      | Feedback for Test assignment name | test data |
117
    And I press "Save"
118
    When I am on the "Completion course" course page logged in as student1
119
    And I should see "Status: Pending"
120
    And I run the scheduled task "core\task\completion_regular_task"
121
    And I wait "1" seconds
122
    And I run the scheduled task "core\task\completion_regular_task"
123
    And I reload the page
124
    Then I should see "Status: Complete"
125
 
126
  @javascript @_file_upload
127
  Scenario: Course completion should not be updated when teacher imports grades with csv file
128
    Given I am on the "Completion course" course page logged in as teacher1
129
    And I navigate to "CSV file" import page in the course gradebook
130
    And I upload "lib/tests/fixtures/upload_grades.csv" file to "File" filemanager
131
    And I press "Upload grades"
132
    And I set the field "Map to" to "Email address"
133
    And I set the field "Test assignment name" to "Assignment: Test assignment name"
134
    And I press "Upload grades"
135
    And I press "Continue"
136
    And I should see "10.00" in the "Student First" "table_row"
137
    And I am on the "Completion course" course page logged in as student1
138
    And I should see "Status: Pending"
139
    When I run the scheduled task "core\task\completion_regular_task"
140
    And I wait "1" seconds
141
    And I run the scheduled task "core\task\completion_regular_task"
142
    And I reload the page
143
    Then I should see "Status: Complete"