Maybe something with reverb/pusher and a presence channel?
Make sure each user gets a unique ID for their instance of a test, issue that same ID if the test already exists (eg, they simply refresh the page). Broadcast that Id on the presence channel, and refuse to start a new instance of the test if the presence channel already contains the test ID.