The character has to study but his/her imagination doesn’t want to, and therefore it tries to distract him/her. The text between is the voice of imagination, which tries to take the lead in the character’s mind and gives him/her hints that will eventually bring the protagonist to daydream about something that didn’t really happen.