Redirect code not working when placed in batch script


Author
Message
cmgreene
cmgreene
Associate Member (201 reputation)Associate Member (201 reputation)Associate Member (201 reputation)Associate Member (201 reputation)Associate Member (201 reputation)Associate Member (201 reputation)Associate Member (201 reputation)Associate Member (201 reputation)Associate Member (201 reputation)
Group: Forum Members
Posts: 12, Visits: 24
Dave - 1/28/2021
cmgreene - 1/28/2021
Hi, I'm having a bit of trouble with redirecting to an external URL at the end of an experiment. I've written the following script to conditionally send participants to one of two URLs:

qualtricsredirect.iqx
<expt>
/ onexptbegin = [if (script.groupid == 1 || script.groupid == 2) {defaults.finishpage = "https://www.bbc.com/"}; ]
/ onexptbegin = [if (script.groupid == 3 || script.groupid == 4) {defaults.finishpage = "http://www.google.com/"}; ]
/ blocks = [1=myblock]
</expt>

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

<trial mytrial>
/ stimulusframes = [1=mytext]
/ timeout = 1500
</trial>

<text mytext>
/ items = ("Thanks! You will now be redirected to another webpage to complete the next part of the experiment")
/ size = (75%, 50%)
</text>

This works fine if I run it in Inquisit Web on its own - it redirects participants to the appropriate URL based on their groupid, as expected. The problem occurs when I try to embed it within a batch script, as follows:

<batch>
/ subjects = (1,4 of 4)
/ groupassignment = groupnumber
/ file = "wmctaskintro.iqx"
/ file = "wmcbatch.iqx"
/ file = "qualtricsredirect.iqx"
</batch>

<batch>
/ subjects = (2,3 of 4)
/ groupassignment = groupnumber
/ file= "enumeration.iqx"
/ file = "qualtricsredirect.iqx"
</batch>

Now if I run the experiment on Inquisit Web, beginning with the batch script, the redirect does not work as expected. The text ("Thanks! You will now be redirected to another webpage to complete the next part of the experiment") does appear, so the redirectqualtrics.iqz script is running, but then it redirects to the default millisecond.com finish page. This suggests to me that the defaults.finishpage code in the first script is not being evaluated or is being overwritten, but I don't know how. 

Thanks in advance for any help!
Ciar


The logic setting the finish page needs to go into the <batch> script, see e.g.

https://www.millisecond.com/forums/FindPost28501.aspx






Fantastic, that worked. Thanks Dave!
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
cmgreene - 1/28/2021
Hi, I'm having a bit of trouble with redirecting to an external URL at the end of an experiment. I've written the following script to conditionally send participants to one of two URLs:

qualtricsredirect.iqx
<expt>
/ onexptbegin = [if (script.groupid == 1 || script.groupid == 2) {defaults.finishpage = "https://www.bbc.com/"}; ]
/ onexptbegin = [if (script.groupid == 3 || script.groupid == 4) {defaults.finishpage = "http://www.google.com/"}; ]
/ blocks = [1=myblock]
</expt>

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

<trial mytrial>
/ stimulusframes = [1=mytext]
/ timeout = 1500
</trial>

<text mytext>
/ items = ("Thanks! You will now be redirected to another webpage to complete the next part of the experiment")
/ size = (75%, 50%)
</text>

This works fine if I run it in Inquisit Web on its own - it redirects participants to the appropriate URL based on their groupid, as expected. The problem occurs when I try to embed it within a batch script, as follows:

<batch>
/ subjects = (1,4 of 4)
/ groupassignment = groupnumber
/ file = "wmctaskintro.iqx"
/ file = "wmcbatch.iqx"
/ file = "qualtricsredirect.iqx"
</batch>

<batch>
/ subjects = (2,3 of 4)
/ groupassignment = groupnumber
/ file= "enumeration.iqx"
/ file = "qualtricsredirect.iqx"
</batch>

Now if I run the experiment on Inquisit Web, beginning with the batch script, the redirect does not work as expected. The text ("Thanks! You will now be redirected to another webpage to complete the next part of the experiment") does appear, so the redirectqualtrics.iqz script is running, but then it redirects to the default millisecond.com finish page. This suggests to me that the defaults.finishpage code in the first script is not being evaluated or is being overwritten, but I don't know how. 

Thanks in advance for any help!
Ciar


The logic setting the finish page needs to go into the <batch> script, see e.g.

https://www.millisecond.com/forums/FindPost28501.aspx






cmgreene
cmgreene
Associate Member (201 reputation)Associate Member (201 reputation)Associate Member (201 reputation)Associate Member (201 reputation)Associate Member (201 reputation)Associate Member (201 reputation)Associate Member (201 reputation)Associate Member (201 reputation)Associate Member (201 reputation)
Group: Forum Members
Posts: 12, Visits: 24
Hi, I'm having a bit of trouble with redirecting to an external URL at the end of an experiment. I've written the following script to conditionally send participants to one of two URLs:

qualtricsredirect.iqx
<expt>
/ onexptbegin = [if (script.groupid == 1 || script.groupid == 2) {defaults.finishpage = "https://www.bbc.com/"}; ]
/ onexptbegin = [if (script.groupid == 3 || script.groupid == 4) {defaults.finishpage = "http://www.google.com/"}; ]
/ blocks = [1=myblock]
</expt>

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

<trial mytrial>
/ stimulusframes = [1=mytext]
/ timeout = 1500
</trial>

<text mytext>
/ items = ("Thanks! You will now be redirected to another webpage to complete the next part of the experiment")
/ size = (75%, 50%)
</text>

This works fine if I run it in Inquisit Web on its own - it redirects participants to the appropriate URL based on their groupid, as expected. The problem occurs when I try to embed it within a batch script, as follows:

<batch>
/ subjects = (1,4 of 4)
/ groupassignment = groupnumber
/ file = "wmctaskintro.iqx"
/ file = "wmcbatch.iqx"
/ file = "qualtricsredirect.iqx"
</batch>

<batch>
/ subjects = (2,3 of 4)
/ groupassignment = groupnumber
/ file= "enumeration.iqx"
/ file = "qualtricsredirect.iqx"
</batch>

Now if I run the experiment on Inquisit Web, beginning with the batch script, the redirect does not work as expected. The text ("Thanks! You will now be redirected to another webpage to complete the next part of the experiment") does appear, so the redirectqualtrics.iqz script is running, but then it redirects to the default millisecond.com finish page. This suggests to me that the defaults.finishpage code in the first script is not being evaluated or is being overwritten, but I don't know how. 

Thanks in advance for any help!
Ciar


GO

Merge Selected

Merge into selected topic...



Merge into merge target...



Merge into a specific topic ID...




Reading This Topic

Explore
Messages
Mentions
Search