Reporters and editors working in Chinese state media will have to take a nationwide exam which will evaluate their loyalty to President Xi Jinping.

The on-site, closed-book exam has five sections, with at least two of them focused on Xi’s political thinking and one on Marxism, according to reports.

A notice from China’s media regulator has been sent to more than a dozen state-owned news organisations in Beijing over the last month. It instructs employees to prepare to take an exam on the “study Xi” propaganda app, launched earlier this year, in order to have their press credential renewed.

Some will be asked to take part in “pilot tests” in early October, before the exams are held nationwide, according to the notice late last month from the media oversight office of the Communist Party’s propaganda department. It did not say when the nationwide exams would be held.

Xi has demanded loyalty from Chinese journalists before. In 2016, he had told the staff at three state-run news outlets in Beijing that they were “the propaganda fronts and must have the party as their family name”.

The notice from the media oversight office says journalists who fail the test will have one chance to take it again, but without passing, there is no other way to get a state press pass.

China is already one of the worst countries for journalists to operate. Reporters Without Borders ranked the country 177th out of 180 countries earlier this year. The only countries below China in the rankings were Eritrea and North Korea.