You might look at the certificate module. It has the logic for what you want to do. Unfortunately it doesn't do anything with the gradebook. There is also a certificate report in the modules database that lets you pull a report of who has received certificates.
Students need to pass every module to pass course. Is this possible
This discussion has been locked because a year has elapsed since the last post. Please start a new discussion topic.