The vision was enticing. Create 21st-century schools fit for 21st-century pupils of such a high standard that they couldn't fail to draw creativity and ambition from young people.

As many Victorian and post-war school buildings fell into disrepair, becoming further outmoded as new technology took centre stage for modern learners, the Scottish Executive in 2004 decided a new swathe of school accommodation was needed to take Scotland's pupils into the future.

Their vision was clear: "Schools send a prominent signal to children, young people and the community of the value that we place on education, and of our ambition for the future."

The financial commitment was clear, too. Around £3.9bn had been committed to school renewal by April 2007, a figure due to rise to £5bn by April 2008.

Today Audit Scotland, the body charged with holding public spending to account, reports on whether it was worth it. Its report shows students at almost 1000 schools are still being taught in poor conditions, with just 200 schools in a better state since spending began.

Despite the mass investment, according to the spending watchdog, the reality is that students and teachers in a number of revamped schools examined in the report are working in stuffy, overheated, cramped and badly lit conditions. While teachers and pupils are, overall, happy with their new schools, the environment required for good learning has all too often not been achieved.

Audit Scotland concludes that another £5bn will be needed to meet the commitment set out in 2004 - which will take another 20 years to realise. All children in Scotland won't have access to a 21st-century learning environment until 2030.

With education at the heart of what successive administrations are trying to achieve, the findings of the audit show a mixed picture of how the vision has been executed. While it recognises "many improvements" have been made to schools, it also highlights spending without proper control, flaws within major design projects and a dismal financial hangover for some councils which have relied on private finance for school renewal projects.

What has been achieved?
It has been recognised that many schools have been improved since 2004, with more than 200 brand-new buildings in place by the end of 2007.

Indeed, the government is due to meet its own targets for improving 300 schools by 2009, given its commitment to building brand new schools from scratch - an estimated 219 by 2007.

While it is easy to count the new schools built, it is more difficult to judge how many schools have been improved through renovation work.

The past administration had no clear information on the physical state of Scotland's schools when money was at first being distributed. No firm rules were put in place to define what was needed to be done or how it was to be achieved.

Kingussie High School in Inverness-shire is an example of a school that the former administration counted towards its target because more than £1m was spent on it. However, the audit report stated that most of the school was not refurbished with the money and remains in a "relatively poor" condition.

The report said: "It is very difficult to say exactly how many schools have been improved as a result of the investments by the Scottish Executive and councils because of the lack of clear definitions and targets."

The government has recognised the inconsistencies and is developing a standard methodology for all councils to use when assessing the impact of the proposed improvements.

How much is it costing?
Investment in schools has mushroomed in recent years, with £5bn due to be spent between 2001 and April 2008, but how well the money has been spent is a cloudy issue.

With Private Finance Initiatives being increasingly used to create brand-new schools, where a private conglomerate is contracted to do the work and paid back - with interest and fees - by government and councils, concerns have been raised in the audit that some local authorities will not be financially prepared to honour their PFI commitments.

Around £2.3bn has been spent on school improvements via PFI contracts since 2001, with Scottish councils looking at annual repayment charges of £500m a year come 2012. Less than half of this will be covered by Scottish Government funds, leaving councils under increasing financial strain.

The audit report said: "As the contractually binding PFI charges will have to be paid, maintenance budgets for non-PFI schools may suffer a squeeze with the possibility that the condition of these schools could deteriorate more quickly."

Of 47 new secondary schools built in Scotland since 2001, 44 were financed through PFI.

Management difficulties
Creating schools which meet the needs of the population is made all the more challenging when the country's demographic is shifting all the time. A new school will last 50 years, but, as immigration and house prices affect school populations, the audit has made it clear that school buildings have to be made as flexible as possible.

The audit has recommended that local authorities must estimate demand for school places at least 10 years ahead, with updates every year, but councils also need to be able to respond to unexpected shifts in population which can easily emerge through forces such as immigration and house prices.

In Edinburgh, families have left the city as property prices soar, resulting in a 19% reduction in primary school rolls in five years. The Highlands has seen 700 bi-lingual pupils arrive, largely from Eastern Europe, in two years.

The audit has pointed to the need for better joint working between the government and local authorities. More support is required by councils on school design and information on the strengths and weaknesses of existing PFI projects need to be shared.

The future
Around £5bn has been spent so far on the 21st-century vision for schools with another £5bn needed to meet the challenge. However, brand new bricks and mortar is not the end of the story. "Major challenges" lie ahead, according to the audit report.

"As school buildings age and as educational practices evolve, schools will continue to become unfit for purpose, even if they are adequately maintained and adapted," the audit report said.

The crucial issue is to ensure that a long term maintenance and management plan is effectively worked.

However, the audit report also warned that investment levels will need to rewind to those of the 1990s if the government and councils are to avoid the school estate slipping back to its previous state of decay.

But as the Scottish Government and the council face competing demands for resources, the vision for 21st-century learning environments may become slightly jaded as the authorities battle to "stop the rot" in our nation's schools.

New building will improve morale of staff and pupils
DAMIEN HENDERSON
A thin strip of pre-fabricated concrete and crumbling plaster surrounded by steel mesh fences, Our Lady of Peace Primary scrapes below even the humblest expectations of what a modern school building should provide.

When it rains, water leaks through the ill-designed, worn-out flat roof into buckets placed strategically in the corridors, classrooms and gym below. The plasterwork is cracked and, in places, falling away. A few weeks ago, a huge chunk fell out of the wall separating the girls' changing room from the gym, resulting in it being out of commission.

For Elizabeth Robertson, headteacher at the Barlanark school in the east end of Glasgow, the impact of the building's shortcomings is clear. "For pupils and staff, it's saying to them: You don't matter.' It's taking away their self-esteem and their self-worth."

On May 8, shortly after the old building marks its 50th anniversary, pupils and staff will move into a new, purpose-built campus across the road.

Mrs Robertson is excited by the prospect. Unlike the school's current building, the new campus will be "fit for purpose" for 21st-century needs, she said, reeling off examples such as movable teaching walls, a CCTV system and open-plan classrooms.

After years of falling school rolls for both St Jude's and St John Ogilvie's primary schools, which in 2006 merged to create Our Lady of Peace, the P1 intake for the next year has increased - an indicator of parental confidence, she said.

"If you look at how parents and pupils have responded to other new buildings, it's very encouraging."

One such school widely lauded for its achievements is Keppoch Campus in Possilpark which opened in 2004 to house three primaries - Saracen, St Teresa's and Broomlea special needs school - as well as a nursery and volunteer-run after-school facility.

The shared campus brings together children from non-denominational and Roman Catholic schools. Though each school has retained its autonomy, children play together and eat side by side at lunchtime.

Evelyn Gibson, headteacher of Saracen Primary, said the new campus had been successful not only in breaking down traditional sectarian barriers but in boosting staff and pupil morale.

"Our pupils are very positive about it. Our roll has increased and I'm sure part of that is the fact that parents are attracted to a facility which has state-of-the-art equipment," she said.