Enable completion in Moodle
Ensure that the setting
enablecompletion is turned on. It is located in Site administration > Advanced features > Enable completion tracking.
You will also need to enable it in your course. Visit your course’s settings page, and locate Completion tracking > Enable completion tracking, it should be set to Yes.
For more on completion, please refer to Moodle documention.