| enablecompletion | 1 |
| enableavailability | 1 |
And I log in as "teacher1"
+ And I am on site homepage
And I follow "Course 1"
And I turn editing mode on
And I click on "Edit settings" "link" in the "Administration" "block"
Then "Student First" user has not completed "Test forum name" activity
And I log out
And I log in as "student1"
+ And I am on site homepage
And I follow "Course 1"
And I press "Mark as complete: Test forum name"
And I log out
And I log in as "teacher1"
+ And I am on site homepage
And I follow "Course 1"
And I expand "Reports" node
And I follow "Activity completion"
And the following config values are set as admin:
| enableavailability | 1 |
And I log in as "teacher1"
+ And I am on site homepage
And I follow "Course 1"
And I turn editing mode on
# Adding the page like this because id_available*_enabled needs to be clicked to trigger the action.
And I press "Save and return to course"
And I log out
When I log in as "student1"
+ And I am on site homepage
And I follow "Course 1"
Then I should see "Available from 31 December 2037"
And "Test assignment 1" activity should be hidden
And I press "Save and return to course"
And I log out
When I log in as "student1"
+ And I am on site homepage
And I follow "Course 1"
Then I should not see "Test assignment 2"
And the following config values are set as admin:
| enableavailability | 1 |
And I log in as "teacher1"
+ #And I am on site homepage
And I follow "Course 1"
And I turn editing mode on
And I add a "Assignment" to section "1" and I fill the form with:
And I press "Save and return to course"
And I log out
When I log in as "student1"
+ And I am on site homepage
And I follow "Course 1"
Then I should see "Not available unless: You achieve a required score in Grade assignment"
And "Test page name" activity should be hidden
And I should see "Submitted for grading"
And I log out
And I log in as "teacher1"
+ And I am on site homepage
And I follow "Course 1"
And I follow "Grade assignment"
And I follow "View/grade all submissions"
And I press "Save changes"
And I log out
And I log in as "student1"
+ And I am on site homepage
And I follow "Course 1"
And "Test page name" activity should be visible
And I should not see "Not available unless: You achieve a required score in Grade assignment"
@javascript
Scenario: Show section greyed-out to student when completion condition is not satisfied
Given I log in as "teacher1"
+ And I am on site homepage
And I follow "Course 1"
And I turn editing mode on
And I click on "Edit settings" "link" in the "Administration" "block"
And I press "Save changes"
And I log out
And I log in as "student1"
+ And I am on site homepage
And I follow "Course 1"
Then I should see "Not available unless: The activity Test label is marked complete"
And I should not see "Test page name"
@javascript
Scenario: Show section greyed-out to student when grade condition is not satisfied
Given I log in as "teacher1"
+ And I am on site homepage
And I follow "Course 1"
And I turn editing mode on
And I add a "Assignment" to section "1" and I fill the form with:
And I press "Save changes"
And I log out
When I log in as "student1"
+ And I am on site homepage
And I follow "Course 1"
Then I should see "Not available unless: You achieve a required score in Grade assignment"
And "Test page name" activity should be hidden
And I should see "Submitted for grading"
And I log out
And I log in as "teacher1"
+ And I am on site homepage
And I follow "Course 1"
And I follow "Grade assignment"
And I follow "View/grade all submissions"
And I press "Save changes"
And I log out
And I log in as "student1"
+ And I am on site homepage
And I follow "Course 1"
And "Test page name" activity should be visible
And I should not see "Not available unless: You achieve a required score in Grade assignment"
And the following config values are set as admin:
| enablecompletion | 1 |
And I log in as "admin"
- And I am on homepage
+ And I set the following administration settings values:
+ | Enable completion tracking | 1 |
+ And I am on site homepage
And I follow "Completion course"
And completion tracking is "Enabled" in current course
And I follow "Course completion"
And I add the "Course completion status" block
And I log out
And I log in as "student1"
+ And I am on site homepage
And I follow "Completion course"
And I should see "Status: Not yet started"
And I log out
When I log in as "teacher1"
+ And I am on site homepage
And I follow "Completion course"
And I follow "View course report"
And I should see "Student First"
And I follow "Click to mark user complete"
And I trigger cron
- And I am on homepage
+ And I am on site homepage
And I log out
Then I log in as "student1"
+ And I am on site homepage
And I follow "Completion course"
And I should see "Status: Complete"