Hello, I'm hoping someone can tell me where I've gone wrong with the following section of Inquisit Web script!
I want to redirect participants to a specific webpage if they click Button 1, by updating the finishpage attribute. Instead, Chrome redirects to my homepage, and Firefox redirects to file:///%22http://myurl.com%22
If they click Button 2 they should be taken to the default finish page; this works as intended.
I have added some checks into the script below, and they confirm that the response is being collected and that the finishpage is being updated. It just isn't redirecting.
Thanks in advance for any advice!
<expt finishpagetest>
/ blocks = [1=test]
</expt>
<defaults>
/ finishpage = "http://www.millisecond.com/web/finish.aspx"
</defaults>
<block test>
/ trials = [1=clicklink; 2=showresponse; 3=showfinishpage]
</block>
<trial clicklink>
/ stimulustimes = [1=button1, button2]
/ inputdevice = mouse
/ showmousecursor = true
/ validresponse = (button1, button2)
</trial>
<text response>
/ items= ("response = <% trial.clicklink.response %>")
</text>
<trial showresponse>
/ stimulustimes = [1=response]
/ timeout = 2000
/ ontrialbegin = [if (trial.clicklink.response == "button1") defaults.finishpage="http://www.organdonation.nhs.uk"]
</trial>
<text whatpage>
/ items= ("finish page = <% defaults.finishpage %>")
</text>
<trial showfinishpage>
/ stimulustimes = [1=whatpage]
/ timeout = 2000
</trial>
<picture button1>
/ items = ("button1.png")
/ position = (50%, 55%)
</picture>
<picture button2>
/ items = ("button2.png")
/ position = (50%, 85%)
</picture>