Added checking logic for publishing exams