An unprecedented report has revealed how many prison inmates are being educated at a level comparable with further education colleges.
"A little moment of history" was how chief inspector of prisons Andrew McLellan described this week's report by his body and HMIE - the first time the two Scottish inspectorates have jointly published a report.
It shows that imaginative, demanding and accredited courses are helping prisoners learn about a wide range of topics, including beauty, parenting, literature, fitness training and catering.
The report finds that, although some prisoners' lives had been "positively transformed", there was a wide range in the quality of education provided.
Mr McLellan said education in prison "contributes greatly to reducing re-offending and making Scotland safer".
But the report only assessed 22 projects in 10 of Scotland's 16 prisons and young offenders' institutions, all of which were nominated by the prisons themselves.
"I hope this is an encouragement to other Scottish prisons to think about how they will improve the learning opportunities for prisoners," Mr McLellan said.
He was wary of painting too positive a picture and emphasised that it was profoundly "sad people" who made up prison populations.
"How to motivate sad people is the immense challenge faced by prison educators," he added.
The report finds several barriers to success, including: the low status accorded to education by prisons; projects being too dependent on one member of staff; poor record-keeping; and transfer of prisoners to other establishments with no equivalent courses.
The TESS, however, spoke to female prisoners training in beauty and hairdressing at Cornton Vale prison, near Stirling, for whom education had had a profound impact.
One 39-year-old former heroin addict waived her right to parole and probable release last month, instead choosing to stay in prison until February so she could finish two years of study that would lead to an HNC in hairdressing and barbering.
Justice Minister Kenny MacAskill, speaking at the launch of the report, said it showed how, rather than "containing and corralling" offenders, education could help "break the cycle of crime that scars so much of Scotland".
Cornton Vale governor Ian Gunn said education provided in prisons had to match the quality of equivalent qualifications at establishments such as further education colleges, as ex-prisoners often had a hard time proving their credibility as employees.
But he noted that former prisoners also had to overcome the stigma of a criminal conviction. He cited occasions where prisoners had had placements in communities, only for a tabloid newspaper to write sensationalist stories which made the employers withdraw for fear of bad publicity.
Mike Ewart, chief executive of the Scottish Prison Service, said most of what had been presumed about the working of the brain had proved false, apart from two things: that humans are best able to learn foreign languages between the ages of three and seven, and that "punishment on its own never changes behaviour".
He added: "The key to changing behaviour is encouragement."