School inspectors have praised "significant progress" in the Glasgow- based Hospital Education Service, which two years ago was found to have a "variable" quality of education and "important weaknesses" in its overall leadership.
Over the past two years, the roll of the service has dropped from 102 to 58, despite now including pre-school education at Yorkhill.
The number of children and young people attending HES who require medical services is decreasing because children are no longer staying in hospital for sustained periods of time, while the number facing mental health and well-being problems is increasing.
The service is run by Glasgow City Council, but serves children from across Scotland, providing education in the Royal Hospital for Sick Children and Stobhill Hospital.
Another factor in the drop in pupil roll is that "other authorities experiencing budget pressures" did not want to make use of the service if their young people were only going to be in hospital for a short time, said the council. One authority had withdrawn from the service but reversed its decision following parental pressure.
Since its initial inspection when it was called the Hospital Education and Home Tuition Service, it has been renamed the Hospital Education Service.
The facilities for children with mental health problems have moved since the initial report - the school at Gartnavel Royal Hospital moved to new accommodation at Skye House in Stobhill Hospital earlier this year, and the Douglas Inch Centre was relocated to Whitehill Secondary and renamed Whitehill Support Centre last year.
Inspectors describe the children as "achieving well" when they are actively involved in their learning and are experiencing a wider range of curriculum than previously.
Children attending the Whitehill Support Centre, which is now managed by the head of Whitehill Secondary, were gaining in confidence, thanks to a caring staff and supportive environment.
"As a result, young people are now deciding to remain at school for another year and others join in activities such as the school football team," said the HMIE follow-through report published last week.
At Stobhill School, young people did not yet have an appropriate set of programmes, but those at Whitehill Support Centre were experiencing "a significant improvement in their curriculum".
The co-ordinator of the service, Maureen Henry, receives praise for her "very clear vision for the future of the service" and her leadership of "important changes which are resulting in improvements for young people".
Despite the service's overall improvement, HMIE says it will continue to engage with Glasgow City Council over aspects of future progress at Stobhill School.