Wow,
Sorry to hear that you had to go through such a traumatic event.
As pretty much as everyone else has said above me, it was not right for your teacher to take advantage of you in this way. It is completely wrong for him to bribe you into sex for better grades.
It is good to know that you have reached out for help and advice with this matter because it is something that you shouldn't have to go through alone.
As everyone else above has said, although it might be really difficult to do and talk about, you should report this man because otherwise there'll be other young girls he will take advantage of in the future, who might have to go through the same thing as you. Which I imagine is not very nice at all.
Secondly, you should tell someone you trust about this, preferably a parent or your boyfriend, I'm sure that they will understand that you were taken advantage of- even your boyfriend. You need support from people you love at a time like this.
Thirdly, you will have to think about your options with the baby- there are loads of family planning places with friendly people who could give you advice about this or a nurse/ doctor?
Hope things sort out eventually- things will get better. Im so sorry you had to go through this again.
PM me whenever