Wow, where to start???
Go through testing instructions in MDL-34481 to confirm it still works as expected.
Create three students. X, Y and Z.
Make sure the Moodle cron does not run while testing, unless explicitly asked for at a certain step.
Create a new course "A" with completion enabled.
In completion settings, enable the Self Completion criteria.
Add the Course Completion Status and Self Completion blocks to the course.
Enrol all three students.
Create a new course "B" with completion enabled.
Add the Course Completion Status and Self Completion blocks to the course.
Update "News forum" settings. Enable activity completion for this activity by selecting Completion Tracking -> Students can manually mark activity as completed. Save.
In completion settings, set the following:
- Overall criteria type aggregation: All
- Completion dependencies: Choose course A
- Manual self completion: Tick
- Manual completion by: Teacher
- Activities completed: Tick activity
- Date: Tick and specify date in the past
- Duration after enrolment: Do not tick
- Course grade: Tick and set grade to 10.000
- Unenrolment: Do not tick
Enrol all three students.
Run cron.
Open up Completion report for course "A". No users should be complete.
Open up Completion report for course "B". User's should only have the Date criteria marked as complete.
Login as a Teacher, visit Completion report for course "B", mark each user as complete.
Refresh completion report and note that no users have completed the course.
Login as user Y, visit Course "A" and mark self complete using the block.
Note in Course Completion Status block user is now complete in course.
Visit Course "B" as user Y, mark complete using the self completion block. Click tickbox by "News Forum" to mark it as complete.
Note in Course Completion Status block user now has the Date, Activity, Teacher, Self and Dependency criteria marked as complete, but is incomplete in course.
Logout from user Y. View Completion report for course "B". Note that only user Y has Dependency criteria complete.
View Grade report for course "B", enter a grade of 5.0 for user X, 20.0 for user Y and 10.0 for user Z.
View Completion report for course "B" and note that only user Y and Z have the grade criteria marked as complete.
User Y should also be noted as being Complete in course "B".