2 Feature: Allow teachers to edit the default activity completion rules in a course.
3 In order to set the activity completion defaults for new activities
5 I need to be able to edit the completion rules for a group of activities.
7 # Given I am a teacher in a course with completion tracking enabled and activities present.
8 # When I edit activity completion defaults for activity types.
9 # Then the completion rule defaults should apply only to activities created from that point onwards.
11 Scenario: Bulk edit activity completion default rules
12 Given the following "courses" exist:
13 | fullname | shortname | category |
15 And the following "users" exist:
16 | username | firstname | lastname | email |
17 | teacher1 | Teacher | Frist | teacher1@example.com |
18 | student1 | Student | First | student1@example.com |
19 And the following "course enrolments" exist:
20 | user | course | role |
21 | teacher1 | C1 | editingteacher |
22 | student1 | C1 | student |
23 And the following "activities" exist:
24 | activity | course | idnumber | name | intro | grade |
25 | assign | C1 | a1 | Test assignment one | Submit something! | 300 |
26 And I log in as "teacher1"
27 And I am on site homepage
28 And I follow "Course 1"
29 And I turn editing mode on
30 And I navigate to "Edit settings" in current page administration
31 And I set the following fields to these values:
32 | Enable completion tracking | Yes |
33 And I press "Save and display"
34 When I navigate to "Course completion" in current page administration
35 And I follow "Default activity completion"
36 And I click on "Assignments" "checkbox"
37 And I click on "Edit" "button"
38 And I should see "Completion tracking"
39 And I should see "The changes will affect the following 1 activities or resources:"
40 And I should see "Student must submit to this activity to complete it"
41 And I set the following fields to these values:
42 | completion | Show activity as complete when conditions are met|
43 | completionview | 1 |
44 | completionusegrade | 1 |
45 | completionsubmit | 1 |
46 And I click on "Save changes" "button"
47 Then I should see "Changes saved"
48 And I should see "With conditions" in the "//div[contains(concat(' ', normalize-space(@class), ' '), ' row ')][.//*[text() = 'Assignments']]" "xpath_element"
49 And I should see "Student must view this activity to complete it" in the "//div[contains(concat(' ', normalize-space(@class), ' '), ' row ')][.//*[text() = 'Assignments']]" "xpath_element"
50 And I should see "Student must receive a grade to complete this activity" in the "//div[contains(concat(' ', normalize-space(@class), ' '), ' row ')][.//*[text() = 'Assignments']]" "xpath_element"
51 And I should see "Student must submit to this activity to complete it" in the "//div[contains(concat(' ', normalize-space(@class), ' '), ' row ')][.//*[text() = 'Assignments']]" "xpath_element"
52 And I should not see "Completion expected on" in the "//div[contains(concat(' ', normalize-space(@class), ' '), ' row ')][.//*[text() = 'Assignments']]" "xpath_element"