If I understand, you want to test which box on a multiple-choice answer sheet had a check mark in it.
The way it's done automatically is to feed the paper through an optical scanner that looks at the amount of reflected light from the box. The boxes are usually colored and the light source is the same color so the mark is more prominent. This is why the paper usually states that black ink must be used. The position of the boxes relative to the paper edge, or to special marks on the paper is used to align the reading to the position of the box.
If you want to make one you first need a mechanism that feeds the paper at a known rate, possibly using a stepper motor. The paper is moved until an edge detector or alignment marker is found. From there, a known amount of movement will position the box under the sensor and a reflected light reading can be taken.
Brian.