All schools have to deal with their share of adversity from time to time: disappointing Ofsted reports, troublesome parents, leaky roofs.
But few have ever been forced to cope with the kinds of problems that have hit Headlands School and catapulted it into the national media spotlight in recent years.
Reports that five one-time members of staff at the comprehensive in Bridlington, East Yorkshire, had inappropriate relationships with pupils prompted the kind of publicity from which many schools would never recover.
"School sex charges", "Pupil sex shame", "School sex romps" and, inevitably, "School for scandal", are just a handful of the headlines directed at Headlands.
Only The Ridings in Halifax, once dubbed the worst school in the country, has endured anything comparable in terms of a negative press coverage - and that was forced to close last year.
Today, Christopher Reen, a former Headlands classroom assistant, is due to be sentenced at Hull Crown Court after admitting a sexual relationship with a 15-year-old pupil. He was brought into the school to replace a female member of staff who also faced criminal charges over an inappropriate relationship with a boy.
The case will create yet more bad news for Headlands, but staff at the school are hopeful that Mr Reen's sentencing will draw a line under the school's turbulent recent history.
In truth, significant progress has already been made since the first of the scandals broke in 2006.
The school came out of special measures last October, its pupil intake has begun to recover and there has been a jump in the numbers of students choosing to stay on in the sixth form.
But what went wrong at Headlands in the first place? And how has it begun to fight back?
Executive headteacher Chris Abbott, who was brought in as a trouble-shooter when the school was already mired in difficulty, admits it was a chaotic situation.
"When you first walked in it was tangible that this was a school that had suffered through the publicity and the crisis," she says.
"There was a blame culture - the kids were saying it's the teachers, teachers said the kids. It was negative, and that gets you nowhere. We said we were going to get it right straightaway. We couldn't wait another 12 months. The children were only going to get one shot."
Ms Abbott, who started at Headlands in April 2008, has an almost manic energy. She darts in and out of lessons, speaking in rapid bursts and, most importantly, exuding confidence that the worst of the school's difficulties are behind it.
"With pupils we had to establish very quickly that we would support them," she says. "My main job was to appear very confident the whole time, even if I wasn't."
As executive head, Ms Abbott juggles her responsibilities between Headlands and continuing to lead the high-performing South Hunsley School in North Ferriby, East Yorkshire.
When she started at Headlands she brought one of her deputies, Scott Ratheram, with her and put him in day-to-day charge of the troubled school.
"There was this massive national publicity, staff being accused, followed by a major report into safeguarding and then special measures," says Mr Ratheram. "When you have had a constant battering, your confidence takes a knock.
"But we still have mainly the same staff. The difference is now they collectively believe they can make a difference."
The school was first plunged into difficulty with allegations against Ian Blott, a senior art teacher in his 50s, who was jailed for four years after seducing a 15-year-old pupil. The following year, in 2007, science teacher Steven Edwards was convicted of affairs with three teenage girls.
In 2008, Terry Mann, a former IT teacher in his 40s, was given a suspended sentence following a sexual relationship with a pupil at a different school. He was not teaching at Headlands at the time of the offence, although it emerged that in 2001 he lived with a former Headlands pupil who had left the school two years earlier. Both denied the relationship started before she left school.
Lindsey Collett, a 26-year-old classroom assistant, was given a conditional discharge in 2008 after admitting an inappropriate relationship with a 16-year-old boy.
And then there was Christopher Reen, Ms Collett's replacement.
Inevitably, the relentless stream of cases hit morale at the school. There was a major investigation into its safeguarding policies, following the first three cases, which reported in 2008. It discovered a series of failings and found that the then headteacher had ignored advice from his local authority on how to deal with the issues.
"Decisions at the individual school level demonstrate that practice and management were deficient over a long period of time," the report found. "Concerns about staff were seen as neither allegations nor potential child protection referrals."
Staff had failed to identify potential dangers and "robustly challenge the individuals concerned", which contributed significantly to students being put at risk of harm, it said.
Despite the lax attitude to child safety, there was no evidence of collusion between the men convicted of improper relationships.
The 31-year-old Mr Reen started at Headlands after the failings had been published and its procedures tightened up. He had an enhanced CRB (Criminal Records Bureau) check and had gone through an induction on child protection issues.
"One worrying thing the major inquiry said was that the school might attract people because of its reputation," says Ms Abbott.
"You have to have everything in place to filter those people out, but there might still be people who get through. The key is that everyone in the school community is looking out for each other.
"A whistle-blowing culture has emerged and problems are dealt with immediately. That didn't exist before. The speed with which we dealt with that case was drastically different to previous times.
"I came into school wondering if our progress was going to go backwards, if it was going to be volatile, if the staff and kids were going to lose confidence.
"But the first day after it happened, I knew it had not even caused a blip. Pupils said they weren't happy, but there wasn't any anger against the school."
Improvements at the school in terms of its safeguarding were recognised by Ofsted, when it took the school out of a 20-month stint in special measures last October.
"The school takes students' well-being very seriously," inspectors noted. "Procedures for child protection are robust, reviewed regularly and meet all requirements. The arrangements for safeguarding students are strong features of the school's work."
The inspectors praised other work being done around the school to improve teaching and lesson quality.
Behaviour is also improving. In the past two years, the number of incidents forcing pupils to be removed from lessons each week has fallen from 300 to 25.
When the news that the school had been removed from special measures reverberated around the corridors, staff and pupils cheered with delight. Some, including Helen Nind, the head of sixth form, even cried.
"The whole experience with the scandals was dispiriting," she says. "I never felt I did not want to go to work, but there was a resentment of those people who had put us in that position.
"When we came out of special measures it was such a feeling of relief and I just wanted to jump up and down and scream."
With special measures gone and the last of the court cases about to be dealt with, there is a tangible sense of optimism in the school.
Considering what it has been through, however, attention will always be paid to ensure that safeguarding standards remain at their now high level. Those involved with the school know what a damaging experience it has been through. With hard work bringing a restoration of confidence and standards, no one will want to put that at risk again.
"The press we got with Chris Reen is what happens when you get your safeguarding right," says Ms Abbott. "Imagine what would happen if we got it wrong."
Five offenders brought to justice
Ian Blott: art teacher in his 50s jailed for four years in 2006 after seducing a 15-year-old pupil.
Steven Edwards: 35-year-old science teacher, sentenced to four years for affairs with three teenage girls.
Terry Mann: former Headlands teacher in his 40s given a 12-month suspended sentence for having a sexual relationship with a pupil while teaching at Withernsea High.
Lindsey Collett: 26-year-old classroom assistant given a conditional discharge after admitting an inappropriate relationship with a 16-year-old boy.
Christopher Reen: the 31-year-old classroom assistant is due to be sentenced today after admitting an affair with a pupil from Headlands.
'The one with paedos'
Headlands' reputation had serious consequences for pupils.
"There were comments all the time," remembers Minela Huremovic, head girl. "We went to a netball tournament once and when other players found out we were at Headlands they would say: 'Oh, the one with all the paedophiles.'"
Other pupils would take off their sweatshirts when they went into town so people would not know which school they attended.
Staff were also aware that pupils were "copping flak" in and around the town, according to acting head Scott Ratheram.
David Turner, the head boy, says: "Everyone got labelled, although I think it affected the image of the school more than individual people. Since coming out of special measures, everyone is feeling more positive; we want the school to do well."
The increase in pupil confidence is reflected in 70 more students choosing to stay on in the sixth-form last September compared with the previous year.