Thank you for your question. I’m not sure that your problem has to do with your `ibadah. You are trying to make a connection between fulfilling the requirements that Allah has put forth for us as Muslims with getting good grades.
Your reasons for not getting good grades probably lie elsewhere. Perhaps you are not studying correctly, or you do not really understand the materials that you are studying. Or perhaps you are not a good test-taker, and you need help in getting better at that.
Rather than accusing Allah of being unjust (I seek refuge in Allah from that!), which is what it sounds like you are doing, you should use this experience to examine your actions and try to figure out where you went wrong.
Our `ibadah to Allah is out of our belief in His Lordship and the realization that there is no God but Him and only He is worthy of it, not so that we can get good grades and have all our wishes come true exactly as we expect.
He is God; He has created this situation for you for reasons only He knows. He wants goodness for you, and now it is up to you to look hard at yourself and try and understand why you are not doing well in school.
Ask Him for guidance and help in trying to become a better student and person rather than merely expecting things to work out a certain way just because you feel you are obedient and you deserve it. Even the most pious of Muslims, including the Prophet (SAW) and His companions, were never so arrogant to think that there “owed” something from Allah!
This is a good test of sincerity for you. Don’t lose hope; Allah always provides for His servants, just not always in the way we expect. Therefore, look for the wisdom in these experiences and use it to better yourself.
Disclaimer: The conceptualization and recommendations stated in this response are very general and purely based on the limited information that was provided in the question. In no event shall AboutIslam, it’s volunteers, writers, scholars, counselors, or employees be held liable for any direct, indirect, exemplary, punitive, consequential or other damages whatsoever that may arise through your decision or action in the use of the services which our website provides.