Assalamualaikum warahmatullahi wabarakatu,If a student of knowledge had the intention to reach a level of knowledge to a scholar level with the intention to benefit themselves and the ummah and made the effort to study and learn, yet died before reaching this desired goal. Will they achieve a rank in the akhira as if they did reach such a level of knowledge?
All perfect praise be to Allah, The Lord of the Worlds. I testify that there is none worthy of worship except Allah, and that Muhammad is His slave and Messenger.
It is hoped that for the seeker of knowledge, should death intervene before him and reaching the level of a scholar, Allah Almighty would record his reward and include him among the ranks of scholars. This is because a Muslim is rewarded for his sincere intentions by the grace and generosity of Allah. Whoever is eager to obey Allah and encounters an obstacle, his reward is written for him by Allah's grace. Sheikh al-Islam Ibn Taymiyyah stated in Majmoo’ al-Fatawa:
“If one intends good and does what is within his capacity but is unable to complete it, he will be rewarded as the one who does it.” This aligns with a hadeeth in the Two Saheeh (Authentic) Books, where the Prophet praised those in Medina who were unable to physically join due to valid excuses, saying: “There are some people in Medina who were with you all the time, you did not travel any portion of the journey nor crossed any valley, but they were with you. They (i.e. the people) said, “O Allah's Messenger ! Even though they were in Medina?” He said, “Yes, because they were stopped by a genuine excuse.”.
At-Tirmidhi authenticated the hadeeth of Abu Kabsha Al-Anmari, that the Messenger of Allah said: “The likeness of this nation is that of four people: A man to whom Allah gives wealth and knowledge, so he acts according to his knowledge with regard to his wealth, spending it as it should be spent; a man to whom Allah gives knowledge, but he does not give him wealth, so he says: “If I had been given (wealth) like this one, I would have done what (the first man) did.” He said: “They will be equal in reward.”
Allah knows best.
You can search for fatwa through many choices