Instead of having teachers turning InstMsg of for members of a course, perhaps the IM system could check if a user (stud) is member of a course with a quiz that is active.
select xxx from course,user_students,quiz
where (appropriate join) and quiz.timeopen (mumble..)
and quiz.timeclose (mumble ..);
mumble is here a check on date/time to see if the quiz is running just now.
If no such quiz then open instant message window as requested, otherwise give a scary message
General help
Messaging: Instant messages turned off during quiz
This discussion has been locked so you can no longer reply to it.