A headteacher who was filmed as he was punched in the face by a pupil in class has said he considered quitting after the so called "happy slapping" attack.

Alan Williamson, 37, was seen being assaulted by a 15-year-old in a five-second mobile phone video clip.

The attack at Hawick High School - just four months after he started the job - prompted anger from teaching unions and led to calls for a ban on mobile phones in schools.

The headteacher said he thought about leaving the profession after the attack and the video was circulated to other pupils' phones.

A 15-year-old boy has been charged in connection with the incident and has been reported to the children's panel. Police are still looking for the pupil who filmed the attack.

Mr Williamson said he considered quitting his £65,000 a year post after the incident, but decided to go back into work the next day.

The teacher said his first four months in the job had been a challenging time.

He said: "On my first day someone smashed the door when I told him he had been excluded. I never thought I would be assaulted.

"I saw this guy coming towards me and thought You're going to have a go'.

"When I got home I thought £65,000 is not enough to put up with that. But I came in the next day."

Following the attack the EIS called for phones to be switched off and for teachers to confiscate phones and to be allowed to delete images, amid concerns they are being used to bully staff and pupils.

The Scottish Parent Teacher Council also called for pupils to be ordered to keep phones switched off in school.

Mr Williamson said the job had been more testing than he imagined.

In his first few months he has had to suspend a teacher for an alleged assault, discipline a janitor, cover for four deputies and cope with the aftermath of a pupil's death on Boxing Day.

However, he said watching some sixth-year pupils perform at a Burns Supper two days after the alleged assault had lifted his spirits and persuaded him to carry on.

He added: "Seeing them making speeches and playing the fiddle, I thought What a pleasure it is to be head at this school'.

"That is the world of a headteacher and I love every minute of it."

Mr Williamson was chosen to give a talk to aspiring head teachers at a conference in Peebles last week.

He urged would-be heads to develop better listening skills, to build trust and warned them against prejudging situations.

Bill McGregor, of the Headteachers' Association of Scotland, said: "This represents new lows in Scottish schools.

"The first is a pupil feeling he can physically assault a teacher.

"The second is this phenomenon of the use of mobile phones in schools to film and pass the images on. The combination of that we view as extremely serious."

A spokesman for Education Minister Hugh Henry said: "Teachers have the power to confiscate mobile phones which are misused and the minister is saying he expects them to use those powers."

Mr Williamson, a former Hawick High pupil, began his career at the school teaching history and modern studies.

He returned in 2002 as deputy rector before taking over as rector last year.