The trick is timing rather than any cheat code. When the teacher turns to the board, glance at a nearby classmate's paper — just don't lean or move across the room while she's looking.
Watch for the moment she starts turning back and you'll get away with it consistently.