grade input validation