Can someone correct my approach?

No, and this is because once the student has zero questions remaining, the process is terminated.