Answer
Wa `alaykum As-Salamu waRahmatullahi wa Barakatuh.
In the Name of Allah, Most Gracious, Most Merciful.
All praise and thanks are due to Allah, and peace and blessings be upon His Messenger.
Answering your question, Sheikh Ahmad Kutty, a Senior Lecturer and an Islamic Scholar at the Islamic Institute of Toronto, Ontario, Canada, states:
I cannot speak on behalf of Allah. All that I can say for sure is that anyone who is indulging in sins cannot expect the blessings of Allah. Even if she succeeds in her studies through hard work, that does not mean that Allah is pleased with her.
As humans, we ought to care more about pleasing Allah, our Creator, and Lord, than about getting high marks in our studies.
I pray to Allah to inspire us all to seek repentance and ask forgiveness of Allah while trying hard to excel in all of our efforts. Allah says, “And whoever fears Allah – He will make for him a way out.” (At-Talaq 65:2)
Allah Almighty knows best.