Hundreds of university students in Scotland have been caught using AI to cheat.