What the teacher was doing here,of course,was positioning students as flirtations/sexually suggestive, a discourse entirely inappropriate to the classroom.
And because the positioning was so incongruous,its humorous impact was particularly strong; it was indeed a carnivalesque moment.