I rarely have those high school dreams... but when I do it's with the crush I had in school. So not really bad dreams at all.
But seriously, homework nightmares are the worse school-related dreams because even when you awake you immediately worry about some hoework you forgot to do twenty-something years a go.
In real life, it's happened to me when I was in 2nd grade.
I forgot to do my homework and the teacher punished me to stand in front of the class for 15 minutes.
It was a traumatic experience, but I never forgot my homework again ever since. Not even once.
I guess the punishment was really effective, but I still hated remembering it.