Grading President Obama's foreign-policy record is not as easy as the Democrats - or the Republicans - want you to believe.

Republicans rail that Obama has abandoned our role as leader of "the free world." The Dems believe they have an edge over Republicans on national security, and recent polls say the public backs them. That's why, unlike Mitt Romney, Obama stressed foreign policy in his convention speech.

Obama's message: The Iraq war is over, the Afghan war is ending, al-Qaeda is on the run, and we can turn to nation-building at home. As the best bumper sticker in Charlotte put it: "Bin Laden is dead and GM is alive." This slogan is compelling, but far from complete.

Obama's foreign-policy record is dogged by mixed grades and unfinished business. But the Republican attack is blunted by a lack of foreign-policy credibility.

The president gets an A for recognizing how much the world changed in the decade before he took office. The United States confronts no single powerful enemy. (Sorry, Mitt, Moscow is no longer our top geopolitical foe.)

Freed from the Cold War straitjacket, many other nations no longer feel the need to do America's bidding. New regional powers - China, India, the new Russia, Turkey, Brazil - have the economic heft to choose their own directions.

Recognizing this reality does not mean abandoning U.S. leadership, as Republicans claim. (The GOP still gets a D when it comes to grasping this new world; that rating might be higher if party hard-liners had not squelched Republican moderates.)

In the new world, any U.S. leader must think more carefully about how and when to exert American power - especially when finances are tight.

Which brings us to Obama's handling of America's two big wars.

Again, Obama deserves an A for analysis on Iraq and Afghanistan. The botched U.S. occupation of Iraq, and the devastation it wrought, undercut America's standing in the Mideast and beyond. It removed our focus from Afghanistan during critical years. Give the Republicans an F on both.

The president's grade drops, however, when it comes to his handling of our Iraq exit. Yes, the Bush team created a mess, and yes, Obama brought the troops home as promised (although an accord negotiated by the Bush team already required the troop withdrawal). But White House efforts to stabilize Iraq's government failed, as did efforts to negotiate a small follow-on U.S. troop presence. Iran now has more influence in Iraq than does the United States. Give Obama a B-minus on Iraq.

As for Afghanistan, yes, the troops are set to come home by the end of 2014. (Romney appears to endorse that date, although quarreling with the pace of withdrawal while presenting no alternative plan.)

However, the White House gives no clue as to what will occur if Afghan forces we're training can't handle security after we leave and the country collapses back into civil war. So far, the administration has failed to prod the Taliban into negotiations over a political endgame. On Afghanistan, the administration gets an Incomplete, but could end up with a poor grade.

True, the president deserves an A for his tough decision to send the Navy SEALs in to get Osama bin Laden. Another A for decimating al-Qaeda with drones. Yet no one, not Obama and definitely not Romney, has figured out what to do about Pakistan - which contains terrorists and nukes.

On the Mideast peace process, Obama had the right ideas but poor implementation - a C grade. On the Arab Spring, the Libyan operation gets an A, but Syria needs more attention.

Then there's Iran.

While the White House gets an A for organizing harsh sanctions on Tehran, its early effort to engage the ayatollahs failed. The administration is still working to halt Iran's nuclear enrichment program. Overall grade on Iran: Incomplete. (The Republican rush to war - with Israeli or U.S. planes - would be a disaster.)

Bottom line: The Obama performance on foreign policy leaves much unsettled. On Russia, the "reset" produced mixed results; despite intense U.S. efforts, China is aggressively flexing its military and economic muscles.

But the Republicans have no better - or worse - answers. And some of Romney's top advisers are the same men who created the debacle in Iraq.

Moreover, and this is key, Obama grasps that America can't exert continued global leadership if it doesn't rebuild its economy. The GOP plan to slash taxes while boosting defense spending guarantees rising deficits that will undermine America's international standing. That kind of leadership will convince China that America is declining.

The best indicator of Obama's foreign-policy smarts may indeed be his decision to save General Motors: The auto industry is central to America's reputation abroad, and morale at home. Its recovery shows the potential for U.S. growth and innovation.

That decision deserves an A, and indicates the key to any future president's foreign-policy performance. The United States won't be able to lead abroad unless it can resolve its economic problems at home.