ATLANTA — In an unexpectedly harsh sentence after a polarizing six-year ordeal, eight of the 10 educators convicted of racketeering in one of the nation’s largest public school cheating scandals were sentenced to prison terms of up to seven years Tuesday after they refused to take sentencing deals that were predicated on their acceptance of responsibility and a waiver of their right to appeal.

As a result, the sentences, meted out after a raucous court hearing, offered a conflicted, inconclusive coda to a scandal that has brought shame and soul-searching to Atlanta and its 50,000-student public school system. Some were furious with the sentences, and some were pleased.

And as some of the defendants vowed to appeal, it ensured that this city would continue to grapple with two harrowing and interrelated questions: How much mercy should be due a roster of educators with otherwise spotless records? And what kind of justice is due the thousands of students, most of them poor minorities, whose falsely inflated standardized test scores obscured their academic shortcomings?

Many here, amid widespread calls for leniency before the sentencing, were shocked at the severity of the sentences handed down by Judge Jerry W. Baxter, who had seemed to indicate on Monday that he wanted to avoid prison terms. But after the deals fell through, and while declaring the cheating scandal “the sickest thing that’s ever happened in this town,” he imposed sentences that appeared to be more harsh than those in similar cheating scandals elsewhere and that exceeded what criminals sometimes receive for violent crimes.