It was a simple plan: A college student would crawl through an air duct at a building housing an instructor’s office in the wee hours, lower himself from the ceiling and, with the help of a cohort, steal a copy of the final exam for a statistics class.

But the odds were never in their favor.

The instructor at the University of Kentucky, who was working very late, had gone out for a midnight meal and returned just in time to derail the plan, according to a university spokesman.

The episode unfolded around 2 a.m. on Wednesday at the university’s campus in Lexington, Ky., the spokesman Jay Blanton, said.

One of the students, Henry Lynch II, had made his way through the duct — a distance of less than 10 feet — to the third-floor office of the instructor, John P. Cain, Mr. Blanton said. Mr. Lynch made his way from the ceiling and lowered himself the eight feet to the floor.