Millisecond Online Community

Forums & Feeds
Welcome to Millisecond Online Community Sign in | Join | Help
in Search

generating and displaying a random number

Last post 07-07-2008, 8:18 AM by seandr. 1 replies.
Sort Posts: Previous Next
  •  06-25-2008, 11:18 PM 1698

    generating and displaying a random number

    I would like to have participants record a unique id number apart from his/her subject ID when after completing a set of tasks online. Is there a script that would generate a random number without replacement and then display it?  Again, this number should be different from the subject ID number which will be user entered.  Thank you in advance for your attention.
  •  07-07-2008, 8:18 AM 1716 in reply to 1698

    Re: generating and displaying a random number

    Hellow,

    Yes, you can display a randomly generated number. 

    To generate the number, use the rand function. Assuming you want the number to be an integer, you can use the round fuction to round it off. You can display the result in a text item as follows:

    <text randomnumber>
    / items = ("<% round(rand(1, 100000)) %>")
    </text>

    Hope this helps,

    Sean

View as RSS news feed in XML
Powered by Community Server, by Telligent Systems