W HEN YOUR correspondent arrives at Hlabizulu primary school, near the town of Willowvale in the Eastern Cape, there is the familiar sound of children playing, but it is not break time. The pupils have been left to their own devices. In one classroom they have been padlocked inside. “What can we do?” asks one of the staff. “They’re locked in because they have no teachers.” Just three of the seven teaching staff have turned up for work.

Locking up children may be unusual but a similar lack of learning occurs on a daily basis in South African schools. For even when teachers show up they often do not teach pupils anything. “There is very little education taking place here,” sighs Mkhuseli Ngcube of Public School Partnerships, an NGO trying to change that.

Education both reflects and entrenches the inequalities in South African society. The top 200 high schools in the country produce more distinction marks in maths and science exams than the other 6,476 high schools put together. Meanwhile in 47% of high schools not a single pupil meets a commonly accepted international standard for maths. The equivalent figure in Botswana is just 2%. These schools could be called “cognitive wastelands”, says Nic Spaull of Stellenbosch University.

Apartheid still casts a shadow over education. Non-whites were deliberately given poor schooling, lest they get uppity or, worse, skilled. In 1994 per-pupil spending was 1.5 to 5 times higher for white pupils, depending on the location of the school. Hendrik Verwoerd, the architect of apartheid, said blacks should be educated enough only to be “hewers of wood and drawers of water”.

The legacy of this racism is starkly apparent in the villages around Willowvale. Most pupils’ parents have left to seek work in nearby cities such as East London. They leave their children with grandparents, most of whom are illiterate.

After 1994 the ANC opted for a compromise on education policy. Formerly white-only schools would have to accept children from all races, but they could still charge fees. In theory they cannot exclude any pupil for being too poor, but in practice, poor children do not live near these schools, and the costs of transport, uniforms, sports and trips make them prohibitively expensive.

As in other areas of South African life the effect of post-apartheid policy has been to replace a system directly based on race with one based on wealth (and thus, still indirectly racially skewed). More than 180 of the top 200 schools took only white pupils under apartheid. Today non-whites make up 60% of the pupils across all fee-charging schools, but they are overwhelmingly from the country’s elites.

Since 1994 there has been some progress. There is no basis to the notion that education is worse than under apartheid, notes Mr Spaull. Piecing together evidence from various test data, he reckons children today are roughly two years ahead of where they would have been before 1994. Yet in recent years progress is “stalling”, he says. South Africa ranks bottom or near-bottom when countries are ranked by their pupils’ scores in comparable international tests. Nearly 80% of children in grade four (9- or 10-year-olds) cannot read and understand sentences in any language; 61% of pupils a year older cannot add or subtract whole numbers.

Small wonder then that, of the 100 pupils who begin a school year, just 50-60 can be expected to take the end-of-school "matriculation" exam, with 40-50 passing, and only six going on to complete university. All of this has a big impact on a labour market that offers a premium for skilled labour. The jobless rate for people with a high-school certificate (28%) is more than quadruple that for university graduates.

The quality of teaching is a major obstacle to better education. Nearly four in five maths teachers cannot do the sums expected of their 12- or 13-year-old pupils. Many of these teachers were themselves educated under apartheid. Nevertheless the lack of accountability for poor performance has been the responsibility of ANC governments. It is all but impossible to fire a teacher in South Africa. Even when school leaders are suspected of sexual harassment of pupils they are more likely to be moved to a different school than prosecuted.