exams logic