Beijing shifted more classes online Thursday in a further tightening of COVID-19 restrictions, as China’s capital seeks to prevent a wider outbreak.

The city of 21 million has already ordered three rounds of mass testing this week for the virus, with the third due to take place on Friday, and closed down some communities where cases were found.

Also read: Nearly 80% of EU’s population estimated to have been infected with COVID-19: Report

On Thursday, it moved most students in the sprawling Chaoyang district to online learning, with exceptions for middle and high school students who are preparing to take crucial exams that could determine their academic futures.

Beijing announced 50 new cases on Thursday, two of them asymptomatic, bringing its total in the latest wave of infections to around 150. Students make up more than 30% of total cases, with clusters linked to six schools and two kindergartens in Chaoyang.

Also read: COVID-19 ‘pandemic phase’ over for the US: Dr Anthony Fauci

At least three other districts had already moved students online, and officials on Thursday announced rules requiring residents to remain inside two housing compounds in Chaoyang where cases have been detected.

Beijing has moved more swiftly than many Chinese cities to impose restrictions while case numbers remain low and the scale of the outbreak is still manageable.

The goal is to avoid the sort of sweeping measures imposed on Shanghai, where the highly transmissible omicron variant has torn through the city of 25 million. Restrictions confining many Shanghai residents to their homes are now in their fourth week and all schools have been online since last month.

Also read: China’s space agency aims to track, attack asteroids heading towards Earth: Report

The strict measures have spurred anger and frustration over shortages of food and basic supplies, the inability of hospitals to deal with other health emergencies and poor conditions at centralised quarantine sites where anyone who tests positive — or even has contact with a positive case — is required to be sent.

The National Health Commission on Thursday reported 11,285 new cases across mainland China, most of them asymptomatic and the vast majority in Shanghai, where an additional 47 deaths were reported.

Also read: Russian troops intensify offensive in Ukraine’s east, captures several villages

Shanghai city authorities said Wednesday they will analyse the results of new rounds of testing to determine which neighbourhoods can safely expand freedom of movement for residents.

Shanghai is seeking to achieve “societal zero COVID” whereby new cases are found only in people who are already under surveillance, such as in centralised quarantine, or among those considered to be close contacts.

Also read: Kamala Harris tests positive for COVID-19 after California trip

That would indicate chains of transmission in the open community have been severed, reducing the risk of new clusters forming from previously undetected sources.