Activity completion API
From MoodleDocs
Moodle 2.0
Modules do not need to be changed to support conditional availability, but they do need changing to support the completion system.
If you make no changes to a module whatsoever, it can only support 'manual' completion (where the user ticks a box).