You can use the completion tracking feature of Moodle.
step 1: Go to site administration > Advanced features > click the check box for "Enable completion tracking" > click on save changes.
Step 2 : Go to your course > edit settings > Completion tracking > choose "yes" for "Enable completion tracking".
step 3: Go to each activities of course > edit settings > Activity completion > choose criteria what you want > save changes.
step 4: Again go to course administration > Course completion > configure your completion settings > save changes.
Useful Links:-
https://docs.moodle.org/23/en/Course_completion_settings
https://docs.moodle.org/27/en/Activity_completion_settings
Regards,
Purnendu