First time I had to take an on-line driving class after a speeding ticket they didn't even have JS to see how long you remained on the page; I finished the 8-hr course in 40 minutes.
My wife is studying for a Master's on-line at the moment. When she takes a test, she has to use a special browser they provide that can detect if any other browser is running. The webcam must be running and filming her. At random intervals she is prompted to pick up the laptop and turn to scan the whole room. The presence of another person or computer, books, wall posters or the like marks the test as questionable and alerts a human to review the video.
Things have changed!
The way forward always starts with a minimal test.