Yes. Online exams can detect cheating. Authentication procedures, web monitoring, data forensics, and proctoring (just to name a few) make it hard for examinees to get away with cheating.