Session IDs?


Author
Message
jdb
jdb
Respected Member (481 reputation)Respected Member (481 reputation)Respected Member (481 reputation)Respected Member (481 reputation)Respected Member (481 reputation)Respected Member (481 reputation)Respected Member (481 reputation)Respected Member (481 reputation)Respected Member (481 reputation)
Group: Forum Members
Posts: 6, Visits: 18
I am running a web script. I want participants to manually enter their IDs. I also want to send a "session ID" through the URL, e.g.,
http://research.millisecond.com/example/myexperiment.web?sessionid=1
Can I do this? Will it be recorded? And, more importantly, can I access that info in the script? I'd like to be able to say "present stimuli from this list for session 1 but this other list for session 2." Seems pretty easy, but I can't figure it out.

Dave
Dave
Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)
Group: Administrators
Posts: 13K, Visits: 104K
jdb - Monday, February 13, 2017
I am running a web script. I want participants to manually enter their IDs. I also want to send a "session ID" through the URL, e.g.,
http://research.millisecond.com/example/myexperiment.web?sessionid=1
Can I do this? Will it be recorded? And, more importantly, can I access that info in the script? I'd like to be able to say "present stimuli from this list for session 1 but this other list for session 2." Seems pretty easy, but I can't figure it out.

You can configure the web experiment up to read the "sessionid" query parameter and use it as the script's group id via the web experiment's settings (in the Subject ID's step). The value of the query parameter (e.g. 1 or 2) will be recorded in the data file's 'group' column, and you can access the parameter's value via the script.groupid property, i.e.

> I'd like to be able to say "present stimuli from this list for session 1 but this other list for session 2."

If you set up your script to treat this as a standard between-subjects condition, you can base the assignment on the session id provided by the query parameter:

<expt list1>
/ subjects = (1 of 2)
/ groupassignment = groupnumber
...
</expt>

<expt list2>
/ subjects = (2 of 2)
/ groupassignment = groupnumber
...
</expt>

If used as group id, you can access the value of the query parameter at any time in the script via the script.groupid property:

<text sessionid>
/ items = ("The provided session ID is <%script.groupid%>.")
</text>

jdb
jdb
Respected Member (481 reputation)Respected Member (481 reputation)Respected Member (481 reputation)Respected Member (481 reputation)Respected Member (481 reputation)Respected Member (481 reputation)Respected Member (481 reputation)Respected Member (481 reputation)Respected Member (481 reputation)
Group: Forum Members
Posts: 6, Visits: 18
Dave - Monday, February 13, 2017
jdb - Monday, February 13, 2017
I am running a web script. I want participants to manually enter their IDs. I also want to send a "session ID" through the URL, e.g.,
http://research.millisecond.com/example/myexperiment.web?sessionid=1
Can I do this? Will it be recorded? And, more importantly, can I access that info in the script? I'd like to be able to say "present stimuli from this list for session 1 but this other list for session 2." Seems pretty easy, but I can't figure it out.

You can configure the web experiment up to read the "sessionid" query parameter and use it as the script's group id via the web experiment's settings (in the Subject ID's step). The value of the query parameter (e.g. 1 or 2) will be recorded in the data file's 'group' column, and you can access the parameter's value via the script.groupid property, i.e.

> I'd like to be able to say "present stimuli from this list for session 1 but this other list for session 2."

If you set up your script to treat this as a standard between-subjects condition, you can base the assignment on the session id provided by the query parameter:

<expt list1>
/ subjects = (1 of 2)
/ groupassignment = groupnumber
...
</expt>

<expt list2>
/ subjects = (2 of 2)
/ groupassignment = groupnumber
...
</expt>

If used as group id, you can access the value of the query parameter at any time in the script via the script.groupid property:

<text sessionid>
/ items = ("The provided session ID is <%script.groupid%>.")
</text>

Thanks for the response! I'll give it a try.

GO

Merge Selected

Merge into selected topic...



Merge into merge target...



Merge into a specific topic ID...




Reading This Topic

Explore
Messages
Mentions
Search