“I have a D-minus voting record from the NRA.”

— Bernie Sanders on Tuesday, January 19th, 2016, in a town hall in Underwood, Iowa

U.S. Sen. Bernie Sanders is wearing a bad grade as a badge of honor.

The Democratic presidential candidate is under fire since Sunday’s debate for his votes on gun legislation, with chief rival Hillary Clinton eagerly highlighting his flip-flops on immunity for gun dealers, among other issues.

Sanders got his chance to explain himself in Underwood, Iowa, when an audience member asked him about his past positions, which she said seemed more Republican. Sanders said that impression wasn’t right.

“I have a D-minus voting record from the NRA,” he said. “Does that sound like a tool of the NRA? D-minus.”

We wanted to know whether his statement earned perfect marks.

A spokesman for Sanders’ campaign said the candidate’s National Rifle Association grade came during the 2012 election cycle, as shown in the lobby group’s subscriber-only database. The group awarded Republican John MacGovern, Sanders’ unsuccessful challenger, an A.

The NRA corroborated Sanders’ D-minus grade.

Of course, 2012 wasn’t Sanders’ first public-office rodeo.

The NRA (or technically its political action committee, the NRA-Political Victory Fund) has grades for Sanders as far back as 1992, when he ran for his second term for Congress as an independent from Vermont. (The NRA did not have earlier ratings available even though Sanders first ran for Congress in 1988 before winning in 1990.)

The grades the gun lobby did have on file show Sanders has never exactly been in its favor, with one sort-of exception.

Our first thought: Man, the NRA really didn’t like Sanders in the 1990s and early 2000s, awarding five straight F’s.

The NRA slightly warmed to Sanders in the mid-2000s, giving him a D-plus in 2004 and a C-minus in 2006, during his first bid for the Senate.

That’s mediocre but passing, right? The change of heart corresponds with Sanders voting in favor of the gun liability bill, which passed in October 2005 with NRA support. The bill also contained provisions for childproof trigger locks and a ban on body armor-piercing bullets, which Sanders mentioned as he explained his vote to the audience in Underwood.

However, its most controversial provision was broad immunity for gun sellers, with a few exceptions, such as if the seller was negligent or knowingly broke the law in making the sale. The Democrats opposed this section, but the bill passed 283-144 in the House.

NRA spokeswoman Amy Hunter gave us a little more insight into the group’s grading process. Ratings are compiled by lobbyists and analysts who know the issues in their specific region well, she said, and are generally not done for primaries.

Each grade represents each election cycle, including all the relevant gun issues in that politician’s state and the country at that time.

“They only last through that election,” Hunter said.

Clinton’s most recent grade came in 2006, when she ran for re-election to the Senate.

It was an F.

Our ruling

Sanders said he has a “D-minus grade” from the NRA.

He’s accurately referring to the most recent assessment from the gun lobby group in 2012. The NRA has not issued a more recent evaluation for Sanders for the 2016 primary election.

It’s worth noting that the grade is a few years old, and that his rating has been higher in previous election cycles. Still, a D-minus is far from a full-throated endorsement.

His claim is partially accurate but needs more clarifying information.

We rate it Mostly True.