The Scottish Qualifications Authority (SQA) has admitted a computing exam contained a number of coding and typographical errors.

The National 5 computing science paper, sat by thousands of pupils in May, was heavily criticised by teachers, who warned there had been a number of problems with questions.

A "small number of typographical errors" were found in the paper, the SQA said.

An official report written by the principal assessor for the subject also found there were also a number of "coding errors" in the exam.

One question contained an error which "did not allow it to be answered as originally designed."

The report also reveals grade boundary adjustments were made to ensure no candidates were advantaged or disadvantaged by the errors.

Education secretary John Swinney wrote to Dr Janet Brown, chief examiner in Scotland, in June to express his concerns.

At the time he told MSPs: "I think, frankly, that is not good enough, these issues should be checked properly, there is adequate opportunity for this to be done and I have made clear my discontent about that to the chief examiner."

The report into the exam has prompted fresh calls from opposition parties for the SQA to ensure exams are "watertight".

Dr Gill Stewart, SQA director of qualifications development, said: "As we do every year, we consider what went well in the most recent diet, and where improvements could be made for the future by SQA and the education system.

"Our course reports, which are provided for all subjects at all levels, also highlight ways in which recent exams and coursework may have differed from those of previous years.

"This is to ensure standards are maintained. We are committed to the continuous development and improvement of our qualifications and assessments for the benefit of all candidates."