Every teacher, vice principal and principal in the public schools shall have the right to exercise the same authority as to conduct and behavior over the pupils attending his school, during the time they are in attendance, including the time required in going to and from their homes, as the parents, guardians or persons in parental relation to such pupils may exercise over them.
24 P.S. § 13-1317