Added new function checkStudentViolation()