i've seen this question asked a few times, usually to solve a problem with filling out tests on the same site that hosts the learning material.
Basically, what you want to do can't be done, however, there are ways to achieve similar results.
You use Javascript to pull various data from the browser and store it in a string, but this won't guarantee it to be unique (think an office or school all on the same external facing IP)
You can force everyone to log in, and track their movement throughout the site, and prevent access to certain areas if a test has been initiated.
What is the problem you are trying to solve though?