enable/disable submit assignment button

Is there a way to enable the submit assignment button inside the TOC frame only when the course is completed (just after the e-learning package sets the cmi.core.lesson_status value to completed)?
I don't want that the student should be able to submit its assignment until he hasn't completed the course; he should be able to do so only when the course is finished.