Updated

A nationwide survey has found that Afghans are slightly more optimistic about the future than they were last year, despite a stagnant economy and near-constant attacks by a revitalized Taliban.

The annual survey by the San Francisco-based Asia Foundation, released in Kabul on Tuesday, found that 32.8 percent of Afghans believe their country is moving in the right direction, up from 29.3 percent in 2016. Another 61.2 percent said the country is heading in the wrong direction, down from 65.9 percent — a record high — in 2016.

The foundation acknowledged that the slight increase in optimism is "difficult to explain."

The foundation polled 10,012 Afghan men and women in face-to-face interviews in July in all 34 provinces. The poll has a 1.4 percent margin of error.