Ugh... so much stupidity. Okay people, let's clear up some facts please.
First, intelligence.
The IDF knew the GPS position of all UN facilities. The UN gave them to them. The IDF does not have 24/7 live coverage of every square inch of Gaza. If you think that you're a moron.
In all liklihood the Israeli fire was counter-battery fire. Counter-battery fire uses computers to map the ballistic arc of incoming rounds and very accurately identifies the source of the fire, so that counter-fire can be directed immediately against the target. It is highly unlikely that the Israelis firing back at the militants ever had visual contact with their target.
The hits on the school were tactical in nature - an immediate response by a local commander to an immediate threat. This wasn't an airstrike planned days in advance by a team of high-ranking staff.
Even assuming the local commander had any thoughts about the UN facility, it wouldn't surprise me if these sort of strikes are encouraged to teach the UN a lesson.
Let's be absolutely 100% clear on the facts of the matter here, people.
Firstly, independent journalists are reporting that militants were either inside or immediately adjacent to the UN site. This is neither IDF nor Hamas propaganda.
Assuming this is true, several facts are immediately put into place:
1) The placement of the mortar team in or adjacent to the UN compound is a violation of the Laws of International Armed Conflict, and a warcrime.
2) The UN's failure to prevent the placement of mortar teams in or adjacent to their compound is a violation of the Laws of Armed Conflict, and a warcrime. Further, it makes the UN a party to the conflict, and therefore a legitimate target.
3) As confirmed by the UN and by the IDF, Palestinian militants have a history of using UN positions for their attacks. This worsens point 2) substantially.
4) Israel's return fire against incoming fire is a perfectly legitimate and legal military action.
You are all barking up the wrong tree here people. The serious issue and concern here is neither the IDF attack on the school, nor the Hamas use of the school. The far, far, more serious issue here is the UN's failure to prevent use of their position. I cannot overemphasise how serious the UN's breach is in this regard, and I find the media lack of attention on it quite disturbing.