Answer:
Denial.
Explanation:
According to my research on studies conducted by various psychologists, I can say that based on the information provided within the question the defense mechanism being used in this situation is Denial. This is a defense mechanism where the individual refuses to accept what is real and instead creating a more acceptable fantasy in your head. This is what the individual in this scenario is doing by creating a false scenario in his head in order to explain his bad grade.
I hope this answered your question. If you have any more questions feel free to ask away at Brainly.