Are Student Loans Haram?
Question

I am a Muslim student living in Norway, studying in university there. I have a question about student loans given by the university. This loan is interest-free, and it is given to students, and if the students pass the half-year exam, the loan is turned into a grant or gift from the university, but if they do not pass the exam, it remains as an interest-free loan until the end-of-year exam. But if a student leaves or graduates, or if the loan is not turned into a grant or gift from the university, it becomes a debt, and in these three cases, interest is to be paid on the loan. 
My question is: is it permissible for me to avail myself of this loan? Is it halal? Because I am going to complete my studies this year, and by Allah’s grace I did not fail in any year at all, and it will never happen, by Allah’s leave, in the future. 
Therefore, if I take this loan, it will turn into a grant, in sha Allah, and if I fail in any exam or stop studying, praise be to Allah I have money to pay off this loan immediately. I am not in need of this loan, but because it will turn into a grant after the exam, I want to take it. What is the Islamic ruling on this matter?
Praise be to Allah.Categories of student loans 
With regard to student loans , they must fall into one of three categories:

Where the loan does not involve riba, and the student pays back what he took, without any interest. In this case, it is permissible to take this loan, and there is no problem.
Where the loan involves riba, and the one who takes the loan is required to pay back the loan with interest. In this case, it is not permissible to take this loan, because it is riba.
Where the loan does not involve riba originally, but in some cases it involves a riba-based condition, such as when the student is told: This loan is to be paid back as is, or it is a grant to you if you pass all your exams, but if you give up studying or fail, or you delay repaying the loan beyond the stipulated period, you will have to repay the loan with interest at a specific rate. In this case, it is also not permissible to take that loan, even if the borrower is determined to succeed or is confident that he will not have to pay interest, because this contract involves approving of the riba-based condition , in addition to the possibility of falling into it, if circumstances arise that lead to him not succeeding or not completing his studies.

Based on that, it is not permissible for you to take this loan , because it involves a riba-based condition, and you stated that you do not need that loan. This requires you to refrain from taking this loan.
And Allah knows best.