You should be able to do this with activity restriction. Add two conditions one that it is available before do date and the other that the grade is positive. Select that at least one condition must be true.
Quiz
Quiz Attempts After the Due Date
This discussion has been locked so you can no longer reply to it.