(CNN) A school in India has apologized after photos emerged of students wearing cardboard boxes on their heads during an exam to discourage cheating.

The Bhagat Pre-University College in Haveri, in India's southwestern Karnataka state, implemented a trial run of the new measure last Wednesday, according to school management head M.B. Sateesh.

A staff member photographed the students sitting in neat rows, their heads obscured by cardboard boxes.

The front of the boxes had been cut out, allowing students to see their desks and exam sheets but restricting their vision, similar to blinkers used on a horse.

The students were at the Bhagat Pre-University College in the town of Haveri, in India's Karnataka state.

The photos were posted on Facebook by a staff member and promptly went viral, according to CNN affiliate CNN-News18.

Read More