Legislation prompted by hundreds of Mills High School advanced placement test takers having their scores tossed because of seating irregularities is now law.

The bill by state Sen. Jerry Hill, D-San Mateo, was signed by Gov. Jerry Brown Friday evening. The legislation, which received unanimous support by the Senate last week, creates an expedited timeline for investigations and subsequent new testing if irregularities cause the scores to be canceled.

Hill introduced the bill after Mills students and parents suggested it as part of the Peninsula lawmaker’s annual “Outta Be A Law” contest.

In May 2013, some students taking the exams at Mills were seated at round tables, a violation of testing protocols. Students are required to face the same direction.

After a student complaint prompted an investigation by Educational Testing Service, the test’s publisher found no misconduct but invalidated 641 scores that July. Nearly 300 students were allowed to retake the tests in August but by that time the high school year was over and some pupils were already at college. Those who did take the exams again only had a small window to study for the new test.

“Students should not have to bear the brunt of testing errors that occur through no fault of their own,” Hill said in an announcement of the governor’s signature. “This legislation clarifies rules for the test proctors, investigations of testing issues and retesting so that students can take advantage of the opportunities that advanced placement tests offer.”

Hill’s law requires a test agency to begin an investigation immediately upon receiving a complaint of inadequate or improper test conditions and the school under investigation must provide the requested information within five business days.

If test scores are invalidated, the test agency must notify the school and affected within two days of the decision. The students must also receive notice at least five business days before the opportunity to retest which must happen within 30 calendar days of the investigation’s conclusion.

The bill also requires test administrators to keep a seating chart, noting the Mills High School investigation was delayed and a wide range of scores canceled because there was no documentation showing where students sat. Without the seating charts, the testing agency couldn’t tell which of the students were at round tables and which were seated properly.

Hill noted in his announcement that thousands of California high school students use AP exams to receive college credit and test out of introductory courses. The tests also have a financial component because passing an exam and sidestepping a course can mean saving on tuition.

The Mills High School testing incident caused an uproar among parents and students. It also led the College Board, the AP tests’ distributor, to sue the San Mateo Union High School District. The district lost.