The president did appear to inspire optimism during his first year, with as many as 50 percent saying the country was headed in the “right direction,” up from single digits the previous fall among registered voters and the highest level since 2003.