1. “Randomly” suggests that the teacher’s eyes were closed or that the teacher otherwise did not pay any attention at all. If you are trying to say that the teacher did a rushed, careless, or sloppy job, you could say the teacher marked my exam carelessly, hastily, sloppily, or “in a half-assed way.” 2. “I just dashed off the three essays” is a good way to say you wrote them quickly.