After creating a course and checking that all completion tracking settings are correctly modified in the Course settings and in the Activity settings. And after the student successfully passed the activities and quizzes, the Course Completion status is still pending and not completed. Even after adding self completion block, the same issue, the course is stuck at pending state only.
Course completion is updated via the system cron process.
Make sure your cron process is running or trigger it manually via [site]/admin/cron.php (if web running is enabled in your site settings) or on the commandline via:
php [site path]/admin/cli/cron.php