Wishful thinking. This type of thinking is having a thought on what is good, rather than facing reality. The student knew that he hadn't given his best effort when it came to his studies. Instead of studying and learning, he was playing every day.
He believed and wished that he would still get an A on his exam. Instead of taking steps to learn the information and study. The reality is that the student would fail the exam, but his wishes were more pleasant for him to believe.