The most probably explanation is that the tantrum behavior is maintained by: socially mediated escape.
Explanation:
Socially mediated escape is a behavior which explains the unpleasant social situations. Some of the socially mediated behaviors are: sensory stimulation, escape, access to attention and access to tangibles.
In the above scenario, a student was often engaged in tantrum behavior in the classroom while doing homework. The teacher takes him to the office room to calm him down. Both of them return to the classroom after the student calms down. But the student couldn’t complete his homework fully. He was doing this regularly. His tantrum behavior was maintained by socially mediated escape.