Why are you so afraid of getting a "B"?
The reason I am asking is because it sounds like you are close to having a meltdown on this which can cloud your thinking on the situation.
This is something I delt with in college and I understand it can be really scary. I had similar panic attacks.
Here is something that helped me:
To help calm your mind here is some perspective about the reality of you "getting a B".
The average grade in college is a C. You get an average of A's which means you are already a remarkable student based that alone.
The B grade would mean that you are an above average student which means you are still be marked above the curve in terms of grades.
The grading system in education is also very flawed and subjective. It has many factors that making it so in one class it's easy to get an A. In others most barely get a "D grade."
A "B grade" in one class is an "A grade" in another class. It's about comparison to other students and the teacher.
Overall, a "B grade" is a pretty safe grade to get. It shows you are an above average student and passing the class.
Passing the class the point.
You take classes in college to get credit to graduate and get a degree.
You could get a "C" and still pass.
That means that even are not a perfect student:
You are doing a great job and are a good student passing your classes.
You have already know your teacher is not being a good teacher which means that whatever grade you get is a reflection of him as a teacher rather than you as a student. It's the grade you got dispite your teacher's bad teaching.
You are not a bad student.
I hoped this helps calm your mind a little.