The 14-year-old, from Perth, was walking home when he was allegedly attacked by another student.