All but four of the three dozen schools that monitors visited in April as part of the city’s test security program had previously been the subject of cheating allegations.

Last spring, the Department of Education sent test monitors into 37 schools during a six-day period when students take standardized state tests, the results of which weigh heavily in how schools and teacher performances are measured.

Officials had previously billed the visits as a randomized tool to deter school staff from violating test security guidelines.

“Even schools that don’t actually get a visit … know that they could get a visit at any moment,” spokeswoman Connie Pankratz said of the program in August.

But it turns out that 33 of the 37 schools were not randomly selected at all, according to officials. Instead, the department was taking a hard look at the test administration practices of schools where it had already dispatched investigators to look into allegations of cheating.

Not all of the investigations are complete, but the ones that were substantiated turned up a mix of violations that could have given students a chance of performing better on the high-stakes tests. At one school, for instance, students used calculators on the exams even though they were prohibited.

The disclosure comes as the city grapples with ways to ensure that its test scores remain credible, even as the incentives to achieve higher scores multiply and funding for security measures remains scarce. In 2011, monitors visited 97 schools, but Chancellor Dennis Walcott said the department reduced the program this year because of cuts to the central budget.

Investigators found violations at six of the 33 investigated schools, officials said.

The department provided basic information about the investigations to GothamSchools, but did not release entire reports from the cases.

At Aspire Preparatory Middle School, a teacher handed out calculators to students for a state exam, even though the devices were banned. At Esperanza Preparatory Academy, a staff member instructed teachers to give students more time on tests than was allowed.

Esperanza was among the schools that saw an unusually large decrease in test score proficiency rates in 2012 after monitors visited, just one year after the school doubled those rates.

At four schools where allegations were substantiated, Pankratz said a single teacher violated test proctoring guidelines by “providing assistance to students during exam administration.”

The four schools were M.S. 324 (Manhattan), P.S. 46 (Bronx), P.S. 044 (Bronx), and P.S. 193 (Brooklyn).

Principals at the schools either declined to comment or did not respond to requests seeking comment.

At one of the schools, P.S. 44, the number of fourth grade students who passed their math test nearly tripled in 2011; that number dropped by more than 40 percent after monitors visited.

“We have taken appropriate disciplinary action against these teachers,” Pankratz said, but she did not provide additional details.

Not all of the violations may have been intentional. A source said that the cheating allegation at M.S. 324 emerged from a misunderstanding and that it was substantiated on a technicality.  The person said that a teacher was overheard telling students who had finished their exams to review their answer sheets before submitting it.

Teacher proctors aren’t allow to speak during the exam except when giving directions or answering questions about the directions.

At 19 of the 33 schools, the department could not substantiate allegations of cheating or other test improprieties. That includes Choir Academy of Harlem, where test scores and graduation rates increased during the two-year helm of a former principal who was denied tenure and removed from the school last January. The test scores plummeted after the principal left and test monitors visited.

Eight schools are still under investigation.