Alexander Mortimer, 28, filmed and photographed the abuse of the boys and had 17,967 indecent images and 582 videos of children on his computer.
Images found on his laptop and hard drive device ranged from level one “erotic” images to level five, which can include sadism.
Mortimer, who worked at a childcare facility in Lanarkshire, told police he had researched child abuse for his college course when his home was searched by officers.
But in May he admitted a total of five charges relating to the sexual assault of the boys, taking indecent photographs of children and of possessing indecent photos between January 2009 and January this year.
At the High Court in Edinburgh yesterday, judge Lady Stacey imposed an extended sentence on Mortimer, meaning he will be supervised for a further seven years on his release from jail. She said the images on his computer were “vile”.
She said Mortimer, of Rutherglen, South Lanarkshire, was “clearly a danger to children” and placed him on the sex offenders register.
Some of the offences took place in the toilets of an Asda supermarket as well as at an amusement park. One of the boys was deemed too young to give a statement to police.
Advocate depute Alison Di Rollo, who is deputy head of the National Sexual Crimes Unit, earlier said Mortimer’s conduct had been “premeditated and escalating”.
Defence QC Brian McConnachie said Mortimer had shown he can become addicted to things he finds on the internet.
He said Mortimer had a problem with online gambling and at one point won £50,000 but later gambled it all away. Mortimer had co-operated with the police by providing computer passwords.