WITHIN the bright-blue and green walls of Emilio Carranza, a three-classroom primary school in a rural part of the state of Puebla, a lesson is engrossed in a book of “Ecological Experiments and Facts”. Hands shoot up with enthusiasm, undimmed even by a drill of singing the lengthy national and state anthems in the baking school yard. The school is an example of how Mexico has been using parents to help improve its education—long overdue in a country where high spending has failed to produce results to match.

By Latin American standards, Mexico's schools are rather good. According to the PISA survey, an international test of 15-year-olds in reading, maths and science, Mexico has the region's second-best educated children, after Chile. In maths it is improving faster than anywhere else in the 65-country study. The OECD says Mexico is “well on track” to meet maths and reading targets next year that Felipe Calderón set in 2007, near the start of his presidency.

Yet Mexico should be doing far better. Within the OECD, its education system ranks dead last. Whereas over a third of students in Singapore meet PISA's second-to-top maths grade, in Mexico less than 1% do. In maths it matches Thailand, a much poorer country. In science it is on a par with Jordan, poorer still. Although enrolment improved from 52% of 15-year-olds in 2000 to 66% in 2009, Brazil jumped from 53% to 80% in the same period.

Money is not the problem: education accounts for 22% of public non-capital spending, the highest share in the OECD (though well below the group's average in dollars per pupil). But 80% of non-capital education spending goes to teachers' salaries, well above the 64% OECD average. And many of Mexico's teachers are imaginary or dead. In 2008 an audit of one funding programme found irregularities in the records of 90,000 of its recipients. A teacher in Chihuahua was receiving 700,000 pesos (then $66,000) per month.

This mischief is tolerated thanks to Mexico's mighty teachers' union, which with 1.2m members is Latin America's biggest. Wielding those votes, its president, “La Maestra” (“The Teacher”), Elba Esther Gordillo, turns politicians into timid schoolboys. Mr Calderón's close victory in 2006 came with her support. His education reforms of 2008, which included competency tests for teachers, were watered down after strikes. Extraordinary perks remain: some teaching jobs are hereditary.

But the Emilio Carranza school's freshly painted walls, new lavatory doors and flower-beds show a way forward. They were installed by parents under a project called “School Management Support” (AGE), in which the parents' associations in some of Mexico's poorest schools receive grants of roughly $6 per student per year. The amounts are tiny, but a World Bank study suggests the impact is big. The bank doubled the grant in one group of schools, to $12. It saw dropout rates fall by over 1.5 percentage points and students move ahead by about a year in reading and maths. The gains are similar to those generated by the “Opportunities” programme, which gives poor families about $100 a month (although “Opportunities” has other benefits, including improved health.)

The success of AGE, reckons Harry Patrinos, a World Bank economist, comes from mobilising parents. The budget meetings mean that “parents feel committed. They're giving, not just receiving,” says Monserrat Guzmán Salamanca, the head teacher at Emilio Carranza. Parents have stepped in where the state cannot or will not help: on one classroom wall is a rota of fathers who guard the school day and night (a local nursery was recently robbed of everything from its Christmas tree to its bathroom soap). The budgeting process gives parents the opportunity and confidence to quiz teachers about their child's progress. Parent pressure has also lowered teachers' absenteeism.

Focusing on families could pay dividends. The main reason children drop out is not poor teaching but the need to work and, for girls, to marry, according to the Mexican Institute for Competitiveness (IMCO), a think-tank. Poor children would do better if their parents could help them more with their homework, it suggests. The OECD says that in Chile, the one Latin American country that outperforms Mexico, 24% of parents are educated to upper-secondary level, whereas in Mexico 16% are. After-school support, using mentoring and homework clubs, could also help.

Other initiatives are making it easier for parents to monitor schools' performance. ENLACE, an online database, shows exam results for every school in the country, with sample questions and answers. It marks “a real milestone in public accountability,” says Andreas Schleicher, an OECD education guru. Phantom teachers are being tackled by Mexicanos Primero, an NGO, via an online campaign called “Where's my teacher?”, in which students can report who is actually showing up.

Parents cannot solve all of Mexico's problems. The system is still highly centralised: efforts to give states more autonomy in the 1990s only decentralised the bureaucracy, Mr Schleicher says. The growth of telesecundarias, secondary schools in rural areas where students learn by television broadcasts, threatens Mexico's performance, thanks to their poor results. There is still no independent inspectorate. And teachers' career structure means that the weakest, most remote schools often get the least-experienced teachers. Until politicians tackle these problems too, parents will have to push hard from below.