John Lavigne, a teacher in Brooklyn, has a problem, but it’s a good problem for a teacher to have: He must force his students to leave school at the end of each day.

“They’re here even on weekends and free periods,” said Mr. Lavigne, who teaches technical theater at Edward R. Murrow High School in Midwood. “They’re here all the time. It’s like pulling teeth getting them to go home.”

As a new wave of students drifted into the auditorium, Mr. Lavigne, a small man with a large beard, told them to grab some brushes and start painting the base coat on the newly constructed stage set for “Into the Woods,” one of the high school’s two big annual musicals. The basic set is a library, from within which the play’s fairy tales will unfold when the show has its premiere in mid-December.

In the workroom backstage, three students practiced painting wood grain for the trees that will eventually grow out of the library’s spiral staircase and fireplace. Down the hall in the costume department, freshmen have been busy sewing leaves and vines.