From my master program, I remember one exam that caused the worst (or the weirdest) motivation to study for two reasons.
It was well known that statistically speaking max one person would pass exam during first meeting (it was an oral exam), so I actually didn’t spend to much time before first term.
The general rule during the exam was “anything you say or do will be used against you”, the first slip or wrong term was usually the end of the exam (although you weren’t sometimes told immediately). So knowing already pretty well the content of lecture, including mathematical proofs etc. (if not before first exam, for sure before X one),
instead of exploring topic and have fun, we spent time trying to memorize his exact arguments and words (we actually recorded the lecture). Still think, that this was pretty sad…
How to fix it afterward? Not sure…
How to fix it, in general? I believe, that better selection and/or control of academic lecturer and any(!) training might help.