Having a dislike of maths and a preference for English may not be a surprising statement for an 11-year-old girl to make, but in Eve’s case, it’s not entirely true.

Eve has just spent the last half hour demonstrating the most impressive enthusiasm and skill for the subject she claims not to like by studiously inputting a complicated-looking programming code into a computer in order to control the intricate actions of a robot built from scratch from bits of Lego.

Meanwhile, other members of the P7 Lego Team from Towerbank Primary in Portobello, Edinburgh, are debating why the Lego robot is not doing as it is told – or, to put it more technically, why it is not following the orders created by the programmers.

Has the computer not recognised the latest command? Have they inputted the coding incorrectly? Have they not placed the robot in the right starting position to allow it to follow the instructions properly?

These are all options the pupils need to investigate if they want to have a chance of winning the First Lego League competition which, every year, sets a series of challenges – called missions – for children aged between nine and 16 to build and then run from start to finish using the home-built robot.

“Does it need weighed down at the back?” one of the team shouts out.

A collective outpouring of agreement and excitement fills the makeshift Lego command room in the Victorian primary school building.

The builders set about the business of finding the correct pieces of Lego which will allow them to add a bumper onto the structure of the robot. The children explain that the next time they order it to scoot across the giant wooden board, to a mission which requires the robot to push a pointer from left to right along a colour-coded dial, the bumper will give it the physical capability to do so.

The programmers run back to the computer where the screen is showing a series of numbers, colours and commands to double and then triple check their part in fine-tuning this mission.

And when all is set, the team gathers round the board with a sense of nervous anticipation as the robot is placed carefully at the starting point, then released.

It travels, unaided, to its first port of call, guided by a previously designed programme. It senses obstacles and, rather impressively, avoids crashing into them then carries out the first mission without incident.

Then it reverses and moves onto the problematic mission, which the children brace themselves for.

“It needs to push the pointer along so that it stops in either the white or the orange part because that’s where you get the most points,” the team explains.

As the children wait with bated breath, they watch as the mission fails: the robot does not move the pointer into the white or orange part of the dial.

But the children are not despondent. In fact, they are happy because although the robot did not push the dial far enough, it did push it slightly, meaning that the idea of adding a bumper to the robot was actually the fix it needed.

The team is filled with a renewed energy and once again they set about their various jobs, discussing the angle the robot needs to hit the pointer at and debating the merits of increasing the numbers on the computer programme to either 1.7 or 1.9 in order to push the dial back further.

While it might sound like gobbledygook to an outsider, the children know exactly what they are talking about.

The team has been working together on the Lego project, coming up with solutions to difficult problems in science, technology, engineering and maths – subjects which are collectively referred to as STEM – since September.

But because they are having so much fun while doing so, many of the pupils are unaware that they are actually involved in an incredibly complex science project.

“This is giving them the full STEM curriculum but I don’t want to be constantly saying to them, ‘look, you’re learning maths and science and engineering and technology,’” explains Towerbank’s headteacher Alasdair Friend, who leads the Lego Team. “A project like this is hugely challenging but it’s also fun. They’re giving up every single lunchtime because they’re inspired by it. As soon as they start getting a mission that works, there’s a sense of achievement which makes them even more determined.

“Some of the children prefer to be doing this every lunchtime than playing outside with their friends.”

Lego fanatic Duncan Mulligan, 11, is one of the team’s builders, and helped to solve the bumper problem.

“This project is about getting us to think about science and how things work,” he explains.

“We didn’t know anything about what the missions were until Mr Friend got this big box of Lego and we used the pieces to build the challenges. It was quite exciting.

“The best thing about it is being able to build Lego as part of school.

“Sometimes we get really tricky problems but it’s amazing when we are able to fix them.

“Last year Towerbank got second place and got the best newcomer award so we have to keep the standards up.”

The First Lego League competition – which this year has a space theme – is just one way in which schools are trying to think outside the box in order to inspire children from an early age when it comes to STEM subjects.

Adopting more hands-on, experimental and fun ways of learning STEM subjects makes it more accessible to all children, including girls, who traditionally have been less likely to pursue STEM subjects at secondary-school level and beyond.

Friend says: “Teaching STEM subjects from an early age is really critical. But it has to be done in a way that’s both meaningful and fun. However, at the same time, in order for them to be able to do what they’re doing, they do need the basic skills that they learn in the classroom.

“What’s really good is there are more girls this year than boys. It’s a very inclusive project. And, actually, part of the trouble with it is that the level of interest is so high that I can’t accommodate all the children who want to take part.”

That seems like a particularly good problem to have, especially with such a massive national drive to promote STEM subjects in schools in response to a general sense of malaise amongst both those giving the lessons and those receiving them.

The Scottish Government launched its STEM Education and Training Strategy a year ago, with the aim of ‘building Scotland’s capacity to deliver excellent STEM learning and to close equity gaps in participation and attainment’.

As part of the strategy, teachers are being given extra support and training to help them teach the subjects in a more relevant and engaging way. Education Scotland is recruiting a team of STEM specialist advisers to support learning and teaching in the three to 18 curriculum and raise attainment. And a bursary scheme has been created offering up to £20,000 to entice people to teach certain STEM subjects, including computing and physics, in a bid to redress the teacher shortage in the subject areas which has left some schools resorting to asking parents to help teach their own children.

According to the Scottish Government, there are now more primary and secondary teachers than at any time since 2014 and a campaign – Teaching Makes People – is specifically focused on STEM subjects and other hard-to-fill subjects.

Ultimately, the strategy aims to inspire young people to study STEM subjects and consider careers in the field.

Going by exam results alone, significant improvements have already been made. Entries and passes at Advanced Higher level in the STEM subjects have increased since last year, while there were 10.4 per cent more passes in the full range of STEM Higher qualifications in 2018 than in 2007.

Perhaps most significantly, between 2007 and 2018, the numbers of passes by girls in the STEM Higher qualifications were up by 13.8 per cent.

“If you look at some of the key economic sectors in Scotland, they’ve all got a very strong connection to STEM,” explains Ian Menzies, Education Scotland’s Senior Education Officer for STEM. “They include life sciences which is a big part of our economy, energy, food and drink – people often forget there’s a very strong science and technology focus with the food and drink industry – creative industry, digital media, financial sector, universities, tourism… so there’s a really strong focus on STEM and this underlines the importance to a national economy.

“We have a three to 18 curriculum which is a really big strength and we really want to make sure that we are doing this from the youngest age, even before three, so that young people are engaging with science.

“We know from research that people are quite often making choices about their careers when they’re still at primary school so that underlines the importance of that early engagement.”

The Scottish Government is supporting a three-year £1m fund to boost primary science learning, in partnership with the Wood Foundation, Education Scotland and local authorities.

“We’ve done quite a big piece of research this year around raising aspirations in science education programmes supported by the Wood Foundation,” Menzies continues. “What it actually showed is 88 per cent of pupils we surveyed enjoyed science in primary school and for P5-P7, 86 per cent said they understood the importance of studying science in school.

“It showed science was the third most popular subject in primary school so that shows that we’re still maintaining that enthusiasm throughout primary school. We have to make sure that we’ve got that effective and smooth progression in learning all the way through that STEM pathway for learners, building on that prior learning and maintain that enthusiasm.”

The Young People in Scotland Survey 2017 asked school pupils aged between 11 and 18 about the choices they made regarding STEM subjects.

Overall, there were no differences in the number of girls and boys reporting that they had chosen or were intending to study STEM, however, girls were more likely than boys to report that they had not chosen or were not intending to choose a STEM subject.

And, according to the research, girls and boys differed slightly in their reasons for not choosing or not intending to choose to study STEM.

Interestingly, girls were significantly more likely than boys – 40 per cent compared with 17 per cent – to say that they didn’t think they were very good at STEM subjects. More girls than boys – 40 per cent vs 32 per cent – also said they didn’t enjoy STEM and that it wasn’t important for what they wanted to study in the future.

“Gender stereotypes is one of the things we are really focused on,” Menzies says. “When you look at the data over the last 30 years since 1985, we saw the percentage of boys and girls, the gender balance, across STEM subjects hadn’t really changed. What we’d normally see is about 70 per cent of Higher physics classes being male, for technology subjects, it could be 95 per cent, but for biology, conversely, it’s 36 per cent boys.

“So when we looked back over 30 years and realised things haven’t really changed in that time, we entered into a partnership with Skills Development Scotland and with the Institute of Physics and looked in depth at the research.”

Back at Towerbank Primary, gender stereotypes don’t appear to be an issue, with girls making up the majority of the extra-curricular Lego Team.

“I thought it was really interesting when the P7s were doing it last year,” explains Eve, one of the team’s programmers and the girl who claims to dislike maths. “I wasn’t really interested in building because Lego wasn’t really my kind of thing but I thought the programming was interesting so that’s what I do.

“Both my best friends are there with me and I have made friends with some people from other classes and we all work well together so I really enjoy it.

“Because of this, I’ve done more science and maths than I ever would have. It’s extremely satisfying seeing it work. I think science can be quite difficult to get the hang of. There’s not really a spectrum, it’s either easy or hard, but this is almost a perfect middle ground.”

In December, the team will take their Lego robot and their missions to the regional competition at Edinburgh College and watch the culmination of several months of hard work – hopefully – pay off.

“The element of competition is quite motivating for them, but to me, actually, it’s the problem solving and way they work together and the exploration of the skills they have learnt, which are incredibly complex, that are the biggest motivating factors,” says Friend.

“Ultimately, the design of this – as well as it being fun – is about getting children to push beyond their abilities. Sometimes even I’m at the edge of my knowledge.

“They are having to deal with disappointment when things don’t work the way they wanted them to or expected them to. But they are finding out why things didn’t work out, and they are coming up with solutions.

“As part of being involved in the project, I also expect them to talk about it at assemblies and promote what they are doing, so they are learning so much more than the STEM subjects.

“I’m proud that our school can offer this as an activity.”

Just then, one of the team members rushes up to her headteacher, smiling from ear to ear.

“I just wanted to let you know that we got the pointer on to the orange,” she says, beaming with pride. “We did it.”