.....mod/quiz/view.php?id=5001
means that the course_module id is 5001.
If you look in the mdl_course_modules table in the database, at the row with id 5001, then the instance column contains the quiz id.
.....mod/quiz/view.php?id=5001
means that the course_module id is 5001.
If you look in the mdl_course_modules table in the database, at the row with id 5001, then the instance column contains the quiz id.