Schools are a place of learning, not childcare.
At the point where that learning is negatively impacted, it is no longer serving its primary function.
This is why schools are closing due to the heat.
If the pupils are not learning, there is no reason for a school to be open.