Problem with randomized subjectid numbers


Author
Message
barsad
barsad
Esteemed Member (2.2K reputation)Esteemed Member (2.2K reputation)Esteemed Member (2.2K reputation)Esteemed Member (2.2K reputation)Esteemed Member (2.2K reputation)Esteemed Member (2.2K reputation)Esteemed Member (2.2K reputation)Esteemed Member (2.2K reputation)Esteemed Member (2.2K reputation)
Group: Forum Members
Posts: 12, Visits: 1

Hello --


I am using the standard randomized Subject ID script to assign subject numbers for a Web experiment, which is the following:


function GetSubjectNumber()
{
var snum = Math.floor(Math.random() * 1000000000);
   return snum.toString();
}

But for some reason several subjects (about 10) were given the same subject number when taking the survey. I know this isn't supposed to happen when it's randomly assigning numbers between 1 and 1000000000, but it is. Has anyone had this bug, and how might I correct it?
I need to have an even number of evenly-numbered and odd-numbered subject IDs.

Thanks,
Josh




GO

Merge Selected

Merge into selected topic...



Merge into merge target...



Merge into a specific topic ID...





Reading This Topic

Explore
Messages
Mentions
Search