IN 2015, Nicola Sturgeon said she wanted her performance as First Minister to be judged on her success at closing the attainment gap between pupils in poorer areas and the well off. Well, she had her chance last week in the Fantasy Highers League. I mean a 20% improvement in the performance of Scotland's more deprived schools in one year. What's not to like?

Well, quite a lot, actually. Exams having been cancelled, thanks to the pandemic, Scottish school teachers were given the delicate task of imagining what their charges might have achieved had the tests taken place. Teachers in some of the most deprived areas gave what could only be called optimistic estimates of their students' likely attainment in the Highers – about 20% higher than in previous years.

The Scottish Qualifications Authority, SQA, which is supposed to ensure fair play in assessment, took one look at this unprecedented grade inflation and said: You're not on. Schools were estimating examination success wildly out of step with their own recent performance.

READ MORE: Iain Macwhirter: Here's how a New Union could keep us living apart together

So the SQA moderators took an axe to the results to make them look a bit more credible. The results in the poorer postcodes went down by 15%, which still left grades inflated over previous years. In the more affluent schools, where estimated grades were around 10% above par, they adjusted scores by 6%.

Thats an oversimplification, but in a sense it doesn't matter. What it looked like was the SQA brutally crushing the hopes and dreams of poor students while only marginally reducing the scores of pupils in the posher colleges.

Assessment by algorithm is always going to be a poor fit with reality. So, Shaun did well in his prelims, but he might have coasted the rest of the year; whereas Siobhan got such a shock that she worked her derriere off for the next six months. Why are they both being cut down?

I mean, aren't teachers themselves the best judge of performance? Why didn't the SQA just suck it up, accept that this was an exceptional year and that Covid 19 engendered a study revolution in less advantaged neighbourhoods.

READ MORE: Iain Macwhirter: Sturgeon should bring Salmond in from the cold – he’s just too dangerous

That's what the educational experts on Twitter argued, including the outspoken educational pundit, James McEnany. They complained that most of the 125,000 pupils who had their futures stolen were from working class neighbourhoods and that this confirmed education is biased to the rich.

The consultant, Sir Keir Bloomer, who helped devise the Curriculum for Excellence, disagreed insisting that the adjustment process was “justified and necessary”. And the First Minister agreed. She said bluntly that the estimates submitted by teachers were simply “not credible”. Accepting grade inflation on that scale would bring the entire standardised assessment into disrepute.

This was Nicola Sturgeon trying to be wise before the event. Sure, the estimates were doing wonders for the attainment gap. She could've gone into the May Holyrood elections saying that she had delivered the greatest narrowing of the educational class gap in history. But the First Minister is much too canny.

Students who narrowly failed last year would be furious for a start. The very people now berating her for crushing the hopes and dreams of the less well off would be attacking her for undermining the credibility of Scottish education. Ms Sturgeon would have been accused of closing the attainment gap by fraud.

The More or Less programme on BBC Radio would be calling it the most shocking misuse of statistics since the UK government claimed that it was conducting 100,000 Covid 19 tests a day, when all it was doing was sending out kits.

But the “classist” accusations won't go away. A hundred or so young people gathered in George Square holding banners saying “Trust our Teachers” and “I am not my postcode”. Sturgeon is being called the “grade snatcher”, echoing the claim that Mrs Thatcher was the “milk snatcher.

Part of the problem is that the SQA seems incapable of giving a coherent and convincing explanation of its methodology. Tens of thousands of appeals are expected against what parents regard as an arbitrary and unfair process that took no account of real pupil attainment.

The Deputy First Minister, John Swinney, is in for a torrid time. Indeed, he has been having a torrid time for as long as I can remember. There has been persistent grumbling about the Curriculum for Excellence which seems anything but. The PISA international performance scores have gone south. Standardised testing of primary one children led to accusations of child abuse. Progress on the attainment gap has been glacially slow.

Mr Swinney held out against the teachers' 10% pay demand just long enough for teachers to threaten a strike, at which point he gave in and awarded them an eye-popping 13.5% over three years. Nice work.

Last month, parents across Scotland revolted at pandemic plans to give children as little as one day a week of “blended learning”. That forced an embarrassing U-turn as Mr Swinney promised full-time, full-fat education from this month onwards.

READ MORE: Iain Macwhirter: Does Nicola Sturgeon still want independence? Some in the SNP aren't so sure

But the Educational Institute for Scotland says that only a fifth of their members are confident it’s safe to reopen the schools. It's still not clear what is going to happen this week. Will teachers turn up? Will parents send their children?

We appear to be seeing, if not the second wave of Covid, then the long tail of the first wave. Lockdown is in the air again. It's conceivable that children could return to school just long enough to exchange infections before being sent home again.

It's not Mr Swinney's fault of course. This is a pandemic after all. Teachers unions have the Scottish Government over a barrel – and they know it. Parents are incensed as only parents can be when they feel their offspring are being treated unfairly.

But it might be time to put poor John Swinney out of his misery. The Deputy First Minister has been a sterling defender of the First Minister, the ultimate safe pair of hands. But those hands aren't looking so safe any more. He is beginning to look like a work horse that has taken more beating than it can stand.

A fresh face, if such a thing exists in the 13 year old Scottish Government, in charge of the education brief might help get the government over this hurdle. In the last SQA exams crisis in 2000 the then Labour education minister, Sam Galbraith, had to step down after being mauled by, er, one Nicola Sturgeon.

The SNP is streets ahead in the polls and that is unlikely to change any time soon, given the dire state of the opposition parties in Scotland. But there are a lot more parents in Scotland than there are teachers. It would only take a few thousand parental votes to go astray in May to deprive Nicola Sturgeon of that absolute majority she needs for an independence referendum.

This is a full scale crisis, possibly Nicola Sturgeon's worst yet. Young people are up in arms. The teaching profession is in a state of perennial discontent. The very credibility of standardised assessment may be in doubt. She will have to get a grip or face an unmoderated “fail” in May.

Our columns are a platform for writers to express their opinions. They do not necessarily represent the views of The Herald.