Found my own answer.... restore the courses back to front....
ie backup was made in this order Course 1 , Course 2 , Course 3 , Course 4. So to stop the quiz attempts table from getting error messages I restored it backwards, Course 4 first, with Course 1 last... dont know why but it worked .
This has taken some time as the course backup files are at 200mb to 400mb in size!