The persistence of these stock depictions of educators speaks to a widespread anxiety about what schools can or should accomplish, as well as “our cultural confusion about teachers,” said Robert Bulman, a professor of sociology at St. Mary’s College of California and the author of “Hollywood Goes to High School: Cinema, Schools and American Culture.”

“On the one hand, we expect them to be competent and heroic, and after all, our children are in their hands for a big part of the day, so it makes sense that we would like them to be heroic,” Mr. Bulman said. “On the other hand, there is a certain cultural belief that teachers are poorly trained and apathetic, and they are the scapegoat for any crisis that exists in the public school system. We tend to assume that teachers are to blame, so we often get representations of these buffoonish characters.”

In a review of films going back to “Blackboard Jungle” in the 1950s, Mr. Bulman found that stereotypes of teachers have remained remarkably consistent. What’s more, he said, the portrayals correspond roughly to the economic class and race of the students in the movies. In middle- or upper-middle-income suburban settings, educators are likely to appear as lazy fools, petty tyrants or, at best, genial sidekicks offering an occasional word of wisdom (think Paul Gleason in “Breakfast Club,” Jane Lynch in “Glee” or Ken Jeong in “The Duff”).

Yet when fictional classrooms are filled with lower-income minority children, the teachers tend to be superheroes who triumph over poverty and racism by sheer force of personality and perseverance. If pedagogy has anything to do with it, these teachers come off as renegades who deploy tactics never before tried by their colleagues. (Cue “Freedom Writers,” “Dangerous Minds” and “Stand and Deliver.”)

Such archetypes tap into fierce debates in education today. Efforts to overturn public school job protections like tenure, for example, stem from the argument that ineffective teachers can stay in classrooms indefinitely. And policies tethering teacher evaluations to student test scores are based on studies that link high-performing teachers to long-term improvements in the lives of students, particularly the most disadvantaged.