I think it'd be highly unlikely that your body allows you to fall genuinely asleep (for a full cycle!) in class. Especially if it wasn't your first class, but you didn't specify. This was most likely a bit of hypnogogia.

You need to wake yourself up a bit more to write more. When you wake up, remember some of your dream, and then stand up (or get water, or turn on a light. . . Whatever works best for you.) and write down the rest.