How to marked a student's unit as Completed in Staff Grading xBlock


In my custom xBlock, I want staff have permission to give student points without them submitted any problems. I’ve researched code of some docs any xBlock repos such as: edx-sga or staff_graded-xblock.

Here is my code where I do the task:

for enrollment in course_enrollments:
            user = enrollment.user
            set_score(self.location,, map_point[], 100)
        grades_api.task_compute_all_grades_for_course.apply_async(kwargs={'course_key': str(self.location.course_key)})

After testing, the student had received points but the unit haven’t marked as completed.

Did I do it wrong? How could staffs marked a student unit as completed?