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 if his statement earned perfect marks.

A spokesman for Sanders’ campaign said Sanders’ NRA 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.

1992 D 1994 F 1996 F 1998 F 2000 Featured Fact-check Says Tony Evers and Mandela Barnes “have participated in rallies that have done more to incite than calm the situation” in Kenosha F 2002 F 2004 D+ 2006 C- 2012 D-

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

The NRA slightly warmed to Sanders in the mid 2000s, giving him a D-plus in 2004 and a C-minus in 2006, 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. (You can read more about Sanders' votes on guns over his congressional career in this fact-check.)

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 of 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 as she ran for re-election to the Senate in 2006.

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, so we rate it Mostly True.