The Health and Wellbeing census was organised and promoted by the Scottish government but half of Scotland's 32 councils pulled out following concerns about a lack of informed consent and worries over the anonymity for pupils.
School pupil 'sex survey' data offered to researchers

In the end, 16 councils went ahead: Angus, Clackmannanshire, Dumfries and Galloway, Dundee, East Renfrewshire, Edinburgh, Falkirk, Glasgow, Moray, North Ayrshire, Perth and Kinross, Renfrewshire, Scottish Borders, Shetland, South Ayrshire and Stirling.
The pupils answered the questions online in classrooms and were told on the survey form itself that the information would not be shared.
In a section called "What Happens to My Answers?" it says: "The local authority will not tell anyone your answers, not your teacher or your family."
However, the data is now being offered publicly to external researchers via the website of Research Data Scotland, a charity created by the Scottish government in 2021 with a stated aim of making it easier to access data around health and wellbeing.
The Scottish government did have a section on its website which said that "individual level data may be shared for research purposes".
But many parents claim they were unaware that the answers might be used in this way – especially because the survey and communication about it were handled by individual councils.

At the time of the survey, campaigners warned that it must protect children's right to privacy and give informed consent.
However, consent was done on an "opt-out" basis, meaning parents or pupils had to specifically refuse to take part.
The UK's Information Commissioner's Office has guidelines on consent which say it must be "opt-in".
"There is no such thing as 'opt-out consent'," the guidelines say.
"Failure to opt out is not consent as it does not involve a clear affirmative act."
Many parents said they did not see the letter informing them of the survey and those that did said it did not explain about the detailed questions on sexual history, relationships with parents, mental health and alcohol intake.
The questions that were asked varied for different age groups but those in S4 (ages 14 and 15) were asked about their sexual relationships and contraception.
One question asks: "People have varying degrees of sexual experience. How much, if any, sexual experience have you had?"
The multiple choice answers include "oral sex" and "vaginal or anal sex".
It goes on to ask whether they or the other person used a condom the most recent time they had penetrative sex.
Some parents found out their children took part without their knowledge but when they asked to have their data scrubbed they were told that would not be possible.
