In a way it was both but not quite the way you put forward.
The targeting cycle for air strikes is a fairly exact process. The results are more than likely one of the following two situations:
1) a target close to the school was the intended target but there was a technical glitch (mechanical or data entry) that caused the bomb to go "off target;" or
2) the school was the target to be hit but an intelligence failure caused the targeting team to evaluate the school as still being a part of the adjacent base without knowing that it had been turned into a school.
From the material in the press to this point, my guess is that it will turn out to be the latter.