SAN JOSE — A teacher at the Berryessa Union School District’s highest-scoring school in the spring helped second-graders cheat on the STAR test by erasing errors, causing the school’s test results to be invalidated and incurring state and federal sanctions.

Ruskin Elementary, which in 2012 scored a stellar 944 on the state’s Academic Performance Index, did not receive an API score for 2013 because of the violation. When district officials discovered the breach in the spring, they placed the unidentified teacher on leave for the rest of the school year, Superintendent Will Ector said.

Berryessa was one of 27 districts with self-reported testing irregularities serious enough for the state to strip the schools of their API rankings. The sanctions include losing eligibility for state awards. Without an API, the school failed to meet federal requirements, which could eventually lead to outside intervention in the school. But because Ruskin has a high-scoring record, that appears to be unlikely.

“This was serious. The whole community was penalized,” Berryessa Superintendent Will Ector said. “We did take some drastic action.”

The cheating came to light when a student told another teacher that his own teacher walked around the classroom during the STAR test and asked students to check their work, helped them erase answers and told them they had “another chance.” Berryessa administers the statewide STAR test in April.

According to the district’s investigation, all 23 students taking the test had multiple erasure marks on their test sheets. The teacher told district officials that she did tell students to check their work, asked if they were sure about particular answers and helped them erase marks.

Because the students made up more than 5 percent of the school’s 438 tested students, the school was deprived of an API score.

Both the state and federal governments issue strict rules intended to protect the integrity of standardized tests. Those administering STAR tests must receive security training and sign an affidavit.

The state also conducts random audits by an outside agency, which rarely produce evidence of cheating, education department spokeswoman Pam Slater said. Schools are notified in advance of those visits.

With the threat that next year all state schools could lose some U.S. funding, because of a dispute over California’s decision to abandon STAR testing altogether while schools transition to the new Common Core curriculum and tests, the state is likely to have bigger worries about compliance with federal law.

But the loss of an API score is a blow to Ruskin, which in 2011 was named a national blue-ribbon school, one of only 20 of the state’s roughly 10,000 public schools to merit that honor. Last year it ranked among the state’s top 10 percent of elementary schools, although it was in the top 30 percent when compared with schools with similar demographics.

Ector refused to say whether the second-grade teacher remains in the district.

Five other area schools received similar penalties for testing violations.

At James Logan High School in Union City, administrators allowed students to complete parts of a test that they had started on a previous day — a violation of testing rules. New Haven Unified School District officials notified the state about the violation on May 9.

“Once we realized we had violated a guideline, we self-reported it,” said Arlando Smith, New Haven Unified’s chief academic officer and interim co-superintendent.

Vallejo High in Vallejo City Unified; and Bay View, Westlake and De Laveaga elementary schools in the Santa Cruz Schools district also reported testing-procedure violations.

Last month the state released California schools’ API scores, but numbers for the offending schools were left blank. A list of those schools and the details of their misconduct was first reported by the Los Angeles Times, which obtained school district reports through a public records request from state education officials.

Bay Area News Group writer Chris De Benedetti contributed to this report. Contact Sharon Noguchi at 408-271-3775. Follow her at Twitter.com/NoguchiOnK12.