Give exams in a room, proctored, on paper, at a scheduled time. Open book/open note -- like real life. Everyone takes it at the same time. If you aren't there (without a good reason) you fail.
I'd much rather teach and talk and enjoy with my students, but, alas, the design of most universities box us in at different levels (and let's not even get started on the "must publish research" side of teaching).
Just my $0.02.
It's far from perfect, but it's better than the alternatives, and various organizations and people and powers-that-be reasonably want some kind of measure of whether someone actually learned something in a class/degree.