A school in Mexico has come under fire after a teacher made the students wear boxes in a bid to deter cheating.