Teacher: So you see, we now have only three weeks before the biology exams.
Student: That means I will only have three more driving lessons before my driving test.
Teacher: Uhh.
Student: Sorry sir, just a bain-fart.

An incredibly bad(smelling)idea that leaks out of someones head, although these bad ideas can be easily avoided through basic common sense, The term "brain fart" is mostly associated with unavoidable bad ideas that originate from a boss or employer.

Bob's boss looking rather proud leaks out a rather large and foul smelling brain fart by telling Bob "you will have two week work deadlines at the beginning, middle and end of each month".
Bob can easily identify this as a brain fart from the really bad smell and since 2 weeks of time would not exist inbetween the end of one month and the beginning of another.