Inquisit web - redirect to different url based on group id


Author
Message
ylyl27
ylyl27
Associate Member (139 reputation)Associate Member (139 reputation)Associate Member (139 reputation)Associate Member (139 reputation)Associate Member (139 reputation)Associate Member (139 reputation)Associate Member (139 reputation)Associate Member (139 reputation)Associate Member (139 reputation)
Group: Forum Members
Posts: 12, Visits: 88
Hi! My experiment has two conditions and after the study I want participants to be redirected to two different survey links based on their group id. I wrote two scripts for each condition separately.
When groupid = 1, we will run script 1, and participants will be redirected to survey 1 url. When group id = 2, we will run script 2, and participants will be redirected to survey 2 url.
Here's part of my script:
<batch>
/ subjects = (1 of 2)
/ groupassignment = groupnumber
/ file = "exp_condition1.iqx"
</batch>

<batch>
/ subjects = (2 of 2)
/ groupassignment = groupnumber
/ file = "exp_condition2.iqx"
</batch>

In exp_condition1.iqx, I have this:
<text url>
/ items = urlitems
</text>

<item urlitems>
/1 = "https://qualtricslink1?id=<%script.subjectid%>"
/2 = "https://qualtricslink2?id=<%script.subjectid%>"
</item>

<expt Tasks>
/ onexptbegin = [defaults.finishpage = text.url.item.1;]
/ blocks = [1=instru]
</expt>

In exp_condition2.iqx, I have:
<text url>
/ items = urlitems
</text>

<item urlitems>
/1 = "https://qualtricslink1?id=<%script.subjectid%>"
/2 = "https://qualtricslink2?id=<%script.subjectid%>"
</item>

<expt Tasks>
/ onexptbegin = [defaults.finishpage = text.url.item.2;]
/ blocks = [1=instru]
</expt>

I have two questions: 1) is my script correct? and 2) how should I setup the Finish Page on Inquisit Web? I notice that there are three options for the finish page: redirect to the default finish web page, redirect to a custom finish page, or redirect to an external web site. I guess I should choose "redirect to an external web site", but it looks like you can only enter one url there...

Thank you!!

Dave
Dave
Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)
Group: Administrators
Posts: 13K, Visits: 104K
ylyl27 - 11/16/2022
Hi! My experiment has two conditions and after the study I want participants to be redirected to two different survey links based on their group id. I wrote two scripts for each condition separately.
When groupid = 1, we will run script 1, and participants will be redirected to survey 1 url. When group id = 2, we will run script 2, and participants will be redirected to survey 2 url.
Here's part of my script:
<batch>
/ subjects = (1 of 2)
/ groupassignment = groupnumber
/ file = "exp_condition1.iqx"
</batch>

<batch>
/ subjects = (2 of 2)
/ groupassignment = groupnumber
/ file = "exp_condition2.iqx"
</batch>

In exp_condition1.iqx, I have this:
<text url>
/ items = urlitems
</text>

<item urlitems>
/1 = "https://qualtricslink1?id=<%script.subjectid%>"
/2 = "https://qualtricslink2?id=<%script.subjectid%>"
</item>

<expt Tasks>
/ onexptbegin = [defaults.finishpage = text.url.item.1;]
/ blocks = [1=instru]
</expt>

In exp_condition2.iqx, I have:
<text url>
/ items = urlitems
</text>

<item urlitems>
/1 = "https://qualtricslink1?id=<%script.subjectid%>"
/2 = "https://qualtricslink2?id=<%script.subjectid%>"
</item>

<expt Tasks>
/ onexptbegin = [defaults.finishpage = text.url.item.2;]
/ blocks = [1=instru]
</expt>

I have two questions: 1) is my script correct? and 2) how should I setup the Finish Page on Inquisit Web? I notice that there are three options for the finish page: redirect to the default finish web page, redirect to a custom finish page, or redirect to an external web site. I guess I should choose "redirect to an external web site", but it looks like you can only enter one url there...

Thank you!!

(1) You need to set defaults.finishpage in the <batch> elements, not in the task scripts' <expt>s, so something like

<batch 1>
/ subjects = (1 of 2)
/ groupassignment = groupnumber
/ file = "exp_condition1.iqx"
/ onscriptend = [if (batch.1.currentscript == "exp_condition1.iqx") {
    defaults.finishpage = concat("https://qualtricslink1?id=", script.subjectid);
    };
]
</batch>

<batch 2>
/ subjects = (2 of 2)
/ groupassignment = groupnumber
/ file = "exp_condition2.iqx"
/ onscriptend = [if (batch.2.currentscript == "exp_condition2.iqx") {
    defaults.finishpage = concat("https://qualtricslink2?id=", script.subjectid);
    };
]
</batch>


(2) In the web settings, the finish page settings need to be left at their default.

ylyl27
ylyl27
Associate Member (139 reputation)Associate Member (139 reputation)Associate Member (139 reputation)Associate Member (139 reputation)Associate Member (139 reputation)Associate Member (139 reputation)Associate Member (139 reputation)Associate Member (139 reputation)Associate Member (139 reputation)
Group: Forum Members
Posts: 12, Visits: 88
Dave - 11/16/2022
ylyl27 - 11/16/2022
Hi! My experiment has two conditions and after the study I want participants to be redirected to two different survey links based on their group id. I wrote two scripts for each condition separately.
When groupid = 1, we will run script 1, and participants will be redirected to survey 1 url. When group id = 2, we will run script 2, and participants will be redirected to survey 2 url.
Here's part of my script:
<batch>
/ subjects = (1 of 2)
/ groupassignment = groupnumber
/ file = "exp_condition1.iqx"
</batch>

<batch>
/ subjects = (2 of 2)
/ groupassignment = groupnumber
/ file = "exp_condition2.iqx"
</batch>

In exp_condition1.iqx, I have this:
<text url>
/ items = urlitems
</text>

<item urlitems>
/1 = "https://qualtricslink1?id=<%script.subjectid%>"
/2 = "https://qualtricslink2?id=<%script.subjectid%>"
</item>

<expt Tasks>
/ onexptbegin = [defaults.finishpage = text.url.item.1;]
/ blocks = [1=instru]
</expt>

In exp_condition2.iqx, I have:
<text url>
/ items = urlitems
</text>

<item urlitems>
/1 = "https://qualtricslink1?id=<%script.subjectid%>"
/2 = "https://qualtricslink2?id=<%script.subjectid%>"
</item>

<expt Tasks>
/ onexptbegin = [defaults.finishpage = text.url.item.2;]
/ blocks = [1=instru]
</expt>

I have two questions: 1) is my script correct? and 2) how should I setup the Finish Page on Inquisit Web? I notice that there are three options for the finish page: redirect to the default finish web page, redirect to a custom finish page, or redirect to an external web site. I guess I should choose "redirect to an external web site", but it looks like you can only enter one url there...

Thank you!!

(1) You need to set defaults.finishpage in the <batch> elements, not in the task scripts' <expt>s, so something like

<batch 1>
/ subjects = (1 of 2)
/ groupassignment = groupnumber
/ file = "exp_condition1.iqx"
/ onscriptend = [if (batch.1.currentscript == "exp_condition1.iqx") {
    defaults.finishpage = concat("https://qualtricslink1?id=", script.subjectid);
    };
]
</batch>

<batch 2>
/ subjects = (2 of 2)
/ groupassignment = groupnumber
/ file = "exp_condition2.iqx"
/ onscriptend = [if (batch.2.currentscript == "exp_condition2.iqx") {
    defaults.finishpage = concat("https://qualtricslink2?id=", script.subjectid);
    };
]
</batch>


(2) In the web settings, the finish page settings need to be left at their default.

It worked! Thank, Dave!!
GO

Merge Selected

Merge into selected topic...



Merge into merge target...



Merge into a specific topic ID...




Reading This Topic

Explore
Messages
Mentions
Search