Autoría | Ultima modificación | Ver Log |
@availability @availability_completionFeature: Confirm that availability_completion works with previous activity settingIn order to control student access to activitiesAs a teacherI need to set completion conditions which prevent student accessBackground:Given the following "courses" exist:| fullname | shortname | format | enablecompletion | numsections || Course 1 | C1 | topics | 1 | 5 |And the following "users" exist:| username || teacher1 |And the following "course enrolments" exist:| user | course | role || teacher1 | C1 | editingteacher |Given the following "activities" exist:| activity | name | intro | course | idnumber | groupmode | completion | section || page | Page1 | Page 1 description | C1 | page1 | 1 | 1 | 1 || page | Page Ignored 1 | Page Ignored | C1 | pagei1 | 1 | 0 | 1 || page | Page2 | Page 2 description | C1 | page2 | 1 | 1 | 3 || page | Page3 | Page 3 description | C1 | page3 | 1 | 1 | 4 |@javascriptScenario: Test condition with previous activity on an activityGiven I log in as "teacher1"And I am on "Course 1" course homepage with editing mode on# Set Page3 restriction to Previous Activity with completion.When I open "Page3" actions menuAnd I click on "Edit settings" "link" in the "Page3" activityAnd I expand all fieldsetsAnd I click on "Add restriction..." "button"And I click on "Activity completion" "button" in the "Add restriction..." "dialogue"And I click on "Displayed if student doesn't meet this condition • Click to hide" "link"And I set the field "Activity or resource" to "Previous activity with completion"And I press "Save and return to course"Then I should see "Not available unless: The previous activity with completion" in the "region-main" "region"When I turn editing mode offThen I should see "Not available unless: The activity Page2 is marked complete" in the "region-main" "region"# Remove Page 2 and check Page3 depends now on Page1.When I turn editing mode onAnd I change window size to "large"And I delete "Page2" activityAnd I turn editing mode offThen I should see "Not available unless: The activity Page1 is marked complete" in the "region-main" "region"@javascriptScenario: Test previous activity availability when duplicate an activityGiven I log in as "teacher1"And I am on "Course 1" course homepage with editing mode on# Set Page3 restriction to Previous Activity with completion.When I open "Page3" actions menuAnd I click on "Edit settings" "link" in the "Page3" activityAnd I expand all fieldsetsAnd I click on "Add restriction..." "button"And I click on "Activity completion" "button" in the "Add restriction..." "dialogue"And I click on "Displayed if student doesn't meet this condition • Click to hide" "link"And I set the field "Activity or resource" to "Previous activity with completion"And I press "Save and return to course"Then I should see "Not available unless: The previous activity with completion" in the "region-main" "region"When I turn editing mode offThen I should see "Not available unless: The activity Page2 is marked complete" in the "region-main" "region"# Duplicate Page3.When I turn editing mode onAnd I duplicate "Page3" activityAnd I turn editing mode offThen I should see "Not available unless: The activity Page3 is marked complete" in the "region-main" "region"@javascriptScenario: Test previous activity availability when modify completion tackingGiven I log in as "teacher1"And I am on "Course 1" course homepage with editing mode on# Set Page3 restriction to Previous Activity with completion.When I open "Page3" actions menuAnd I click on "Edit settings" "link" in the "Page3" activityAnd I expand all fieldsetsAnd I click on "Add restriction..." "button"And I click on "Activity completion" "button" in the "Add restriction..." "dialogue"And I click on "Displayed if student doesn't meet this condition • Click to hide" "link"And I set the field "Activity or resource" to "Previous activity with completion"And I press "Save and return to course"Then I should see "Not available unless: The previous activity with completion" in the "region-main" "region"When I turn editing mode offThen I should see "Not available unless: The activity Page2 is marked complete" in the "region-main" "region"# Test if I disable completion tracking on Page2 section 5 depends on Page2.When I turn editing mode onAnd I change window size to "large"When I open "Page2" actions menuAnd I click on "Edit settings" "link" in the "Page2" activityAnd I set the following fields to these values:| None | 1 |And I press "Save and return to course"When I turn editing mode offThen I should see "Not available unless: The activity Page1 is marked complete" in the "region-main" "region"@javascriptScenario: Test condition with previous activity on a sectionGiven I log in as "teacher1"And I am on "Course 1" course homepage with editing mode on# Set section 4 restriction to Previous Activity with completion.When I edit the section "4"And I expand all fieldsetsAnd I click on "Add restriction..." "button"And I click on "Activity completion" "button" in the "Add restriction..." "dialogue"And I click on "Displayed if student doesn't meet this condition • Click to hide" "link"And I set the field "Activity or resource" to "Previous activity with completion"And I press "Save changes"Then I should see "Not available unless: The previous activity with completion" in the "region-main" "region"When I turn editing mode offThen I should see "Not available unless: The activity Page2 is marked complete" in the "region-main" "region"# Remove Page 2 and check Section 4 depends now on Page1.When I am on "Course 1" course homepage with editing mode onAnd I change window size to "large"And I delete "Page2" activityAnd I turn editing mode offThen I should see "Not available unless: The activity Page1 is marked complete" in the "region-main" "region"@javascriptScenario: Test condition with previous activity on the first activity of the courseGiven I log in as "teacher1"And I am on "Course 1" course homepage with editing mode on# Try to set Page1 restriction to Previous Activity with completion.When I open "Page1" actions menuAnd I click on "Edit settings" "link" in the "Page1" activityAnd I expand all fieldsetsAnd I click on "Add restriction..." "button"And I click on "Activity completion" "button" in the "Add restriction..." "dialogue"And I click on "Displayed if student doesn't meet this condition • Click to hide" "link"Then the "Activity or resource" select box should not contain "Previous activity with completion"# Set Page2 restriction to Previous Activity with completion and delete Page1.When I am on "Course 1" course homepageWhen I open "Page2" actions menuAnd I click on "Edit settings" "link" in the "Page2" activityAnd I expand all fieldsetsAnd I click on "Add restriction..." "button"And I click on "Activity completion" "button" in the "Add restriction..." "dialogue"And I click on "Displayed if student doesn't meet this condition • Click to hide" "link"And I set the field "Activity or resource" to "Previous activity with completion"And I press "Save and return to course"Then I should see "Not available unless: The previous activity with completion" in the "region-main" "region"# Delete Page 1 and check than Page2 now depends on a missing activity (no previous activity found).When I am on "Course 1" course homepageAnd I delete "Page1" activityAnd I turn editing mode offThen I should see "Not available unless: The activity (Missing activity)" in the "region-main" "region"@javascriptScenario: Test previous activities on empty sectionsGiven I log in as "teacher1"And I am on "Course 1" course homepage with editing mode onAnd I change window size to "large"# Set section 2 restriction to Previous Activity with completion.When I edit the section "2"And I expand all fieldsetsAnd I click on "Add restriction..." "button"And I click on "Activity completion" "button" in the "Add restriction..." "dialogue"And I click on "Displayed if student doesn't meet this condition • Click to hide" "link"And I set the field "Activity or resource" to "Previous activity with completion"And I press "Save changes"Then I should see "Not available unless: The previous activity with completion" in the "region-main" "region"And I turn editing mode offAnd I should see "Not available unless: The activity Page1 is marked complete" in the "region-main" "region"# Set section 5 restriction to Previous Activity with completion.And I am on "Course 1" course homepage with editing mode onAnd I edit the section "5"And I expand all fieldsetsAnd I click on "Add restriction..." "button"And I click on "Activity completion" "button" in the "Add restriction..." "dialogue"And I click on "Displayed if student doesn't meet this condition • Click to hide" "link"And I set the field "Activity or resource" to "Previous activity with completion"And I press "Save changes"And I should see "Not available unless: The previous activity with completion" in the "region-main" "region"And I turn editing mode offThen I should see "Not available unless: The activity Page3 is marked complete" in the "region-main" "region"# Test if I disable completion tracking on Page3 section 5 depends on Page2.And I am on "Course 1" course homepage with editing mode onAnd I open "Page3" actions menuAnd I click on "Edit settings" "link" in the "Page3" activityAnd I set the following fields to these values:| None | 1 |And I press "Save and return to course"And I turn editing mode offAnd I should see "Not available unless: The activity Page2 is marked complete" in the "region-main" "region"