Millisecond Forums

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

https://forums.millisecond.com/Topic19623.aspx

By lfj88 - 8/31/2016

Dear reader,

I have one script that needs to redirect participants from 4 different conditions to 4 different urls. The finish page in my account on Millisecond only allows for one url, so I tried to create a referral to the url in the Inquisit script, which times out after x milliseconds (not ideal, but as far as I know the link just needs to be opened to confirm the participant has completed the study and I don't think the participant has to click anything on that webpage). I need to be able to change that url depending on the groupid. I tried it using a list or a value, but both do not seem to work.

See below for the relevant code I used. For the url, I put in a google page as an example. So far, I only specified the url for groupid=1. In the code below, I try to use the list. I have also tried it with value. In that case: in the expt command, I then substituted 
list.prolific_url.appenditem("?gfe_rd=cr&ei=DPrGV_yAGsexOuyWvPAK#q=happy")
 with
values.urlvalue = "?gfe_rd=cr&ei=DPrGV_yAGsexOuyWvPAK#q=happy"
and in the html command, I substituted
<% list.prolific_url.currentvalue %>
with
<% values.urlvalue %>

However, both do not seem to work. Using a value (opposed to a list) seems most effective, as it does print the correct url when I add "https://www.google.nl/<% values.urlvalue %>"in a caption of a radiobuttons item that happens to be in my script, but when it actually opens the url later in the script, it seems to use the original value of urlvalue ('bla'), not the value that should be assigned to urlvalue on the beginning of the experiment.

Any ideas as to what goes wrong or how else I can accomplish the goal of redirecting participants to different urls, depending on their groupid?

Kind regards,
Lin

*** URL PARTICIPANTS NEED TO BE SENT TO UPON COMPLETION OF STUDY ***
<list pr_url>
/selectionmode = sequence
</list>

<values>
/ urlvalue = "bla"
</values>

<html pr_url>
/items = ("https://www.google.nl/<% list.prolific_url.currentvalue %>")
</html>

<trial pr_url>
/stimulusframes = [1=pr_url]
/showmousecursor = True
/timeout = 10000
</trial>

<block pr_url>
/trials = [1=pr_url]

***EXPERIMENT***
<expt RC>
/ blocks = [1=resolution; 2=consent; 3=distr; 4=forced_choice_block1; 5=forced_choice_block2; 6=forced_choice_block3; 7=forced_choice_block4; 8=forced_choice_block5; 9=demographics; 10=pr_url]
/ postinstructions = (end)
/ onexptbegin = [if (script.groupid == 1) {list.condition_names.appenditem("very negative"); list.condition_names.appenditem("slightly negative"); list.condition_names.appenditem("VERY NEGATIVE"); list.prolific_url.appenditem("?gfe_rd=cr&ei=DPrGV_yAGsexOuyWvPAK#q=happy");}]
/ onexptbegin = [if (script.groupid == 2) {list.condition_names.appenditem("slightly negative"); list.condition_names.appenditem("very negative"); list.condition_names.appenditem("SLIGHTLY NEGATIVE");}]
/ onexptbegin = [if (script.groupid == 3) {list.condition_names.appenditem("slightly positive"); list.condition_names.appenditem("very positive"); list.condition_names.appenditem("SLIGHTLY POSITIVE");}]
/ onexptbegin = [if (script.groupid == 4) {list.condition_names.appenditem("very positive"); list.condition_names.appenditem("slightly positive"); list.condition_names.appenditem("VERY POSITIVE");}]
</expt>


By Dave - 8/31/2016

What you should do is simply set the defaults.finishpage property to the desired URL depending on the groupid.

<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/"]
...
</expt>

Hope this helps.
By lfj88 - 8/31/2016

Thanks, but unfortunately that does not work either. When I then go through the experiment it simply stops at the end, but does not open any webpage.
I put it in the script exactly the way you typed it. Any idea why this would not work?
By Dave - 8/31/2016

What does "when I go through the script" mean here specifically? Are you completing it online (Inquisit Web) or testing in Inquisit Lab? Redirection will only occur under Inquisit Web. If you are running this under Inquisit Web, please provide the link to the respective launch page / script online.
By Dave - 8/31/2016

Guessing here, but I assume this is the web experiment you are talking about:

http://research.millisecond.com/inq2bsiweb/RC_criteria_plaatjes.web (launch page)

with the script being

http://www.millisecond.com/myaccount/scripts/inq2bsiweb/RC_criteria_plaatjes/RC_criteria_plaatjes.iqx

The script that's currently uploaded makes no attempt whatsoever to set the defaults.finishpage property. This is the entire <expt> element as it currently exist in that script:

<expt RC>
/ blocks = [1=resolution; 2=consent; 3=distr; 4=forced_choice_block1; 5=forced_choice_block2; 6=forced_choice_block3; 7=forced_choice_block4; 8=forced_choice_block5; 9=demographics]
/ postinstructions = (end)
/ onexptbegin = [if (mod(script.subjectid, 4) == 1) {list.condition_names.appenditem("very negative"); list.condition_names.appenditem("slightly negative"); list.condition_names.appenditem("VERY NEGATIVE");}]
/ onexptbegin = [if (mod(script.subjectid, 4) == 2) {list.condition_names.appenditem("slightly negative"); list.condition_names.appenditem("very negative"); list.condition_names.appenditem("SLIGHTLY NEGATIVE");}]
/ onexptbegin = [if (mod(script.subjectid, 4) == 3) {list.condition_names.appenditem("slightly positive"); list.condition_names.appenditem("very positive"); list.condition_names.appenditem("SLIGHTLY POSITIVE");}]
/ onexptbegin = [if (mod(script.subjectid, 4) == 0) {list.condition_names.appenditem("very positive"); list.condition_names.appenditem("slightly positive"); list.condition_names.appenditem("VERY POSITIVE");}]
</expt>

In other words: You are not redirecting anywhere and the script just ending without redirection is the correct behavior.

By Dave - 9/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?
By lfj88 - 9/1/2016

Hi Dave,

Thanks for all the answers! That's an earlier version of the script that you found on Inquisit Web. I was indeed testing it in Inquisit Lab, not Inquisit Web (I would first have to delete the earlier version to make space for the new one, but I still needed the earlier version up there), so that explains it.

I had used urls in Inquisit Lab before (but not as a finishpage), so I didn't know this wouldn't work in Inquisit Lab.
Thanks for your help!

By carolin.m - 7/5/2017

lfj88 - Thursday, September 1, 2016
Hi Dave,

Thanks for all the answers! That's an earlier version of the script that you found on Inquisit Web. I was indeed testing it in Inquisit Lab, not Inquisit Web (I would first have to delete the earlier version to make space for the new one, but I still needed the earlier version up there), so that explains it.

I had used urls in Inquisit Lab before (but not as a finishpage), so I didn't know this wouldn't work in Inquisit Lab.
Thanks for your help!


Hello Dave,

I have a similar question. I have people who come from 2 different links to my inquisit web experiment. After they are finished with inquisit I want to redirect them (depending on from which link they came) back to their respective link. So I need two different redirects.

How would it be possible?

Thanks in advance!

Carolin
By Dave - 7/6/2017

carolin.m - Thursday, July 6, 2017
lfj88 - Thursday, September 1, 2016
Hi Dave,

Thanks for all the answers! That's an earlier version of the script that you found on Inquisit Web. I was indeed testing it in Inquisit Lab, not Inquisit Web (I would first have to delete the earlier version to make space for the new one, but I still needed the earlier version up there), so that explains it.

I had used urls in Inquisit Lab before (but not as a finishpage), so I didn't know this wouldn't work in Inquisit Lab.
Thanks for your help!


Hello Dave,

I have a similar question. I have people who come from 2 different links to my inquisit web experiment. After they are finished with inquisit I want to redirect them (depending on from which link they came) back to their respective link. So I need two different redirects.

How would it be possible?

Thanks in advance!

Carolin

> How would it be possible?

It's probably not possible. If the only distinction between the two groups of participants is the link they came from, the script doesn't know about that and cannot adjust the URL to redirect to accordingly. You would have to provide the launch page and script with some additional info that the script "knows" about -- such as a specific groupid for group A vs group B passed in via a query parameter. You can then have the script set the link to redirect to accordingly, as shown in the example in this thread.
By carolin.m - 7/6/2017

Dave - Thursday, July 6, 2017
carolin.m - Thursday, July 6, 2017
lfj88 - Thursday, September 1, 2016
Hi Dave,

Thanks for all the answers! That's an earlier version of the script that you found on Inquisit Web. I was indeed testing it in Inquisit Lab, not Inquisit Web (I would first have to delete the earlier version to make space for the new one, but I still needed the earlier version up there), so that explains it.

I had used urls in Inquisit Lab before (but not as a finishpage), so I didn't know this wouldn't work in Inquisit Lab.
Thanks for your help!


Hello Dave,

I have a similar question. I have people who come from 2 different links to my inquisit web experiment. After they are finished with inquisit I want to redirect them (depending on from which link they came) back to their respective link. So I need two different redirects.

How would it be possible?

Thanks in advance!

Carolin

> How would it be possible?

It's probably not possible. If the only distinction between the two groups of participants is the link they came from, the script doesn't know about that and cannot adjust the URL to redirect to accordingly. You would have to provide the launch page and script with some additional info that the script "knows" about -- such as a specific groupid for group A vs group B passed in via a query parameter. You can then have the script set the link to redirect to accordingly, as shown in the example in this thread.

Thanks for the reply! When I add these information to the scriot, do I leave the predefined field for the forward link in the edit section of the experiment free?
Moreover, does the '4' in [if (mod(script.groupid, 4) == 1)... refer to the 4 options? So in my case I have to adjust it with '2' ?
Also I have to ensure that the participant ID and a study ID (which are contained in the entry link) will be forwarded to the respective link.
Is that possible and if so how?

Thanks a lot in advance!
Carolin
By Dave - 7/7/2017

carolin.m - Friday, July 7, 2017
Dave - Thursday, July 6, 2017
carolin.m - Thursday, July 6, 2017
lfj88 - Thursday, September 1, 2016
Hi Dave,

Thanks for all the answers! That's an earlier version of the script that you found on Inquisit Web. I was indeed testing it in Inquisit Lab, not Inquisit Web (I would first have to delete the earlier version to make space for the new one, but I still needed the earlier version up there), so that explains it.

I had used urls in Inquisit Lab before (but not as a finishpage), so I didn't know this wouldn't work in Inquisit Lab.
Thanks for your help!


Hello Dave,

I have a similar question. I have people who come from 2 different links to my inquisit web experiment. After they are finished with inquisit I want to redirect them (depending on from which link they came) back to their respective link. So I need two different redirects.

How would it be possible?

Thanks in advance!

Carolin

> How would it be possible?

It's probably not possible. If the only distinction between the two groups of participants is the link they came from, the script doesn't know about that and cannot adjust the URL to redirect to accordingly. You would have to provide the launch page and script with some additional info that the script "knows" about -- such as a specific groupid for group A vs group B passed in via a query parameter. You can then have the script set the link to redirect to accordingly, as shown in the example in this thread.

Thanks for the reply! When I add these information to the scriot, do I leave the predefined field for the forward link in the edit section of the experiment free?
Moreover, does the '4' in [if (mod(script.groupid, 4) == 1)... refer to the 4 options? So in my case I have to adjust it with '2' ?
Also I have to ensure that the participant ID and a study ID (which are contained in the entry link) will be forwarded to the respective link.
Is that possible and if so how?

Thanks a lot in advance!
Carolin

> Thanks for the reply! When I add these information to the scriot, do I leave the predefined field for the forward link in the edit section of the experiment free?

Yes, you can leave it free. When setting the finish page via the script itself, this would override anything put there anyway.

> Moreover, does the '4' in [if (mod(script.groupid, 4) == 1)... refer to the 4 options?

Yes, it refers to the four different conditions / options. If you only have two, you would take the group id modulo 2.

> Also I have to ensure that the participant ID and

I assume you pass the participant in via a query parameter as well and have the script(s) use it as its subject id. If so, you can "reconstruct" that information in the outgoing links you set. See e.g. this example: https://www.millisecond.com/forums/FindPost16887.aspx

> a study ID (which are contained in the entry link) will be forwarded to the respective link.

You should be able to reconstruct that based on the passed in group id.
By carolin.m - 7/9/2017

Dave - Friday, July 7, 2017
carolin.m - Friday, July 7, 2017
Dave - Thursday, July 6, 2017
carolin.m - Thursday, July 6, 2017
lfj88 - Thursday, September 1, 2016
Hi Dave,

Thanks for all the answers! That's an earlier version of the script that you found on Inquisit Web. I was indeed testing it in Inquisit Lab, not Inquisit Web (I would first have to delete the earlier version to make space for the new one, but I still needed the earlier version up there), so that explains it.

I had used urls in Inquisit Lab before (but not as a finishpage), so I didn't know this wouldn't work in Inquisit Lab.
Thanks for your help!


Hello Dave,

I have a similar question. I have people who come from 2 different links to my inquisit web experiment. After they are finished with inquisit I want to redirect them (depending on from which link they came) back to their respective link. So I need two different redirects.

How would it be possible?

Thanks in advance!

Carolin

> How would it be possible?

It's probably not possible. If the only distinction between the two groups of participants is the link they came from, the script doesn't know about that and cannot adjust the URL to redirect to accordingly. You would have to provide the launch page and script with some additional info that the script "knows" about -- such as a specific groupid for group A vs group B passed in via a query parameter. You can then have the script set the link to redirect to accordingly, as shown in the example in this thread.

Thanks for the reply! When I add these information to the scriot, do I leave the predefined field for the forward link in the edit section of the experiment free?
Moreover, does the '4' in [if (mod(script.groupid, 4) == 1)... refer to the 4 options? So in my case I have to adjust it with '2' ?
Also I have to ensure that the participant ID and a study ID (which are contained in the entry link) will be forwarded to the respective link.
Is that possible and if so how?

Thanks a lot in advance!
Carolin

> Thanks for the reply! When I add these information to the scriot, do I leave the predefined field for the forward link in the edit section of the experiment free?

Yes, you can leave it free. When setting the finish page via the script itself, this would override anything put there anyway.

> Moreover, does the '4' in [if (mod(script.groupid, 4) == 1)... refer to the 4 options?

Yes, it refers to the four different conditions / options. If you only have two, you would take the group id modulo 2.

> Also I have to ensure that the participant ID and

I assume you pass the participant in via a query parameter as well and have the script(s) use it as its subject id. If so, you can "reconstruct" that information in the outgoing links you set. See e.g. this example: https://www.millisecond.com/forums/FindPost16887.aspx

> a study ID (which are contained in the entry link) will be forwarded to the respective link.

You should be able to reconstruct that based on the passed in group id.

Thanks for the quick reply!

Unfortunately I can't find the information concerning the "reconstruction" in the link you mentioned (https://www.millisecond.com/forums/FindPost16887.aspx).
Do you have another link for that?

Thanks,
Carolin
By Dave - 7/9/2017

carolin.m - Monday, July 10, 2017

Thanks for the quick reply!

Unfortunately I can't find the information concerning the "reconstruction" in the link you mentioned (https://www.millisecond.com/forums/FindPost16887.aspx).
Do you have another link for that?

Thanks,
Carolin

<text screenouturl>
/ items = ("http://www.myopinions.com.au/Surveys/RewardSurvey.aspx?codes=spsqiogaap&id=<%script.subjectid%>")
</text>

this is the relevant part from the linked thread. It reconstructs the 'id' parameter.
By carolin.m - 7/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!
By Dave - 7/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>
By carolin.m - 7/27/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>

Thanks for the reply!
This is working now...however it only works when participants complete the task. If they quit the task earlier with Ctrl Q they get forwarded to the page that I entered in the inquisist script manager. Is it possible to still forward them to the questionnaire they came from when the quit the task earlier?

Many thanks in advance!
Carolin


By Dave - 7/28/2017

carolin.m - Friday, July 28, 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>

Thanks for the reply!
This is working now...however it only works when participants complete the task. If they quit the task earlier with Ctrl Q they get forwarded to the page that I entered in the inquisist script manager. Is it possible to still forward them to the questionnaire they came from when the quit the task earlier?

Many thanks in advance!
Carolin



If you set the URL to redirect to at the very beginning as in the example (/onexptbegin), they should be redirected properly even if they quit early. Alternatively, why not provide the URL to the questionnaire in the web experiment's settings (what you refer to as "script manager," I think) as well? I.e., why is the URL you entered there a different one?
By carolin.m - 7/30/2017

Dave - Friday, July 28, 2017
carolin.m - Friday, July 28, 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>

Thanks for the reply!
This is working now...however it only works when participants complete the task. If they quit the task earlier with Ctrl Q they get forwarded to the page that I entered in the inquisist script manager. Is it possible to still forward them to the questionnaire they came from when the quit the task earlier?

Many thanks in advance!
Carolin



If you set the URL to redirect to at the very beginning as in the example (/onexptbegin), they should be redirected properly even if they quit early. Alternatively, why not provide the URL to the questionnaire in the web experiment's settings (what you refer to as "script manager," I think) as well? I.e., why is the URL you entered there a different one?

I solved it! Thank! The /onexptbegin command was not at the very beginning.
Regarding your question: the participants come from 2 different webpages and need to be sent back to the one they came from after the inquisit task. That's why there was another URL in the web experiment setting, at least for one group.
By carolin.m - 7/30/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"
/ 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"
</item>

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


By Dave - 7/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"
/ 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"
</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>
By carolin.m - 7/31/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"
/ 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?
By Dave - 8/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"
/ 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.
By carolin.m - 8/2/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"
/ 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!
By Dave - 8/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"
/ 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.
By carolin.m - 8/3/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"
/ 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!
By Dave - 8/4/2017

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.
By 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.
By Dave - 8/11/2021

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