Indeed, dreams are produced by the activities of our brain cells. Sometimes dreams are meaningless, but sometimes dreams are a reflection of our subconscious. This is why many people who study psychology study human dreams.
I'll give you a brief explanation, hoping to help you figure it out.
What do you know about this girl: 1, you like her; 2. You want to be with her; Because of your studies, you suppressed your feelings for her. Right?
Similarly, your subconscious knows this and the reason why you really don't want to be with her-your heart puts her on the opposite side of learning, thinking that with her, there will be no learning, and if you want to study hard, you can't be with her.
But your subconscious also knows clearly how much you want to have both love and school. So, at a certain moment, the subconscious realized your wish-to unify your studies and love.
Your dream teacher, classmates and voting in the class are all story elements that satisfy your love and academic interests.
I hope my explanation can help you understand, hehe.