Daniel Khalife had been misbehaving at school, his trial heard.