Is your Sim far along into his or her term? For instance are they about to finish and maybe have only 1 or 2 terms left? How high is the skill that is needed for said elective? high, mid-range or at the bottom? I haven't failed an elective yet but then I usually just have them take elective at the very early in their schooling where it is not unusual for Sims to have low to mid-range skill lvl. I do that because when University came out people were complaining about failing and someone mentioned skill lvl and its connection to failing. I usually have each get 2-3 elective each spread over the first 2-3 terms. After that they only take the required courses for their degree.
I am a terrible/wonderful micromanager and I compulsively check their schedule and on their first day at school take note on which building their classes are at. That way if I don't get a notification, which can happen if I cancel out going to school early (they will just be loitering outside the building an hour before class and I am so not down with that.
I added the faster run to university class mod by LittleMissSam to help getting them to class on time and when there, I have them take notes or listen attentively. They finish all homework on time and make sure that all presentations and term papers are of a highest quality before turning in. On a wednesday I do the email lecturers for a performance progress and start studying (via the text book you can buy for each degree) for the troublesome course.