Councils are breaking the law by failing to do enough to provide for the needs of pupils with disabilities and health conditions, says a study for Scotland's Children's Commissioner.

The research found some schools were not making reasonable adjustments to accommodate pupils with long term conditions, such as diabetes and epilepsy, allergies or Attention Deficit Hyper­activity Disorder (ADHD), although the law says they should do so.

Tasks such as helping pupils take medicine were often delegated to junior staff, such as classroom assistants, and local authorities were confused or out of date about their duties under legislation.

The research included Freedom Of Information requests to Scottish councils, focus groups with children, a survey of parents and carers and an online poll of 300 schools across the country.

Pupils with disabilities, those with long term conditions, children affected by allergies and behavioural disorders such as ADHD were among those at risk of missing out, the study concluded.

The report highlights cases of parents forced to withdraw children from cooking classes due to a school's inability to accommodate a nut allergy, a parent forced to give up their job to be able to attend their child's school and supervise use of medication, and a child with diabetes whose schoolbag containing his insulin was regularly locked away from him.

It was found there are considerable variations in policy and practice across councils, and a lack of knowledge of the health care needs of some pupils.

Children's Commissioner Tam Baillie said the investigation had been launched as a result of concerns raised by a small number of families, but he had been shocked by the number of problems uncovered.

He said: "The Scottish Government needs to act on it with some urgency. Our research has revealed education authorities are unclear about their legal duties to children with long term health conditions and there is a great deal of confusion from authority to authority.

"Practice is inconsistent and, in some cases, poor and there is confusion around policy and the law. The result is some children with health conditions are losing out on their education."

The report calls for ministers to produce new guidance for schools to reflect significant legal and policy changes over the last decade, better communications between professionals and families, and between teachers and young people, and more consistency around health care plans for pupils.