This isn't prisoner's dilemma. Nor is it leaving "an important piece out". This is a different thought experiment making a different point.

More generally, not all situations where trust and co-operation versus non-co-operation are important questions face the dilemma.

Indeed, mathematically speaking, trying to co-operate to save one guy in the teacher's scenario has strictly worse expected returns than acting in rational self-interest, because it only takes one traitor to doom more than one person.