Bâcler quelque chose means to do something sloppily, without giving it the required level of attention. In someone else's mouth, it's often a criticism implying shoddy results but the primary meaning is related to the level of effort, not the quality of the result.
To refer to the poor result for an exam, in the high register of speech you would say échouer, and in everyday language you would typically use planter, se planter, rater as in:
J'ai échoué à l'examen
J'ai planté mon bac
Je me suis planté dans la deuxième partie de l'examen
J'ai raté mon permis [driver's license exam]
For the particular case of an entrance exam you can also say être recalé.
To say the opposite, in the high register of speech you would say réussir. Popular antonyms to describe success would be torcher, cartonner, assurer, déchirer.
J'ai torché le bac
J'ai cartonné à l'épreuve orale
J'ai trop bien assuré dans la deuxième partie
J'ai déchiré les maths
These last four terms are slang, but torcher is borderline vulgar: the literal meaning is to wipe one's ass, the image behind this being that of someone blazing through the exam as if were toilet paper.
Some slang terms in use by scientific students:
- majorer for "coming in with the highest score" (J'ai majoré l'épreuve de physique du concours)
- trivialiser for "doing well and making it look easy"
(Thanks Random for déchirer !)