Former Alaska Attorney General Dan Sullivan (R). (AP Photo/Mark Thiessen)

In this midterm year, it's final exam day for the Senate Republicans' primary season.

Voters head to the polls Tuesday in Alaska, where former attorney general Dan Sullivan is favored to win the Republican nomination. The choice of both tea party and establishment groups, Sullivan would give GOP its best hopes of defeating Sen. Mark Begich (D) in one of the most important races in the battle for the Senate.

Republicans this year have avoided nominating the kind of flawed candidates -- think Todd Akin and Sharron Angle -- that hurt them in previous elections. They hope to continue their success in Alaska, effectively the final uncharted space on a map that is just about set for the fall campaign.

Sullivan is trying to get past Lt. Gov. Mead Treadwell and tea party candidate Joe Miller. He's doing it with the support of the anti-tax Club for Growth and the establishment Republican groups American Crossroads and the Chamber of Commerce -- and he's outraised and outspent Miller and Treadwell by a wide margin.

Limited public polling shows Sullivan ahead. But in some surveys, his margin has been narrow enough to leave some doubts about his chances.

A Sullivan win would cap what's by and large been a successful primary season for Republicans in the battle for the Senate. An upset by the underfunded Treadwell or volatile Miller would be a late blow.

Republican senators are poised for a perfect record in primaries for the first time since 2008, sparing them the risks they exposed themselves to in 2012 and 2010. Then-Sen. Richard Lugar's loss to tea party opponent Richard Mourdock in 2012, for example, ended up costing Republicans a very winnable seat.

The GOP needs to gain six seats to win the majority. They are well-positioned to pick up open seats controlled by Democrats in Montana, South Dakota and West Virginia. From there, they are eyeing four states Mitt Romney won where Democratic senators are running for reelection, including Alaska.

Republicans have also done well in open seat primaries. In Georgia, strategists were anxious that controversy-prone Rep. Paul Broun would win the nomination and imperil the GOP's chances of holding a seat Democrats are contesting. But businessman David Perdue, a stronger candidate, won the primary instead.

Voters are also casting ballots in Wyoming Tuesday, where Mike Enzi (R) is set to cruise to victory. Enzi once faced a challenge from Liz Cheney, but she ended her campaign early this year, leaving Enzi with only gadfly competitors.

After Alaska, the only other Senate primary of real consequence for Republicans will come Sept. 9 in New Hampshire. But Scott Brown, a former Republican senator in Massachusetts, is heavily favored to win that contest. And Sen. Jeanne Shaheen (D-N.H.) is not as vulnerable as Begich.

Republicans caught a break in Alaska when Miller, who stumbled badly in the 2010 general election after defeating Sen. Lisa Murkowski (R-Alaska) in the primary, announced last week that he would back whoever wins the GOP nomination. There was some uncertainty about whether he might try to wage an independent campaign if he loses. Had he done so, he could have pulled away valuable votes that would otherwise likely go to the GOP nominee.

After he assured his opponents he would be a team player, Miller -- who Murkowski defeated as a write-in candidate -- was endorsed by former Alaska governor Sarah Palin and former Arkansas governor Mike Huckabee, a longtime Club for Growth rival. Democrats have appeared to try to quietly boost Miller; a pro-Begich super PAC Put Alaska First ran a recent ad criticizing both Treadwell and Sullivan.

But it all could be too little, too late. Miller has consistently polled in third place. And he raised only about a tenth of what Sullivan raised through the end of last month.

Polls suggest a Begich-Sullivan race would be close. Both sides have effectively been running against each other for months, sketching out battle lines that are likely to define the time between now and November 4, should Sullivan win on Tuesday.

Both sides want to cast the other side's candidate as a Washington insider while pitching theirs as a true Alaskan.

Begich has been emphasizing his Alaska roots in his television ads, which point out his work on parochial issues. The super PAC supporting the senator has been hitting Sullivan's residency history. Sullivan was raised in Ohio and moved to Alaska in 1997. He spent much of the next decade living in suburban Washington while working Bush administration. In between, he was recalled to active military service.

Groups allied with Sullivan have sought to tie Begich to Obama and his policies -- an inconvenient connection in this conservative state. Sullivan is trying to counter Democratic attacks on his residency with his own positive spots full of Alaska imagery. His wife, who has deep roots in the state, appeared in a July commercial for him.

Begich has cast himself as a centrist by noting the similarities between his voting record and Murkowski's. But Murkowski has strongly objected, asking his campaign to take down an ad tying them together.

Anyone looking to take late part in the air wars is probably out of luck: Air time in sparsely populated Alaska is much cheaper than in other battleground race states like North Carolina and Kentucky, and the campaigns and outside groups have bought up pretty much all the fall TV commercial time already.

The battle of the Senate could hinge heavily on what happens in this race, four time zones away from Washington. But first, Republicans need Sullivan to take care of business in the primary.