How to redirect participants to different urls, depending on their groupid


Author
Message
carolin.m
carolin.m
Esteemed Member (1.9K reputation)Esteemed Member (1.9K reputation)Esteemed Member (1.9K reputation)Esteemed Member (1.9K reputation)Esteemed Member (1.9K reputation)Esteemed Member (1.9K reputation)Esteemed Member (1.9K reputation)Esteemed Member (1.9K reputation)Esteemed Member (1.9K reputation)
Group: Forum Members
Posts: 19, Visits: 54
Dave - Monday, July 31, 2017
carolin.m - Monday, July 31, 2017
Dave - Monday, July 10, 2017
carolin.m - Monday, July 10, 2017
Dave - Thursday, September 1, 2016
So, here's a little script to test:

Condition 1:
http://research.millisecond.com/david.nitz/redir.web?groupid=1
Condition 2:
http://research.millisecond.com/david.nitz/redir.web?groupid=2
Condition 3:
http://research.millisecond.com/david.nitz/redir.web?groupid=3
Condition 4:
http://research.millisecond.com/david.nitz/redir.web?groupid=4

Redirection to different URLs depending on the group id works perfectly fine for me. This is the entirety of the code:

<expt>
/ onexptbegin = [if (mod(script.groupid, 4) == 1) {defaults.finishpage = "http://www.example.com/"}; ]
/ onexptbegin = [if (mod(script.groupid, 4) == 2) {defaults.finishpage = "http://www.google.com/"}; ]
/ onexptbegin = [if (mod(script.groupid, 4) == 3) {defaults.finishpage = "http://www.yahoo.com/"}; ]
/ onexptbegin = [if (mod(script.groupid, 4) == 0) {defaults.finishpage = "http://www.bing.com/"}; ]
/ blocks = [1=myblock]
</expt>

<block myblock>
/ trials = [1=mytrial]
</block>

<trial mytrial>
/ stimulusframes = [1=mytext]
/ validresponse = (57)
</trial>

<text mytext>
/ items = ("Your group id is <%script.groupid%>.~nYou'll be redirected to <%defaults.finishpage%>.")
/ size = (75%, 50%)
</text>

Direct link to the script: http://www.millisecond.com/myaccount/scripts/david.nitz/redir/redir.iqx

When you run this, are you being redirected or not?
Hello Dave,

where exactly in the script do I add these information:
<expt>
/ onexptbegin = [if (mod(script.groupid, 4) == 1) {defaults.finishpage = "http://www.example.com/"}; ]
/ onexptbegin = [if (mod(script.groupid, 4) == 2) {defaults.finishpage = "http://www.google.com/"}; ]
/ onexptbegin = [if (mod(script.groupid, 4) == 3) {defaults.finishpage = "http://www.yahoo.com/"}; ]
/ onexptbegin = [if (mod(script.groupid, 4) == 0) {defaults.finishpage = "http://www.bing.com/"}; ]
/ blocks = [1=myblock]
</expt>

Apparently I can't find the right spot in my script :-/
Thanks!

Suppose you have two groupids. Groupid equal to 1 indicates that the participant came from referral site A. Groupid equal to 2 indicates that the participant came from referral site B. I.e.

Site A -> http://research.millisecond.com/yourusername/yourexperimentname.web?subjectid=someuniqueidentifier&groupid=1&studyid=a
and
Site B -> http://research.millisecond.com/yourusername/yourexperimentname.web?subjectid=someuniqueidentifier&groupid=2&studyid=b

Depending on where they came from, you want to to send them back to either Site A or B, and pass on the subjectid and studyid contained in the original link.

You do
<expt>
/ onexptbegin = [if (mod(script.groupid, 2) == 1) {defaults.finishpage = text.url.item.1}; ]
/ onexptbegin = [if (mod(script.groupid, 2) == 0) {defaults.finishpage = text.url.item.2}; ]
...
</expt>

with

<text url>
/ items = urlitems
</text>

<item urlitems>
/ 1 = "http://sitea.com/?subjectid=<%script.subjectid%>&studyid=a"
/ 2 = "http://siteb.com/?subjectid=<%script.subjectid%>&studyid=b"
</item>

Hello Dave, although the other issue is solved now this problem still occurs:
I want to refer my participants to two different webpages after the inquisit task, depending on the web page they came from.
I am pretty sure that I adjusted everything as described by you. However, sometimes participants get forwarded to the correct link and sometimes they get forwarded to the wrong link. What could be wrong?
Please see below the important parts of my script:

Site A: http://research.millisecond.com/carolinmuschalik/singlecategorypictureiat_rood_vlees.web?subjectid=123&study=999&groupid=1
Site B: http://research.millisecond.com/carolinmuschalik/singlecategorypictureiat_rood_vlees.web?subjectid=123&study=999&groupid=2

<expt>
/ onexptbegin = [if (mod(script.groupid, 2) == 1) {defaults.finishpage = text.url.item.1}; ]
/ onexptbegin = [if (mod(script.groupid, 2) == 0) {defaults.finishpage = text.url.item.2}; ]
</expt>

<expt>
/subjects = (1 of 2)
/groupassignment = groupnumber
/ blocks = [1=practice_compatibletest; 2=compatibletestinstructions; 3=compatibletest;
 4=practice_incompatibletest; 5=incompatibletestinstructions; 6=incompatibletest; 7=summary]
/onexptend = [values.completed = 1]
</expt>

<expt>
/subjects = (2 of 2)
/groupassignment = groupnumber
/ blocks = [1=practice_incompatibletest; 2=incompatibletestinstructions; 3=incompatibletest;
4=practice_compatibletest; 5=compatibletestinstructions; 6=compatibletest; 7=summary]
/onexptend = [values.completed = 1]
</expt>

<text url>
/ items = urlitems
</text>

<item urlitems>
/ 1 = "http://fd8.formdesk.com/umhag/vlees_consumptie2?page=3&nr=<%script.subjectid%>&study=184680">http://fd8.formdesk.com/umhag/vlees_consumptie2?page=3&nr=<%script.subjectid%>&study=184680">http://fd8.formdesk.com/umhag/vlees_consumptie2?page=3&nr=<%script.subjectid%>&study=184680">http://fd8.formdesk.com/umhag/vlees_consumptie2?page=3&nr=<%script.subjectid%>&study=184680"
/ 2 = "http://fd8.formdesk.com/umhag/kopie_van_vlees_consumptie2?page=3&nr=<%script.subjectid%>&study=184680">http://fd8.formdesk.com/umhag/kopie_van_vlees_consumptie2?page=3&nr=<%script.subjectid%>&study=184680">http://fd8.formdesk.com/umhag/kopie_van_vlees_consumptie2?page=3&nr=<%script.subjectid%>&study=184680">http://fd8.formdesk.com/umhag/kopie_van_vlees_consumptie2?page=3&nr=<%script.subjectid%>&study=184680"
</item>

It would be great if you could help me with that!
Thanks in advance!



> However, sometimes participants get forwarded to the correct link and sometimes they get forwarded to the wrong link.

Could you please show me the data you based this conclusion on?

And, for what it's worth, you can simplify your code and get rid of the 1st <expt> element:

<expt>
/ onexptbegin = [defaults.finishpage = text.url.item.1; ]
/subjects = (1 of 2)
/groupassignment = groupnumber
/ blocks = [1=practice_compatibletest; 2=compatibletestinstructions; 3=compatibletest;
 4=practice_incompatibletest; 5=incompatibletestinstructions; 6=incompatibletest; 7=summary]
/onexptend = [values.completed = 1]
</expt>

<expt>
/ onexptbegin = [defaults.finishpage = text.url.item.2; ]
/subjects = (2 of 2)
/groupassignment = groupnumber
/ blocks = [1=practice_incompatibletest; 2=incompatibletestinstructions; 3=incompatibletest;
4=practice_compatibletest; 5=compatibletestinstructions; 6=compatibletest; 7=summary]
/onexptend = [values.completed = 1]
</expt>

Hello Dave,
in which form could I show you the data?
I tried it more than a several times now and I realized that when the inquisit task starts with the compatible block first, participants get forwarded to link 1, and when inquisit starts with the incompatible block, participants get forwarded to link 2. So there seems to be something wrong with that.

Any idea what it could be?

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: 12K, Visits: 85K
carolin.m - Tuesday, August 1, 2017
Dave - Monday, July 31, 2017
carolin.m - Monday, July 31, 2017
Dave - Monday, July 10, 2017
carolin.m - Monday, July 10, 2017
Dave - Thursday, September 1, 2016
So, here's a little script to test:

Condition 1:
http://research.millisecond.com/david.nitz/redir.web?groupid=1
Condition 2:
http://research.millisecond.com/david.nitz/redir.web?groupid=2
Condition 3:
http://research.millisecond.com/david.nitz/redir.web?groupid=3
Condition 4:
http://research.millisecond.com/david.nitz/redir.web?groupid=4

Redirection to different URLs depending on the group id works perfectly fine for me. This is the entirety of the code:

<expt>
/ onexptbegin = [if (mod(script.groupid, 4) == 1) {defaults.finishpage = "http://www.example.com/"}; ]
/ onexptbegin = [if (mod(script.groupid, 4) == 2) {defaults.finishpage = "http://www.google.com/"}; ]
/ onexptbegin = [if (mod(script.groupid, 4) == 3) {defaults.finishpage = "http://www.yahoo.com/"}; ]
/ onexptbegin = [if (mod(script.groupid, 4) == 0) {defaults.finishpage = "http://www.bing.com/"}; ]
/ blocks = [1=myblock]
</expt>

<block myblock>
/ trials = [1=mytrial]
</block>

<trial mytrial>
/ stimulusframes = [1=mytext]
/ validresponse = (57)
</trial>

<text mytext>
/ items = ("Your group id is <%script.groupid%>.~nYou'll be redirected to <%defaults.finishpage%>.")
/ size = (75%, 50%)
</text>

Direct link to the script: http://www.millisecond.com/myaccount/scripts/david.nitz/redir/redir.iqx

When you run this, are you being redirected or not?
Hello Dave,

where exactly in the script do I add these information:
<expt>
/ onexptbegin = [if (mod(script.groupid, 4) == 1) {defaults.finishpage = "http://www.example.com/"}; ]
/ onexptbegin = [if (mod(script.groupid, 4) == 2) {defaults.finishpage = "http://www.google.com/"}; ]
/ onexptbegin = [if (mod(script.groupid, 4) == 3) {defaults.finishpage = "http://www.yahoo.com/"}; ]
/ onexptbegin = [if (mod(script.groupid, 4) == 0) {defaults.finishpage = "http://www.bing.com/"}; ]
/ blocks = [1=myblock]
</expt>

Apparently I can't find the right spot in my script :-/
Thanks!

Suppose you have two groupids. Groupid equal to 1 indicates that the participant came from referral site A. Groupid equal to 2 indicates that the participant came from referral site B. I.e.

Site A -> http://research.millisecond.com/yourusername/yourexperimentname.web?subjectid=someuniqueidentifier&groupid=1&studyid=a
and
Site B -> http://research.millisecond.com/yourusername/yourexperimentname.web?subjectid=someuniqueidentifier&groupid=2&studyid=b

Depending on where they came from, you want to to send them back to either Site A or B, and pass on the subjectid and studyid contained in the original link.

You do
<expt>
/ onexptbegin = [if (mod(script.groupid, 2) == 1) {defaults.finishpage = text.url.item.1}; ]
/ onexptbegin = [if (mod(script.groupid, 2) == 0) {defaults.finishpage = text.url.item.2}; ]
...
</expt>

with

<text url>
/ items = urlitems
</text>

<item urlitems>
/ 1 = "http://sitea.com/?subjectid=<%script.subjectid%>&studyid=a"
/ 2 = "http://siteb.com/?subjectid=<%script.subjectid%>&studyid=b"
</item>

Hello Dave, although the other issue is solved now this problem still occurs:
I want to refer my participants to two different webpages after the inquisit task, depending on the web page they came from.
I am pretty sure that I adjusted everything as described by you. However, sometimes participants get forwarded to the correct link and sometimes they get forwarded to the wrong link. What could be wrong?
Please see below the important parts of my script:

Site A: http://research.millisecond.com/carolinmuschalik/singlecategorypictureiat_rood_vlees.web?subjectid=123&study=999&groupid=1
Site B: http://research.millisecond.com/carolinmuschalik/singlecategorypictureiat_rood_vlees.web?subjectid=123&study=999&groupid=2

<expt>
/ onexptbegin = [if (mod(script.groupid, 2) == 1) {defaults.finishpage = text.url.item.1}; ]
/ onexptbegin = [if (mod(script.groupid, 2) == 0) {defaults.finishpage = text.url.item.2}; ]
</expt>

<expt>
/subjects = (1 of 2)
/groupassignment = groupnumber
/ blocks = [1=practice_compatibletest; 2=compatibletestinstructions; 3=compatibletest;
 4=practice_incompatibletest; 5=incompatibletestinstructions; 6=incompatibletest; 7=summary]
/onexptend = [values.completed = 1]
</expt>

<expt>
/subjects = (2 of 2)
/groupassignment = groupnumber
/ blocks = [1=practice_incompatibletest; 2=incompatibletestinstructions; 3=incompatibletest;
4=practice_compatibletest; 5=compatibletestinstructions; 6=compatibletest; 7=summary]
/onexptend = [values.completed = 1]
</expt>

<text url>
/ items = urlitems
</text>

<item urlitems>
/ 1 = "http://fd8.formdesk.com/umhag/vlees_consumptie2?page=3&nr=<%script.subjectid%>&study=184680">http://fd8.formdesk.com/umhag/vlees_consumptie2?page=3&nr=<%script.subjectid%>&study=184680">http://fd8.formdesk.com/umhag/vlees_consumptie2?page=3&nr=<%script.subjectid%>&study=184680">http://fd8.formdesk.com/umhag/vlees_consumptie2?page=3&nr=<%script.subjectid%>&study=184680">http://fd8.formdesk.com/umhag/vlees_consumptie2?page=3&nr=<%script.subjectid%>&study=184680"
/ 2 = "http://fd8.formdesk.com/umhag/kopie_van_vlees_consumptie2?page=3&nr=<%script.subjectid%>&study=184680">http://fd8.formdesk.com/umhag/kopie_van_vlees_consumptie2?page=3&nr=<%script.subjectid%>&study=184680">http://fd8.formdesk.com/umhag/kopie_van_vlees_consumptie2?page=3&nr=<%script.subjectid%>&study=184680">http://fd8.formdesk.com/umhag/kopie_van_vlees_consumptie2?page=3&nr=<%script.subjectid%>&study=184680">http://fd8.formdesk.com/umhag/kopie_van_vlees_consumptie2?page=3&nr=<%script.subjectid%>&study=184680"
</item>

It would be great if you could help me with that!
Thanks in advance!



> However, sometimes participants get forwarded to the correct link and sometimes they get forwarded to the wrong link.

Could you please show me the data you based this conclusion on?

And, for what it's worth, you can simplify your code and get rid of the 1st <expt> element:

<expt>
/ onexptbegin = [defaults.finishpage = text.url.item.1; ]
/subjects = (1 of 2)
/groupassignment = groupnumber
/ blocks = [1=practice_compatibletest; 2=compatibletestinstructions; 3=compatibletest;
 4=practice_incompatibletest; 5=incompatibletestinstructions; 6=incompatibletest; 7=summary]
/onexptend = [values.completed = 1]
</expt>

<expt>
/ onexptbegin = [defaults.finishpage = text.url.item.2; ]
/subjects = (2 of 2)
/groupassignment = groupnumber
/ blocks = [1=practice_incompatibletest; 2=incompatibletestinstructions; 3=incompatibletest;
4=practice_compatibletest; 5=compatibletestinstructions; 6=compatibletest; 7=summary]
/onexptend = [values.completed = 1]
</expt>

Hello Dave,
in which form could I show you the data?
I tried it more than a several times now and I realized that when the inquisit task starts with the compatible block first, participants get forwarded to link 1, and when inquisit starts with the incompatible block, participants get forwarded to link 2. So there seems to be something wrong with that.

Any idea what it could be?

And why would that be wrong? That's exactly what the code is supposed to do. For odd group numbers, you want to re-direct to URL #1. For even group numbers you want to re-direct to URL #2. It just so happens that the IAT _also_ assigns conditions (i.e. different block orders: compatible first vs incompatible first) based on odd vs even group numbers, as you can see per the <expt> elements' /groupassignment attributes.

carolin.m
carolin.m
Esteemed Member (1.9K reputation)Esteemed Member (1.9K reputation)Esteemed Member (1.9K reputation)Esteemed Member (1.9K reputation)Esteemed Member (1.9K reputation)Esteemed Member (1.9K reputation)Esteemed Member (1.9K reputation)Esteemed Member (1.9K reputation)Esteemed Member (1.9K reputation)
Group: Forum Members
Posts: 19, Visits: 54
Dave - Tuesday, August 1, 2017
carolin.m - Tuesday, August 1, 2017
Dave - Monday, July 31, 2017
carolin.m - Monday, July 31, 2017
Dave - Monday, July 10, 2017
carolin.m - Monday, July 10, 2017
Dave - Thursday, September 1, 2016
So, here's a little script to test:

Condition 1:
http://research.millisecond.com/david.nitz/redir.web?groupid=1
Condition 2:
http://research.millisecond.com/david.nitz/redir.web?groupid=2
Condition 3:
http://research.millisecond.com/david.nitz/redir.web?groupid=3
Condition 4:
http://research.millisecond.com/david.nitz/redir.web?groupid=4

Redirection to different URLs depending on the group id works perfectly fine for me. This is the entirety of the code:

<expt>
/ onexptbegin = [if (mod(script.groupid, 4) == 1) {defaults.finishpage = "http://www.example.com/"}; ]
/ onexptbegin = [if (mod(script.groupid, 4) == 2) {defaults.finishpage = "http://www.google.com/"}; ]
/ onexptbegin = [if (mod(script.groupid, 4) == 3) {defaults.finishpage = "http://www.yahoo.com/"}; ]
/ onexptbegin = [if (mod(script.groupid, 4) == 0) {defaults.finishpage = "http://www.bing.com/"}; ]
/ blocks = [1=myblock]
</expt>

<block myblock>
/ trials = [1=mytrial]
</block>

<trial mytrial>
/ stimulusframes = [1=mytext]
/ validresponse = (57)
</trial>

<text mytext>
/ items = ("Your group id is <%script.groupid%>.~nYou'll be redirected to <%defaults.finishpage%>.")
/ size = (75%, 50%)
</text>

Direct link to the script: http://www.millisecond.com/myaccount/scripts/david.nitz/redir/redir.iqx

When you run this, are you being redirected or not?
Hello Dave,

where exactly in the script do I add these information:
<expt>
/ onexptbegin = [if (mod(script.groupid, 4) == 1) {defaults.finishpage = "http://www.example.com/"}; ]
/ onexptbegin = [if (mod(script.groupid, 4) == 2) {defaults.finishpage = "http://www.google.com/"}; ]
/ onexptbegin = [if (mod(script.groupid, 4) == 3) {defaults.finishpage = "http://www.yahoo.com/"}; ]
/ onexptbegin = [if (mod(script.groupid, 4) == 0) {defaults.finishpage = "http://www.bing.com/"}; ]
/ blocks = [1=myblock]
</expt>

Apparently I can't find the right spot in my script :-/
Thanks!

Suppose you have two groupids. Groupid equal to 1 indicates that the participant came from referral site A. Groupid equal to 2 indicates that the participant came from referral site B. I.e.

Site A -> http://research.millisecond.com/yourusername/yourexperimentname.web?subjectid=someuniqueidentifier&groupid=1&studyid=a
and
Site B -> http://research.millisecond.com/yourusername/yourexperimentname.web?subjectid=someuniqueidentifier&groupid=2&studyid=b

Depending on where they came from, you want to to send them back to either Site A or B, and pass on the subjectid and studyid contained in the original link.

You do
<expt>
/ onexptbegin = [if (mod(script.groupid, 2) == 1) {defaults.finishpage = text.url.item.1}; ]
/ onexptbegin = [if (mod(script.groupid, 2) == 0) {defaults.finishpage = text.url.item.2}; ]
...
</expt>

with

<text url>
/ items = urlitems
</text>

<item urlitems>
/ 1 = "http://sitea.com/?subjectid=<%script.subjectid%>&studyid=a"
/ 2 = "http://siteb.com/?subjectid=<%script.subjectid%>&studyid=b"
</item>

Hello Dave, although the other issue is solved now this problem still occurs:
I want to refer my participants to two different webpages after the inquisit task, depending on the web page they came from.
I am pretty sure that I adjusted everything as described by you. However, sometimes participants get forwarded to the correct link and sometimes they get forwarded to the wrong link. What could be wrong?
Please see below the important parts of my script:

Site A: http://research.millisecond.com/carolinmuschalik/singlecategorypictureiat_rood_vlees.web?subjectid=123&study=999&groupid=1
Site B: http://research.millisecond.com/carolinmuschalik/singlecategorypictureiat_rood_vlees.web?subjectid=123&study=999&groupid=2

<expt>
/ onexptbegin = [if (mod(script.groupid, 2) == 1) {defaults.finishpage = text.url.item.1}; ]
/ onexptbegin = [if (mod(script.groupid, 2) == 0) {defaults.finishpage = text.url.item.2}; ]
</expt>

<expt>
/subjects = (1 of 2)
/groupassignment = groupnumber
/ blocks = [1=practice_compatibletest; 2=compatibletestinstructions; 3=compatibletest;
 4=practice_incompatibletest; 5=incompatibletestinstructions; 6=incompatibletest; 7=summary]
/onexptend = [values.completed = 1]
</expt>

<expt>
/subjects = (2 of 2)
/groupassignment = groupnumber
/ blocks = [1=practice_incompatibletest; 2=incompatibletestinstructions; 3=incompatibletest;
4=practice_compatibletest; 5=compatibletestinstructions; 6=compatibletest; 7=summary]
/onexptend = [values.completed = 1]
</expt>

<text url>
/ items = urlitems
</text>

<item urlitems>
/ 1 = "http://fd8.formdesk.com/umhag/vlees_consumptie2?page=3&nr=<%script.subjectid%>&study=184680">http://fd8.formdesk.com/umhag/vlees_consumptie2?page=3&nr=<%script.subjectid%>&study=184680">http://fd8.formdesk.com/umhag/vlees_consumptie2?page=3&nr=<%script.subjectid%>&study=184680">http://fd8.formdesk.com/umhag/vlees_consumptie2?page=3&nr=<%script.subjectid%>&study=184680">http://fd8.formdesk.com/umhag/vlees_consumptie2?page=3&nr=<%script.subjectid%>&study=184680">http://fd8.formdesk.com/umhag/vlees_consumptie2?page=3&nr=<%script.subjectid%>&study=184680"
/ 2 = "http://fd8.formdesk.com/umhag/kopie_van_vlees_consumptie2?page=3&nr=<%script.subjectid%>&study=184680">http://fd8.formdesk.com/umhag/kopie_van_vlees_consumptie2?page=3&nr=<%script.subjectid%>&study=184680">http://fd8.formdesk.com/umhag/kopie_van_vlees_consumptie2?page=3&nr=<%script.subjectid%>&study=184680">http://fd8.formdesk.com/umhag/kopie_van_vlees_consumptie2?page=3&nr=<%script.subjectid%>&study=184680">http://fd8.formdesk.com/umhag/kopie_van_vlees_consumptie2?page=3&nr=<%script.subjectid%>&study=184680">http://fd8.formdesk.com/umhag/kopie_van_vlees_consumptie2?page=3&nr=<%script.subjectid%>&study=184680"
</item>

It would be great if you could help me with that!
Thanks in advance!



> However, sometimes participants get forwarded to the correct link and sometimes they get forwarded to the wrong link.

Could you please show me the data you based this conclusion on?

And, for what it's worth, you can simplify your code and get rid of the 1st <expt> element:

<expt>
/ onexptbegin = [defaults.finishpage = text.url.item.1; ]
/subjects = (1 of 2)
/groupassignment = groupnumber
/ blocks = [1=practice_compatibletest; 2=compatibletestinstructions; 3=compatibletest;
 4=practice_incompatibletest; 5=incompatibletestinstructions; 6=incompatibletest; 7=summary]
/onexptend = [values.completed = 1]
</expt>

<expt>
/ onexptbegin = [defaults.finishpage = text.url.item.2; ]
/subjects = (2 of 2)
/groupassignment = groupnumber
/ blocks = [1=practice_incompatibletest; 2=incompatibletestinstructions; 3=incompatibletest;
4=practice_compatibletest; 5=compatibletestinstructions; 6=compatibletest; 7=summary]
/onexptend = [values.completed = 1]
</expt>

Hello Dave,
in which form could I show you the data?
I tried it more than a several times now and I realized that when the inquisit task starts with the compatible block first, participants get forwarded to link 1, and when inquisit starts with the incompatible block, participants get forwarded to link 2. So there seems to be something wrong with that.

Any idea what it could be?

And why would that be wrong? That's exactly what the code is supposed to do. For odd group numbers, you want to re-direct to URL #1. For even group numbers you want to re-direct to URL #2. It just so happens that the IAT _also_ assigns conditions (i.e. different block orders: compatible first vs incompatible first) based on odd vs even group numbers, as you can see per the <expt> elements' /groupassignment attributes.

 

I want the participants with the group ID = 1 to always getforwarded to the link

https://fd8.formdesk.com/umhag/vlees_consumptie2?page=3&def_nr=2345&def_study=007

and participants with the group ID = 2 to always get forwardedto the link

https://fd8.formdesk.com/umhag/kopie_van_vlees_consumptie2?page=3&def_nr=2345&def_study=007

independent of with which block they start the inquisittask.

 

At the moment however if someone comes from the group with the ID = 1 and gets the incompatibleblock first, he/she gets forwarded to

https://fd8.formdesk.com/umhag/kopie_van_vlees_consumptie2?page=3&def_nr=2345&def_study=007

which is wrong for my experiment.

The same issue applies to the people who have the group ID = 2 but get the compatible blockfirst. They get forwarded to

https://fd8.formdesk.com/umhag/vlees_consumptie2?page=3&def_nr=2345&def_study=007

but I want them to always get forwarded to

https://fd8.formdesk.com/umhag/kopie_van_vlees_consumptie2?page=3&def_nr=2345&def_study=007

Is this understandable? And how could I solve this issue?

Many thanks in advance!

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: 12K, Visits: 85K
carolin.m - Thursday, August 3, 2017
Dave - Tuesday, August 1, 2017
carolin.m - Tuesday, August 1, 2017
Dave - Monday, July 31, 2017
carolin.m - Monday, July 31, 2017
Dave - Monday, July 10, 2017
carolin.m - Monday, July 10, 2017
Dave - Thursday, September 1, 2016
So, here's a little script to test:

Condition 1:
http://research.millisecond.com/david.nitz/redir.web?groupid=1
Condition 2:
http://research.millisecond.com/david.nitz/redir.web?groupid=2
Condition 3:
http://research.millisecond.com/david.nitz/redir.web?groupid=3
Condition 4:
http://research.millisecond.com/david.nitz/redir.web?groupid=4

Redirection to different URLs depending on the group id works perfectly fine for me. This is the entirety of the code:

<expt>
/ onexptbegin = [if (mod(script.groupid, 4) == 1) {defaults.finishpage = "http://www.example.com/"}; ]
/ onexptbegin = [if (mod(script.groupid, 4) == 2) {defaults.finishpage = "http://www.google.com/"}; ]
/ onexptbegin = [if (mod(script.groupid, 4) == 3) {defaults.finishpage = "http://www.yahoo.com/"}; ]
/ onexptbegin = [if (mod(script.groupid, 4) == 0) {defaults.finishpage = "http://www.bing.com/"}; ]
/ blocks = [1=myblock]
</expt>

<block myblock>
/ trials = [1=mytrial]
</block>

<trial mytrial>
/ stimulusframes = [1=mytext]
/ validresponse = (57)
</trial>

<text mytext>
/ items = ("Your group id is <%script.groupid%>.~nYou'll be redirected to <%defaults.finishpage%>.")
/ size = (75%, 50%)
</text>

Direct link to the script: http://www.millisecond.com/myaccount/scripts/david.nitz/redir/redir.iqx

When you run this, are you being redirected or not?
Hello Dave,

where exactly in the script do I add these information:
<expt>
/ onexptbegin = [if (mod(script.groupid, 4) == 1) {defaults.finishpage = "http://www.example.com/"}; ]
/ onexptbegin = [if (mod(script.groupid, 4) == 2) {defaults.finishpage = "http://www.google.com/"}; ]
/ onexptbegin = [if (mod(script.groupid, 4) == 3) {defaults.finishpage = "http://www.yahoo.com/"}; ]
/ onexptbegin = [if (mod(script.groupid, 4) == 0) {defaults.finishpage = "http://www.bing.com/"}; ]
/ blocks = [1=myblock]
</expt>

Apparently I can't find the right spot in my script :-/
Thanks!

Suppose you have two groupids. Groupid equal to 1 indicates that the participant came from referral site A. Groupid equal to 2 indicates that the participant came from referral site B. I.e.

Site A -> http://research.millisecond.com/yourusername/yourexperimentname.web?subjectid=someuniqueidentifier&groupid=1&studyid=a
and
Site B -> http://research.millisecond.com/yourusername/yourexperimentname.web?subjectid=someuniqueidentifier&groupid=2&studyid=b

Depending on where they came from, you want to to send them back to either Site A or B, and pass on the subjectid and studyid contained in the original link.

You do
<expt>
/ onexptbegin = [if (mod(script.groupid, 2) == 1) {defaults.finishpage = text.url.item.1}; ]
/ onexptbegin = [if (mod(script.groupid, 2) == 0) {defaults.finishpage = text.url.item.2}; ]
...
</expt>

with

<text url>
/ items = urlitems
</text>

<item urlitems>
/ 1 = "http://sitea.com/?subjectid=<%script.subjectid%>&studyid=a"
/ 2 = "http://siteb.com/?subjectid=<%script.subjectid%>&studyid=b"
</item>

Hello Dave, although the other issue is solved now this problem still occurs:
I want to refer my participants to two different webpages after the inquisit task, depending on the web page they came from.
I am pretty sure that I adjusted everything as described by you. However, sometimes participants get forwarded to the correct link and sometimes they get forwarded to the wrong link. What could be wrong?
Please see below the important parts of my script:

Site A: http://research.millisecond.com/carolinmuschalik/singlecategorypictureiat_rood_vlees.web?subjectid=123&study=999&groupid=1
Site B: http://research.millisecond.com/carolinmuschalik/singlecategorypictureiat_rood_vlees.web?subjectid=123&study=999&groupid=2

<expt>
/ onexptbegin = [if (mod(script.groupid, 2) == 1) {defaults.finishpage = text.url.item.1}; ]
/ onexptbegin = [if (mod(script.groupid, 2) == 0) {defaults.finishpage = text.url.item.2}; ]
</expt>

<expt>
/subjects = (1 of 2)
/groupassignment = groupnumber
/ blocks = [1=practice_compatibletest; 2=compatibletestinstructions; 3=compatibletest;
 4=practice_incompatibletest; 5=incompatibletestinstructions; 6=incompatibletest; 7=summary]
/onexptend = [values.completed = 1]
</expt>

<expt>
/subjects = (2 of 2)
/groupassignment = groupnumber
/ blocks = [1=practice_incompatibletest; 2=incompatibletestinstructions; 3=incompatibletest;
4=practice_compatibletest; 5=compatibletestinstructions; 6=compatibletest; 7=summary]
/onexptend = [values.completed = 1]
</expt>

<text url>
/ items = urlitems
</text>

<item urlitems>
/ 1 = "http://fd8.formdesk.com/umhag/vlees_consumptie2?page=3&nr=<%script.subjectid%>&study=184680">http://fd8.formdesk.com/umhag/vlees_consumptie2?page=3&nr=<%script.subjectid%>&study=184680">http://fd8.formdesk.com/umhag/vlees_consumptie2?page=3&nr=<%script.subjectid%>&study=184680">http://fd8.formdesk.com/umhag/vlees_consumptie2?page=3&nr=<%script.subjectid%>&study=184680">http://fd8.formdesk.com/umhag/vlees_consumptie2?page=3&nr=<%script.subjectid%>&study=184680">http://fd8.formdesk.com/umhag/vlees_consumptie2?page=3&nr=<%script.subjectid%>&study=184680">http://fd8.formdesk.com/umhag/vlees_consumptie2?page=3&nr=<%script.subjectid%>&study=184680"
/ 2 = "http://fd8.formdesk.com/umhag/kopie_van_vlees_consumptie2?page=3&nr=<%script.subjectid%>&study=184680">http://fd8.formdesk.com/umhag/kopie_van_vlees_consumptie2?page=3&nr=<%script.subjectid%>&study=184680">http://fd8.formdesk.com/umhag/kopie_van_vlees_consumptie2?page=3&nr=<%script.subjectid%>&study=184680">http://fd8.formdesk.com/umhag/kopie_van_vlees_consumptie2?page=3&nr=<%script.subjectid%>&study=184680">http://fd8.formdesk.com/umhag/kopie_van_vlees_consumptie2?page=3&nr=<%script.subjectid%>&study=184680">http://fd8.formdesk.com/umhag/kopie_van_vlees_consumptie2?page=3&nr=<%script.subjectid%>&study=184680">http://fd8.formdesk.com/umhag/kopie_van_vlees_consumptie2?page=3&nr=<%script.subjectid%>&study=184680"
</item>

It would be great if you could help me with that!
Thanks in advance!



> However, sometimes participants get forwarded to the correct link and sometimes they get forwarded to the wrong link.

Could you please show me the data you based this conclusion on?

And, for what it's worth, you can simplify your code and get rid of the 1st <expt> element:

<expt>
/ onexptbegin = [defaults.finishpage = text.url.item.1; ]
/subjects = (1 of 2)
/groupassignment = groupnumber
/ blocks = [1=practice_compatibletest; 2=compatibletestinstructions; 3=compatibletest;
 4=practice_incompatibletest; 5=incompatibletestinstructions; 6=incompatibletest; 7=summary]
/onexptend = [values.completed = 1]
</expt>

<expt>
/ onexptbegin = [defaults.finishpage = text.url.item.2; ]
/subjects = (2 of 2)
/groupassignment = groupnumber
/ blocks = [1=practice_incompatibletest; 2=incompatibletestinstructions; 3=incompatibletest;
4=practice_compatibletest; 5=compatibletestinstructions; 6=compatibletest; 7=summary]
/onexptend = [values.completed = 1]
</expt>

Hello Dave,
in which form could I show you the data?
I tried it more than a several times now and I realized that when the inquisit task starts with the compatible block first, participants get forwarded to link 1, and when inquisit starts with the incompatible block, participants get forwarded to link 2. So there seems to be something wrong with that.

Any idea what it could be?

And why would that be wrong? That's exactly what the code is supposed to do. For odd group numbers, you want to re-direct to URL #1. For even group numbers you want to re-direct to URL #2. It just so happens that the IAT _also_ assigns conditions (i.e. different block orders: compatible first vs incompatible first) based on odd vs even group numbers, as you can see per the <expt> elements' /groupassignment attributes.

 

I want the participants with the group ID = 1 to always getforwarded to the link

https://fd8.formdesk.com/umhag/vlees_consumptie2?page=3&def_nr=2345&def_study=007

and participants with the group ID = 2 to always get forwardedto the link

https://fd8.formdesk.com/umhag/kopie_van_vlees_consumptie2?page=3&def_nr=2345&def_study=007

independent of with which block they start the inquisittask.

 

At the moment however if someone comes from the group with the ID = 1 and gets the incompatibleblock first, he/she gets forwarded to

https://fd8.formdesk.com/umhag/kopie_van_vlees_consumptie2?page=3&def_nr=2345&def_study=007

which is wrong for my experiment.

The same issue applies to the people who have the group ID = 2 but get the compatible blockfirst. They get forwarded to

https://fd8.formdesk.com/umhag/vlees_consumptie2?page=3&def_nr=2345&def_study=007

but I want them to always get forwarded to

https://fd8.formdesk.com/umhag/kopie_van_vlees_consumptie2?page=3&def_nr=2345&def_study=007

Is this understandable? And how could I solve this issue?

Many thanks in advance!

Then you need to change how the script assigns the IAT conditions (block order), i.e. you need to decouple it from the group ID which you want to independently use to determine the redirection URL. You can either set /grouassignment = subjectnumber for the IAT to do condition assignment based on a numerical subject ID (it _will not_ work with a non-numerical ID), or set /grouassignment = random for completely random assignment to one of the IAT block orders.

carolin.m
carolin.m
Esteemed Member (1.9K reputation)Esteemed Member (1.9K reputation)Esteemed Member (1.9K reputation)Esteemed Member (1.9K reputation)Esteemed Member (1.9K reputation)Esteemed Member (1.9K reputation)Esteemed Member (1.9K reputation)Esteemed Member (1.9K reputation)Esteemed Member (1.9K reputation)
Group: Forum Members
Posts: 19, Visits: 54
Dave - Thursday, August 3, 2017
carolin.m - Thursday, August 3, 2017
Dave - Tuesday, August 1, 2017
carolin.m - Tuesday, August 1, 2017
Dave - Monday, July 31, 2017
carolin.m - Monday, July 31, 2017
Dave - Monday, July 10, 2017
carolin.m - Monday, July 10, 2017
Dave - Thursday, September 1, 2016
So, here's a little script to test:

Condition 1:
http://research.millisecond.com/david.nitz/redir.web?groupid=1
Condition 2:
http://research.millisecond.com/david.nitz/redir.web?groupid=2
Condition 3:
http://research.millisecond.com/david.nitz/redir.web?groupid=3
Condition 4:
http://research.millisecond.com/david.nitz/redir.web?groupid=4

Redirection to different URLs depending on the group id works perfectly fine for me. This is the entirety of the code:

<expt>
/ onexptbegin = [if (mod(script.groupid, 4) == 1) {defaults.finishpage = "http://www.example.com/"}; ]
/ onexptbegin = [if (mod(script.groupid, 4) == 2) {defaults.finishpage = "http://www.google.com/"}; ]
/ onexptbegin = [if (mod(script.groupid, 4) == 3) {defaults.finishpage = "http://www.yahoo.com/"}; ]
/ onexptbegin = [if (mod(script.groupid, 4) == 0) {defaults.finishpage = "http://www.bing.com/"}; ]
/ blocks = [1=myblock]
</expt>

<block myblock>
/ trials = [1=mytrial]
</block>

<trial mytrial>
/ stimulusframes = [1=mytext]
/ validresponse = (57)
</trial>

<text mytext>
/ items = ("Your group id is <%script.groupid%>.~nYou'll be redirected to <%defaults.finishpage%>.")
/ size = (75%, 50%)
</text>

Direct link to the script: http://www.millisecond.com/myaccount/scripts/david.nitz/redir/redir.iqx

When you run this, are you being redirected or not?
Hello Dave,

where exactly in the script do I add these information:
<expt>
/ onexptbegin = [if (mod(script.groupid, 4) == 1) {defaults.finishpage = "http://www.example.com/"}; ]
/ onexptbegin = [if (mod(script.groupid, 4) == 2) {defaults.finishpage = "http://www.google.com/"}; ]
/ onexptbegin = [if (mod(script.groupid, 4) == 3) {defaults.finishpage = "http://www.yahoo.com/"}; ]
/ onexptbegin = [if (mod(script.groupid, 4) == 0) {defaults.finishpage = "http://www.bing.com/"}; ]
/ blocks = [1=myblock]
</expt>

Apparently I can't find the right spot in my script :-/
Thanks!

Suppose you have two groupids. Groupid equal to 1 indicates that the participant came from referral site A. Groupid equal to 2 indicates that the participant came from referral site B. I.e.

Site A -> http://research.millisecond.com/yourusername/yourexperimentname.web?subjectid=someuniqueidentifier&groupid=1&studyid=a
and
Site B -> http://research.millisecond.com/yourusername/yourexperimentname.web?subjectid=someuniqueidentifier&groupid=2&studyid=b

Depending on where they came from, you want to to send them back to either Site A or B, and pass on the subjectid and studyid contained in the original link.

You do
<expt>
/ onexptbegin = [if (mod(script.groupid, 2) == 1) {defaults.finishpage = text.url.item.1}; ]
/ onexptbegin = [if (mod(script.groupid, 2) == 0) {defaults.finishpage = text.url.item.2}; ]
...
</expt>

with

<text url>
/ items = urlitems
</text>

<item urlitems>
/ 1 = "http://sitea.com/?subjectid=<%script.subjectid%>&studyid=a"
/ 2 = "http://siteb.com/?subjectid=<%script.subjectid%>&studyid=b"
</item>

Hello Dave, although the other issue is solved now this problem still occurs:
I want to refer my participants to two different webpages after the inquisit task, depending on the web page they came from.
I am pretty sure that I adjusted everything as described by you. However, sometimes participants get forwarded to the correct link and sometimes they get forwarded to the wrong link. What could be wrong?
Please see below the important parts of my script:

Site A: http://research.millisecond.com/carolinmuschalik/singlecategorypictureiat_rood_vlees.web?subjectid=123&study=999&groupid=1
Site B: http://research.millisecond.com/carolinmuschalik/singlecategorypictureiat_rood_vlees.web?subjectid=123&study=999&groupid=2

<expt>
/ onexptbegin = [if (mod(script.groupid, 2) == 1) {defaults.finishpage = text.url.item.1}; ]
/ onexptbegin = [if (mod(script.groupid, 2) == 0) {defaults.finishpage = text.url.item.2}; ]
</expt>

<expt>
/subjects = (1 of 2)
/groupassignment = groupnumber
/ blocks = [1=practice_compatibletest; 2=compatibletestinstructions; 3=compatibletest;
 4=practice_incompatibletest; 5=incompatibletestinstructions; 6=incompatibletest; 7=summary]
/onexptend = [values.completed = 1]
</expt>

<expt>
/subjects = (2 of 2)
/groupassignment = groupnumber
/ blocks = [1=practice_incompatibletest; 2=incompatibletestinstructions; 3=incompatibletest;
4=practice_compatibletest; 5=compatibletestinstructions; 6=compatibletest; 7=summary]
/onexptend = [values.completed = 1]
</expt>

<text url>
/ items = urlitems
</text>

<item urlitems>
/ 1 = "http://fd8.formdesk.com/umhag/vlees_consumptie2?page=3&nr=<%script.subjectid%>&study=184680">http://fd8.formdesk.com/umhag/vlees_consumptie2?page=3&nr=<%script.subjectid%>&study=184680">http://fd8.formdesk.com/umhag/vlees_consumptie2?page=3&nr=<%script.subjectid%>&study=184680">http://fd8.formdesk.com/umhag/vlees_consumptie2?page=3&nr=<%script.subjectid%>&study=184680">http://fd8.formdesk.com/umhag/vlees_consumptie2?page=3&nr=<%script.subjectid%>&study=184680">http://fd8.formdesk.com/umhag/vlees_consumptie2?page=3&nr=<%script.subjectid%>&study=184680">http://fd8.formdesk.com/umhag/vlees_consumptie2?page=3&nr=<%script.subjectid%>&study=184680">http://fd8.formdesk.com/umhag/vlees_consumptie2?page=3&nr=<%script.subjectid%>&study=184680"
/ 2 = "http://fd8.formdesk.com/umhag/kopie_van_vlees_consumptie2?page=3&nr=<%script.subjectid%>&study=184680">http://fd8.formdesk.com/umhag/kopie_van_vlees_consumptie2?page=3&nr=<%script.subjectid%>&study=184680">http://fd8.formdesk.com/umhag/kopie_van_vlees_consumptie2?page=3&nr=<%script.subjectid%>&study=184680">http://fd8.formdesk.com/umhag/kopie_van_vlees_consumptie2?page=3&nr=<%script.subjectid%>&study=184680">http://fd8.formdesk.com/umhag/kopie_van_vlees_consumptie2?page=3&nr=<%script.subjectid%>&study=184680">http://fd8.formdesk.com/umhag/kopie_van_vlees_consumptie2?page=3&nr=<%script.subjectid%>&study=184680">http://fd8.formdesk.com/umhag/kopie_van_vlees_consumptie2?page=3&nr=<%script.subjectid%>&study=184680">http://fd8.formdesk.com/umhag/kopie_van_vlees_consumptie2?page=3&nr=<%script.subjectid%>&study=184680"
</item>

It would be great if you could help me with that!
Thanks in advance!



> However, sometimes participants get forwarded to the correct link and sometimes they get forwarded to the wrong link.

Could you please show me the data you based this conclusion on?

And, for what it's worth, you can simplify your code and get rid of the 1st <expt> element:

<expt>
/ onexptbegin = [defaults.finishpage = text.url.item.1; ]
/subjects = (1 of 2)
/groupassignment = groupnumber
/ blocks = [1=practice_compatibletest; 2=compatibletestinstructions; 3=compatibletest;
 4=practice_incompatibletest; 5=incompatibletestinstructions; 6=incompatibletest; 7=summary]
/onexptend = [values.completed = 1]
</expt>

<expt>
/ onexptbegin = [defaults.finishpage = text.url.item.2; ]
/subjects = (2 of 2)
/groupassignment = groupnumber
/ blocks = [1=practice_incompatibletest; 2=incompatibletestinstructions; 3=incompatibletest;
4=practice_compatibletest; 5=compatibletestinstructions; 6=compatibletest; 7=summary]
/onexptend = [values.completed = 1]
</expt>

Hello Dave,
in which form could I show you the data?
I tried it more than a several times now and I realized that when the inquisit task starts with the compatible block first, participants get forwarded to link 1, and when inquisit starts with the incompatible block, participants get forwarded to link 2. So there seems to be something wrong with that.

Any idea what it could be?

And why would that be wrong? That's exactly what the code is supposed to do. For odd group numbers, you want to re-direct to URL #1. For even group numbers you want to re-direct to URL #2. It just so happens that the IAT _also_ assigns conditions (i.e. different block orders: compatible first vs incompatible first) based on odd vs even group numbers, as you can see per the <expt> elements' /groupassignment attributes.

 

I want the participants with the group ID = 1 to always getforwarded to the link

https://fd8.formdesk.com/umhag/vlees_consumptie2?page=3&def_nr=2345&def_study=007

and participants with the group ID = 2 to always get forwardedto the link

https://fd8.formdesk.com/umhag/kopie_van_vlees_consumptie2?page=3&def_nr=2345&def_study=007

independent of with which block they start the inquisittask.

 

At the moment however if someone comes from the group with the ID = 1 and gets the incompatibleblock first, he/she gets forwarded to

https://fd8.formdesk.com/umhag/kopie_van_vlees_consumptie2?page=3&def_nr=2345&def_study=007

which is wrong for my experiment.

The same issue applies to the people who have the group ID = 2 but get the compatible blockfirst. They get forwarded to

https://fd8.formdesk.com/umhag/vlees_consumptie2?page=3&def_nr=2345&def_study=007

but I want them to always get forwarded to

https://fd8.formdesk.com/umhag/kopie_van_vlees_consumptie2?page=3&def_nr=2345&def_study=007

Is this understandable? And how could I solve this issue?

Many thanks in advance!

Then you need to change how the script assigns the IAT conditions (block order), i.e. you need to decouple it from the group ID which you want to independently use to determine the redirection URL. You can either set /grouassignment = subjectnumber for the IAT to do condition assignment based on a numerical subject ID (it _will not_ work with a non-numerical ID), or set /grouassignment = random for completely random assignment to one of the IAT block orders.

Thanks! I set the /groupassignment in the expt section of both blocks = random. What else do I need to adjust? Because it is still not working as supposed by simply changing this.

Thanks!

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: 12K, Visits: 85K
carolin.m - Friday, August 4, 2017
Dave - Thursday, August 3, 2017
carolin.m - Thursday, August 3, 2017
Dave - Tuesday, August 1, 2017
carolin.m - Tuesday, August 1, 2017
Dave - Monday, July 31, 2017
carolin.m - Monday, July 31, 2017
Dave - Monday, July 10, 2017
carolin.m - Monday, July 10, 2017
Dave - Thursday, September 1, 2016
So, here's a little script to test:

Condition 1:
http://research.millisecond.com/david.nitz/redir.web?groupid=1
Condition 2:
http://research.millisecond.com/david.nitz/redir.web?groupid=2
Condition 3:
http://research.millisecond.com/david.nitz/redir.web?groupid=3
Condition 4:
http://research.millisecond.com/david.nitz/redir.web?groupid=4

Redirection to different URLs depending on the group id works perfectly fine for me. This is the entirety of the code:

<expt>
/ onexptbegin = [if (mod(script.groupid, 4) == 1) {defaults.finishpage = "http://www.example.com/"}; ]
/ onexptbegin = [if (mod(script.groupid, 4) == 2) {defaults.finishpage = "http://www.google.com/"}; ]
/ onexptbegin = [if (mod(script.groupid, 4) == 3) {defaults.finishpage = "http://www.yahoo.com/"}; ]
/ onexptbegin = [if (mod(script.groupid, 4) == 0) {defaults.finishpage = "http://www.bing.com/"}; ]
/ blocks = [1=myblock]
</expt>

<block myblock>
/ trials = [1=mytrial]
</block>

<trial mytrial>
/ stimulusframes = [1=mytext]
/ validresponse = (57)
</trial>

<text mytext>
/ items = ("Your group id is <%script.groupid%>.~nYou'll be redirected to <%defaults.finishpage%>.")
/ size = (75%, 50%)
</text>

Direct link to the script: http://www.millisecond.com/myaccount/scripts/david.nitz/redir/redir.iqx

When you run this, are you being redirected or not?
Hello Dave,

where exactly in the script do I add these information:
<expt>
/ onexptbegin = [if (mod(script.groupid, 4) == 1) {defaults.finishpage = "http://www.example.com/"}; ]
/ onexptbegin = [if (mod(script.groupid, 4) == 2) {defaults.finishpage = "http://www.google.com/"}; ]
/ onexptbegin = [if (mod(script.groupid, 4) == 3) {defaults.finishpage = "http://www.yahoo.com/"}; ]
/ onexptbegin = [if (mod(script.groupid, 4) == 0) {defaults.finishpage = "http://www.bing.com/"}; ]
/ blocks = [1=myblock]
</expt>

Apparently I can't find the right spot in my script :-/
Thanks!

Suppose you have two groupids. Groupid equal to 1 indicates that the participant came from referral site A. Groupid equal to 2 indicates that the participant came from referral site B. I.e.

Site A -> http://research.millisecond.com/yourusername/yourexperimentname.web?subjectid=someuniqueidentifier&groupid=1&studyid=a
and
Site B -> http://research.millisecond.com/yourusername/yourexperimentname.web?subjectid=someuniqueidentifier&groupid=2&studyid=b

Depending on where they came from, you want to to send them back to either Site A or B, and pass on the subjectid and studyid contained in the original link.

You do
<expt>
/ onexptbegin = [if (mod(script.groupid, 2) == 1) {defaults.finishpage = text.url.item.1}; ]
/ onexptbegin = [if (mod(script.groupid, 2) == 0) {defaults.finishpage = text.url.item.2}; ]
...
</expt>

with

<text url>
/ items = urlitems
</text>

<item urlitems>
/ 1 = "http://sitea.com/?subjectid=<%script.subjectid%>&studyid=a"
/ 2 = "http://siteb.com/?subjectid=<%script.subjectid%>&studyid=b"
</item>

Hello Dave, although the other issue is solved now this problem still occurs:
I want to refer my participants to two different webpages after the inquisit task, depending on the web page they came from.
I am pretty sure that I adjusted everything as described by you. However, sometimes participants get forwarded to the correct link and sometimes they get forwarded to the wrong link. What could be wrong?
Please see below the important parts of my script:

Site A: http://research.millisecond.com/carolinmuschalik/singlecategorypictureiat_rood_vlees.web?subjectid=123&study=999&groupid=1
Site B: http://research.millisecond.com/carolinmuschalik/singlecategorypictureiat_rood_vlees.web?subjectid=123&study=999&groupid=2

<expt>
/ onexptbegin = [if (mod(script.groupid, 2) == 1) {defaults.finishpage = text.url.item.1}; ]
/ onexptbegin = [if (mod(script.groupid, 2) == 0) {defaults.finishpage = text.url.item.2}; ]
</expt>

<expt>
/subjects = (1 of 2)
/groupassignment = groupnumber
/ blocks = [1=practice_compatibletest; 2=compatibletestinstructions; 3=compatibletest;
 4=practice_incompatibletest; 5=incompatibletestinstructions; 6=incompatibletest; 7=summary]
/onexptend = [values.completed = 1]
</expt>

<expt>
/subjects = (2 of 2)
/groupassignment = groupnumber
/ blocks = [1=practice_incompatibletest; 2=incompatibletestinstructions; 3=incompatibletest;
4=practice_compatibletest; 5=compatibletestinstructions; 6=compatibletest; 7=summary]
/onexptend = [values.completed = 1]
</expt>

<text url>
/ items = urlitems
</text>

<item urlitems>
/ 1 = "http://fd8.formdesk.com/umhag/vlees_consumptie2?page=3&nr=<%script.subjectid%>&study=184680">http://fd8.formdesk.com/umhag/vlees_consumptie2?page=3&nr=<%script.subjectid%>&study=184680">http://fd8.formdesk.com/umhag/vlees_consumptie2?page=3&nr=<%script.subjectid%>&study=184680">http://fd8.formdesk.com/umhag/vlees_consumptie2?page=3&nr=<%script.subjectid%>&study=184680">http://fd8.formdesk.com/umhag/vlees_consumptie2?page=3&nr=<%script.subjectid%>&study=184680">http://fd8.formdesk.com/umhag/vlees_consumptie2?page=3&nr=<%script.subjectid%>&study=184680">http://fd8.formdesk.com/umhag/vlees_consumptie2?page=3&nr=<%script.subjectid%>&study=184680">http://fd8.formdesk.com/umhag/vlees_consumptie2?page=3&nr=<%script.subjectid%>&study=184680">http://fd8.formdesk.com/umhag/vlees_consumptie2?page=3&nr=<%script.subjectid%>&study=184680"
/ 2 = "http://fd8.formdesk.com/umhag/kopie_van_vlees_consumptie2?page=3&nr=<%script.subjectid%>&study=184680">http://fd8.formdesk.com/umhag/kopie_van_vlees_consumptie2?page=3&nr=<%script.subjectid%>&study=184680">http://fd8.formdesk.com/umhag/kopie_van_vlees_consumptie2?page=3&nr=<%script.subjectid%>&study=184680">http://fd8.formdesk.com/umhag/kopie_van_vlees_consumptie2?page=3&nr=<%script.subjectid%>&study=184680">http://fd8.formdesk.com/umhag/kopie_van_vlees_consumptie2?page=3&nr=<%script.subjectid%>&study=184680">http://fd8.formdesk.com/umhag/kopie_van_vlees_consumptie2?page=3&nr=<%script.subjectid%>&study=184680">http://fd8.formdesk.com/umhag/kopie_van_vlees_consumptie2?page=3&nr=<%script.subjectid%>&study=184680">http://fd8.formdesk.com/umhag/kopie_van_vlees_consumptie2?page=3&nr=<%script.subjectid%>&study=184680">http://fd8.formdesk.com/umhag/kopie_van_vlees_consumptie2?page=3&nr=<%script.subjectid%>&study=184680"
</item>

It would be great if you could help me with that!
Thanks in advance!



> However, sometimes participants get forwarded to the correct link and sometimes they get forwarded to the wrong link.

Could you please show me the data you based this conclusion on?

And, for what it's worth, you can simplify your code and get rid of the 1st <expt> element:

<expt>
/ onexptbegin = [defaults.finishpage = text.url.item.1; ]
/subjects = (1 of 2)
/groupassignment = groupnumber
/ blocks = [1=practice_compatibletest; 2=compatibletestinstructions; 3=compatibletest;
 4=practice_incompatibletest; 5=incompatibletestinstructions; 6=incompatibletest; 7=summary]
/onexptend = [values.completed = 1]
</expt>

<expt>
/ onexptbegin = [defaults.finishpage = text.url.item.2; ]
/subjects = (2 of 2)
/groupassignment = groupnumber
/ blocks = [1=practice_incompatibletest; 2=incompatibletestinstructions; 3=incompatibletest;
4=practice_compatibletest; 5=compatibletestinstructions; 6=compatibletest; 7=summary]
/onexptend = [values.completed = 1]
</expt>

Hello Dave,
in which form could I show you the data?
I tried it more than a several times now and I realized that when the inquisit task starts with the compatible block first, participants get forwarded to link 1, and when inquisit starts with the incompatible block, participants get forwarded to link 2. So there seems to be something wrong with that.

Any idea what it could be?

And why would that be wrong? That's exactly what the code is supposed to do. For odd group numbers, you want to re-direct to URL #1. For even group numbers you want to re-direct to URL #2. It just so happens that the IAT _also_ assigns conditions (i.e. different block orders: compatible first vs incompatible first) based on odd vs even group numbers, as you can see per the <expt> elements' /groupassignment attributes.

 

I want the participants with the group ID = 1 to always getforwarded to the link

https://fd8.formdesk.com/umhag/vlees_consumptie2?page=3&def_nr=2345&def_study=007

and participants with the group ID = 2 to always get forwardedto the link

https://fd8.formdesk.com/umhag/kopie_van_vlees_consumptie2?page=3&def_nr=2345&def_study=007

independent of with which block they start the inquisittask.

 

At the moment however if someone comes from the group with the ID = 1 and gets the incompatibleblock first, he/she gets forwarded to

https://fd8.formdesk.com/umhag/kopie_van_vlees_consumptie2?page=3&def_nr=2345&def_study=007

which is wrong for my experiment.

The same issue applies to the people who have the group ID = 2 but get the compatible blockfirst. They get forwarded to

https://fd8.formdesk.com/umhag/vlees_consumptie2?page=3&def_nr=2345&def_study=007

but I want them to always get forwarded to

https://fd8.formdesk.com/umhag/kopie_van_vlees_consumptie2?page=3&def_nr=2345&def_study=007

Is this understandable? And how could I solve this issue?

Many thanks in advance!

Then you need to change how the script assigns the IAT conditions (block order), i.e. you need to decouple it from the group ID which you want to independently use to determine the redirection URL. You can either set /grouassignment = subjectnumber for the IAT to do condition assignment based on a numerical subject ID (it _will not_ work with a non-numerical ID), or set /grouassignment = random for completely random assignment to one of the IAT block orders.

Thanks! I set the /groupassignment in the expt section of both blocks = random. What else do I need to adjust? Because it is still not working as supposed by simply changing this.

Thanks!

You need to set the URL to re-direct to /onexptbegin based on the group number as already discussed in this thread, e.g. here: https://www.millisecond.com/forums/FindPost22063.aspx

You, of course, need to also make sure that you actually _read in_ the group number you pass to the launch page, so that the script actually _knows_ about it. You do that by selecting the URL query parameter option for group IDs in your web experiment's settings.

M Gerathy
M Gerathy
Associate Member (158 reputation)Associate Member (158 reputation)Associate Member (158 reputation)Associate Member (158 reputation)Associate Member (158 reputation)Associate Member (158 reputation)Associate Member (158 reputation)Associate Member (158 reputation)Associate Member (158 reputation)
Group: Forum Members
Posts: 17, Visits: 45
Hi guys,

I've read through this thread and I must admit I am truly a beginner at this. I jave no idea what the posters are saying in their script examples.

If I want my participants to be automatically redirected to the same url at the end of the experiment, and carry a subject ID with it. Is this possible?

Thanks in advance for the help guys.

Matt.
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: 12K, Visits: 85K
M Gerathy - 8/11/2021
Hi guys,

I've read through this thread and I must admit I am truly a beginner at this. I jave no idea what the posters are saying in their script examples.

If I want my participants to be automatically redirected to the same url at the end of the experiment, and carry a subject ID with it. Is this possible?

Thanks in advance for the help guys.

Matt.

See "Sending the Subject ID from Inquisit to 3rd Party Sites" at https://www.millisecond.com/support/docs/v6/html/howto/interopsurveys.htm

GO

Merge Selected

Merge into selected topic...



Merge into merge target...



Merge into a specific topic ID...




Reading This Topic

Explore
Messages
Mentions
Search