There could be two reasons. While you are in class you cannot listen properly. The other reason is that when you study at home & write in the exam you are not sure about the correct answer.
What you can do, try to fix your attention. Namaz will help for this. This practice will increase your memory, wisdom & concentration. Listen teachers’ lecture considerably. Inshallah you will improve a lot.