It is 9am on Friday, and a final year Spanish class at the Harris Girls’ Academy secondary school in Bromley, south-east London, is taking place on Microsoft Teams.

In homes scattered around south London, the class follows a power point presentation, answering questions on instant messenger. Although they can only hear their teacher, Rebecca Hitchings, the lesson goes smoothly.

When UK prime minister Boris Johnson closed all schools in England on Monday evening in an attempt to contain the rapid spread of coronavirus, teachers had barely 12 hours’ notice to completely rewrite their plans for the term. Instead of the normal school timetable the government had insisted would go ahead, pupils suddenly found themselves facing at least five weeks of online learning, and cancelled exams.

Fortunately most schools were better prepared than when they faced similar circumstances last March. For the last nine months they have been training staff in online teaching, bulk-buying laptops for children and learning how to support pupils at home.

“We’ve learnt a huge amount between March and now,” said Samuel Rigby, headteacher at Harris Girls’ Academy. “My staff are extremely experienced now in teaching online, tracking children’s learning, and knowing what’s going on with their pupils. We’re really confident that we know what we’re doing.”

Still, he acknowledged it had not been a simple process.

Teaching unions have warned for months that more remote learning would be necessary, but until its abrupt U-turn, the government had insisted schools should remain open. Instead of planning online classes, secondary school staff spent their Christmas holidays setting up a mass testing system to enable children to return to school, which is now being used only for teachers and children of key workers and vulnerable pupils, who will attend in person.

Outlining the new plans, education secretary Gavin Williamson said the “outlook for schools, parents and young people is far more positive” than last year. But the flip-flop has left schools scrambling, not least to find technology for more disadvantaged pupils.

Last Wednesday Mr Williamson said the government had “significantly stepped up” digital support, delivering 560,000 of 1m promised laptops to schools and colleges since last spring and would deliver a further 100,000 this week.

The scheme has been plagued by delays and many schools’ allocation has fallen far short of their requirements. In Ms Hitchings’ Spanish class, she said, several students were attending lessons on their phones.

“It’s just intensely frustrating,” said Rachel Purvis, headteacher of William Rhodes primary school in Chesterfield. She has not yet received any government laptops, and has now been told they are only available for secondary schools.

The government on Friday said that the “vast majority of devices” would be delivered by Easter. Some of Ms Purvis’ pupils will only be able to learn online because the school bought its own laptops in March, spending £10,000 that had been reserved for building maintenance. “We wouldn’t have anything if it weren’t for our forward planning,” she said.

Birchfields primary school in Manchester has received its full allocation of 70 laptops for 700 pupils, although headteacher Samantha Offord said this was still insufficient. She is now working to fix internet access for pupils through Vodafone, one of several companies working with the government to offer data to disadvantaged pupils.

She is cautiously optimistic about the programme. Other headteachers, burnt by earlier broken government promises on technology and wary of the scale of technological poverty, are less confident. At Birchfields, most lessons are pre-recorded or include learning packs with worksheets, because it would be impossible to run a full programme of live lessons for children who are sharing devices with several siblings in overcrowded homes.

Many teachers must also now balance online teaching with supporting a larger number of children in school than in the spring lockdown. Government guidance specifies that families with only one key worker parent can send their children to school, and confused messaging in the last week has urged parents to keep children home if they can while forbidding schools from restricting numbers.

According to education survey tool Teacher Tapp, one in three primary schools had at least 20 per cent of pupils in school last Wednesday, compared with one in 100 during the last lockdown.

Simon Kidwell, branch secretary of the National Association of Head Teachers in Cheshire, said some primary schools were running at 70 per cent attendance, although his school was on a more manageable 25 per cent. “At some schools we’re getting quite an excessive demand for key worker places,” he said. “The public health message is clearly not getting through.”

At Birchfields, attendance is now about one-third of normal, which Ms Offord said balanced safety with supporting children in need.

Health secretary Matt Hancock on Sunday said schools would only reopen when the vaccine programme was running effectively, deaths falling, there were no dangerous new virus mutations and the NHS was not overwhelmed. He said the conditions might be met by mid-February but that was not guaranteed.

Mr Rigby, at Harris Girls’ Academy, said he was concerned about how children would manage for even four weeks of remote learning, especially as GCSE and A-level exams have been cancelled and replaced by teacher assessment. “It’s a long time to do virtual lessons,” he said.

Exam year students, like those in Ms Hitchings’ class, have been told their teachers will grade them based on their work up until the summer. “I know my staff will deliver really high-quality lessons, and they will improve, but it depends on pupils staying motivated,” Mr Rigby said.