For one of my projects, we use the embedded temporary codes, assigned randomly to participants. This has generated duplication. Is there a way of creating a system of B codes instead, where these are given to participants in 7’s? For instance, B00000001, B00000008, B00000015, B00000022, B00000029 etc. If so, how would this be set up and how can I make that the system knows what code has been issued before generating the new one, to make sure the codes are generated in 7’s?
You can use JS and generate unique number with the combination of random number, current date and and respondent number. You will definitely get unique number using these three combination. Refer below link and try to use it and play with combinations.
https://stackoverflow.com/questions/26203453/jquery-generate-unique-ids
Thank you for your reply. I think I need to clarify my point a little more. We already have a way of generating random codes that are presented to participants and are stored as embedded data. However, this random generation has the possibility of producing duplicates. We are, therefore, looking to have a system in which we know exactly which codes are going to be generated. This will prevent duplicates in the future.
Would it be possible to add in a mathematical equation to the code so that it is generated in a sequence (i.e. increments in 7’s), whilst also keeping the same code format (B followed by 8 digits = 9 character code)? Plus, is it possible for the system to know what code was generated before so that the correct number in the sequence can be given? Keeping the format of the code is the important bit.
I apologise if my choice of words is not too clear, I am not too familiar with the technicalities of coding.
You could use a webservice and external database to assign and keep track of used codes.
You could use a webservice and external database to assign and keep track of used codes.
Good solution
Thank you
External database means, mysql, ms access etc to save the data in tables.
Leave a Reply
Enter your E-mail address. We'll send you an e-mail with instructions to reset your password.