Every mathematics teacher has faced examples of cheating, and then had to deal with them appropriately. It is always a stressful event, usually moreso on the teacher's part.
For example, I once knew a student was cheating, but could not figure out how. His eventual undoing was my discovery of multiple gum wrappers under his desk....but they contained no helpful formulas. Rather, the student used a lead pencil to write key formulas on the gum sticks themselves, then, after rewrapping the sticks, arranged them in a special sequence in the original gum pack. When in need of a particular formula, he would select that stick of gum, unwrap it, read the formula, and then chew the evidence. This same student perhaps is now suffering from lead poisoning!
On the subject of cheating, mathematics teachers might want to browse this website. It overviews ingenious methods for cheating that we should be aware of...such as the revised coke bottle label. And, make sure you read the entries on "nailology" and the "hair-plucking" method. Ugh!