Inquisit Web - Final page - redirect to a url only if the participant complete the experiment


Inquisit Web - Final page - redirect to a url only if the participant...
Author
Message
abuvar
abuvar
New Member (28 reputation)New Member (28 reputation)New Member (28 reputation)New Member (28 reputation)New Member (28 reputation)New Member (28 reputation)New Member (28 reputation)New Member (28 reputation)New Member (28 reputation)
Group: Forum Members
Posts: 2, Visits: 12
Thanks a lot Dave, it is working!
Edited 2 Years Ago by 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
abuvar - 11/10/2022
Hello,
I have a similar issue. We are running a web experiment and those who finished a valid GNAT get redirected to a url (I use the Finish page/redirect to an external web site for that). However, those who did not have valid scores for the GNAT get redirected to another url. 
We created a trial and a block for the latter case:
<trial failed>
/ ontrialend= [if ( values.failed == 1 ) defaults.finishpage = "https://tgm.mobi/status/scr?id=${e://Field/id}/";
script.abort();]
/ skip = [
        if ( values.failed == 0 )
]
<block failed>
/trials = [1 = failed]
/skip = [expressions.AA_dprime > 0 && expressions.AB_dprime > 0]
</block>

Then, the experiment goes like this:
<expt>
/ blocks = [
    1 = trainingStart;
    2-4 = random (attributeA_responsetimeout1, attributeB_responsetimeout1, TargetA_responsetimeout1);
    5 = testStart;
  6-7 = random(TargetAattributeA_responsetimeout2, TargetAattributeB_responsetimeout2);
  8 = speedup;
  9-10 = random(TargetAattributeA_responsetimeout3, TargetAattributeB_responsetimeout3);
    11 = failed;
    12 = end
    ]
/ preinstructions = (begin1, begin2, begin3)
</expt>
If I test the experiment and I do not get a valid GNAT, I get the right "failed" message, but unfortunately, I am redirected to the page as if I had a valid GNAT.
Could you help me on this?
Thanks!







Things work a bit differently under Inquisit 6, which is what you're using. To make this work, you'll want to do the following.

(1) In the web experiment's settings, leave the finish page settings at their default, i.e.



(2) In the script, first thing you do /onexptbegin is set defaults.finishpage to the URL you normally want participants be redirected to;

<expt>
/ onexptbegin = [
    defaults.finishpage = "https://www.example.com/"; // your actual URL here
]
/ blocks = [
    1 = trainingStart;
    2-4 = random (attributeA_responsetimeout1, attributeB_responsetimeout1, TargetA_responsetimeout1);
    5 = testStart;
  6-7 = random(TargetAattributeA_responsetimeout2, TargetAattributeB_responsetimeout2);
  8 = speedup;
  9-10 = random(TargetAattributeA_responsetimeout3, TargetAattributeB_responsetimeout3);
    11 = failed;
    12 = end
    ]
/ preinstructions = (begin1, begin2, begin3)
</expt>


You need not worry about URL parameters here, any parameters that come in to the experiment's start page will be automatically added to that URL upon redirection.

(3) In the code as you have it, you can then override the finishpage set /onexptbegin if a participant fails to perform adequately.

<block failed>
/trials = [1 = failed]
/skip = [expressions.AA_dprime > 0 && expressions.AB_dprime > 0]
</block>

<trial failed>
/ ontrialend= [if ( values.failed == 1 ) defaults.finishpage = "https://tgm.mobi/status/scr";]
/ skip = [
        values.failed == 0]
/ frames = [1 = failed, exit]
/ correctresponse = (" ")
/ errormessage = false
/ correctmessage = false
/ recorddata = false
</trial>

Edited 2 Years Ago by Dave
abuvar
abuvar
New Member (28 reputation)New Member (28 reputation)New Member (28 reputation)New Member (28 reputation)New Member (28 reputation)New Member (28 reputation)New Member (28 reputation)New Member (28 reputation)New Member (28 reputation)
Group: Forum Members
Posts: 2, Visits: 12
Hello,
I have a similar issue. We are running a web experiment and those who finished a valid GNAT get redirected to a url (I use the Finish page/redirect to an external web site for that). However, those who did not have valid scores for the GNAT get redirected to another url. 
We created a trial and a block for the latter case:
<trial failed>
/ ontrialend= [if ( values.failed == 1 ) defaults.finishpage = "https://tgm.mobi/status/scr?id=${e://Field/id}/";
script.abort();]
/ skip = [
        if ( values.failed == 0 )
]
<block failed>
/trials = [1 = failed]
/skip = [expressions.AA_dprime > 0 && expressions.AB_dprime > 0]
</block>

Then, the experiment goes like this:
<expt>
/ blocks = [
    1 = trainingStart;
    2-4 = random (attributeA_responsetimeout1, attributeB_responsetimeout1, TargetA_responsetimeout1);
    5 = testStart;
  6-7 = random(TargetAattributeA_responsetimeout2, TargetAattributeB_responsetimeout2);
  8 = speedup;
  9-10 = random(TargetAattributeA_responsetimeout3, TargetAattributeB_responsetimeout3);
    11 = failed;
    12 = end
    ]
/ preinstructions = (begin1, begin2, begin3)
</expt>
If I test the experiment and I do not get a valid GNAT, I get the right "failed" message, but unfortunately, I am redirected to the page as if I had a valid GNAT.
Could you help me on this?
Thanks!







Dave
Dave
Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)
Group: Administrators
Posts: 13K, Visits: 104K
Dave - 7/11/2022
jxb - 7/11/2022
Where I am getting stuck is how to utilize an if statement in /onscriptend to redirect them only if they get to the last file on the batch script.

In the attached script "redirect_expt.iqx" I am able to have it only redirect to that url if they get through all blocks using equations in <block redirect> and /onexptend.

But in the attached script "00_batch.iqx" it redirects to that url regardless of if I got through all of the files or not when I put a similar if statement in /onscriptend. I tried to <include > the last final as well but it still isn't working properly.

I hope this better explains where I am stuck.

<include> or <summarydata> elements have no place in a batch script, so I'm not sure what this is supposed to do in the first place.

> Where I am getting stuck is how to utilize an if statement in /onscriptend to redirect them only if they get to the last file on the batch script.

If that's all you want, then it's as simple as

<defaults >
/ quitcommand = (Ctrl+36)
</defaults>

<batch 1>
/ file = "panas-10.iqx"
/ file = "redirect_test.iqx"
/ onscriptend = [
    if (batch.1.currentscript == "redirect_test.iqx") {
        defaults.finishpage="https://www.welcome.miami.edu";
    };
]
</batch>


And if you want to get more elaborate, you can alternatively or in addition work with batch values and parameters ( https://www.millisecond.com/support/docs/v5/html/howto/batchparameters.htm ). See the attached example files.

Attachments
examplebatch.iqx (147 views, 366 bytes)
a.iqx (142 views, 558 bytes)
b.iqx (137 views, 558 bytes)
c.iqx (141 views, 558 bytes)
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
jxb - 7/11/2022
Where I am getting stuck is how to utilize an if statement in /onscriptend to redirect them only if they get to the last file on the batch script.

In the attached script "redirect_expt.iqx" I am able to have it only redirect to that url if they get through all blocks using equations in <block redirect> and /onexptend.

But in the attached script "00_batch.iqx" it redirects to that url regardless of if I got through all of the files or not when I put a similar if statement in /onscriptend. I tried to <include > the last final as well but it still isn't working properly.

I hope this better explains where I am stuck.

<include> or <summarydata> elements have no place in a batch script, so I'm not sure what this is supposed to do in the first place.

> Where I am getting stuck is how to utilize an if statement in /onscriptend to redirect them only if they get to the last file on the batch script.

If that's all you want, then it's as simple as

<defaults >
/ quitcommand = (Ctrl+36)
</defaults>

<batch 1>
/ file = "panas-10.iqx"
/ file = "redirect_test.iqx"
/ onscriptend = [
    if (batch.1.currentscript == "redirect_test.iqx") {
        defaults.finishpage="https://www.welcome.miami.edu";
    };
]
</batch>


jxb
jxb
Respected Member (314 reputation)Respected Member (314 reputation)Respected Member (314 reputation)Respected Member (314 reputation)Respected Member (314 reputation)Respected Member (314 reputation)Respected Member (314 reputation)Respected Member (314 reputation)Respected Member (314 reputation)
Group: Forum Members
Posts: 15, Visits: 163
Where I am getting stuck is how to utilize an if statement in /onscriptend to redirect them only if they get to the last file on the batch script.

In the attached script "redirect_expt.iqx" I am able to have it only redirect to that url if they get through all blocks using equations in <block redirect> and /onexptend.

But in the attached script "00_batch.iqx" it redirects to that url regardless of if I got through all of the files or not when I put a similar if statement in /onscriptend. I tried to <include > the last final as well but it still isn't working properly.

I hope this better explains where I am stuck.
Attachments
00_batch.iqx (172 views, 448 bytes)
redirect_test.iqx (173 views, 933 bytes)
redirect_expt.iqx (176 views, 1.00 KB)
panas-10.iqx (176 views, 20.00 KB)
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
jxb - 7/11/2022
Hello,

I am also trying to redirect participants to a specific url ONLY if they completed the entire experiment. Is there a way to do this when using a batch file?

I was able to get it working properly with an <expt > file as mentioned above but so far have failed at using a similar approach with a batch file.

jxb

In that case you need to set defaults.finishpage /onscriptend in the batch script.
jxb
jxb
Respected Member (314 reputation)Respected Member (314 reputation)Respected Member (314 reputation)Respected Member (314 reputation)Respected Member (314 reputation)Respected Member (314 reputation)Respected Member (314 reputation)Respected Member (314 reputation)Respected Member (314 reputation)
Group: Forum Members
Posts: 15, Visits: 163
Hello,

I am also trying to redirect participants to a specific url ONLY if they completed the entire experiment. Is there a way to do this when using a batch file?

I was able to get it working properly with an <expt > file as mentioned above but so far have failed at using a similar approach with a batch file.

jxb
tecnika
tecnika
Guru (14K reputation)Guru (14K reputation)Guru (14K reputation)Guru (14K reputation)Guru (14K reputation)Guru (14K reputation)Guru (14K reputation)Guru (14K reputation)Guru (14K reputation)
Group: Forum Members
Posts: 156, Visits: 790
ebroggin - Thursday, January 18, 2018
Dave - Wednesday, January 17, 2018
ebroggin - Wednesday, January 17, 2018
Dave - Monday, January 15, 2018
ebroggin - Monday, January 15, 2018
Hello,

Is it possible to redirect the participant to a final web page only once it has completed the whole experiment? If I add weblink of the final page in the "redirect to a url" option in "the final page", it redirects the participant also if s/he quit the experiment with Ctrl+Q.

Send participants to a page on millisecond.com or a different web site.

If this is not possible it will be ok if the last page of the experiment will inclide an hyperlink. Does Inquisit support Hyperlink?

Thank you,

Elena

> Is it possible to redirect the participant to a final web page only once it has completed the whole experiment?

Yes. You can set the defaults.finishpage property in the script /onexptend when some condition is met.

> If this is not possible it will be ok if the last page of the experiment will inclide an hyperlink. Does Inquisit support Hyperlink?

This is also possible. You can upload a simple HTML file along with your experiment that contains / displays your clickable hyperlink. You can set that HTML file to be used as "custom" finish page in your web experiment's settings.

Thank you, it works both ways! I am now trying to view the survey data in the same data file of other behavioural responses. I have tried with different attempt but this generate a data file with the right column name (the surveys one included), but these cells are empty. How can I view in the same data file the responses of the survey that is included in my inquisit experiment?



<data>
/file = "Data_LEFT_sociodemographic_webpage.iqdat"
/ separatefiles = false
/ columns = [build, date, time, subject, group, blockcode, values.block_nr, values.trial_nr, values.image, values.sentence, response, values.probability, values.wording, values.context, values.colour, values.keypress,
values.decision, latency, values.hazard, values.DecisionPerformace, values.totalblockdecision, values.TotalDecision, values.TotalBlockPerformance, values.totalperformance,
surveypage.ambiguity.response, dropdown.handedness.response, dropdown.handedness.selected, surveypage.handedness.response, surveypage.English.response, surveypage.age.response, surveypage.gender.response, surveypage.ethnicity.response,
surveypage.job.response, surveypage.education, openended.Comments.response]
</data>

Thank you,
Elena






Two options:
(1) Run your <surveypage>s via a <block> element's /trials attribute, not via a <survey> element. The will be captured in the data file just like any other type of <trial> then.
(2) Log the proper properties. A <surveypage> doesn't really have a "response", that's why surveypage.ambiguity.response returns nothing / remains empty. The things that do have responses are the actual question elements you are using, e.g as in radiobuttons.someradiobuttonsquestions.response.

Hi Dave,  I have just tried to run the experiment following the option 2), but no luck. I remember I have done it in the past with Inquisit 4, but with this is does not work and I don't have an Inquisit 4 version to try out. Am I doing it wrong? Please see experiment file and data file attached.        Regards,Elena





Got it working. Thank you!



tecnika
tecnika
Guru (14K reputation)Guru (14K reputation)Guru (14K reputation)Guru (14K reputation)Guru (14K reputation)Guru (14K reputation)Guru (14K reputation)Guru (14K reputation)Guru (14K reputation)
Group: Forum Members
Posts: 156, Visits: 790
Dave - Wednesday, January 17, 2018
ebroggin - Wednesday, January 17, 2018
Dave - Monday, January 15, 2018
ebroggin - Monday, January 15, 2018
Hello,

Is it possible to redirect the participant to a final web page only once it has completed the whole experiment? If I add weblink of the final page in the "redirect to a url" option in "the final page", it redirects the participant also if s/he quit the experiment with Ctrl+Q.

Send participants to a page on millisecond.com or a different web site.

If this is not possible it will be ok if the last page of the experiment will inclide an hyperlink. Does Inquisit support Hyperlink?

Thank you,

Elena

> Is it possible to redirect the participant to a final web page only once it has completed the whole experiment?

Yes. You can set the defaults.finishpage property in the script /onexptend when some condition is met.

> If this is not possible it will be ok if the last page of the experiment will inclide an hyperlink. Does Inquisit support Hyperlink?

This is also possible. You can upload a simple HTML file along with your experiment that contains / displays your clickable hyperlink. You can set that HTML file to be used as "custom" finish page in your web experiment's settings.

Thank you, it works both ways! I am now trying to view the survey data in the same data file of other behavioural responses. I have tried with different attempt but this generate a data file with the right column name (the surveys one included), but these cells are empty. How can I view in the same data file the responses of the survey that is included in my inquisit experiment?



<data>
/file = "Data_LEFT_sociodemographic_webpage.iqdat"
/ separatefiles = false
/ columns = [build, date, time, subject, group, blockcode, values.block_nr, values.trial_nr, values.image, values.sentence, response, values.probability, values.wording, values.context, values.colour, values.keypress,
values.decision, latency, values.hazard, values.DecisionPerformace, values.totalblockdecision, values.TotalDecision, values.TotalBlockPerformance, values.totalperformance,
surveypage.ambiguity.response, dropdown.handedness.response, dropdown.handedness.selected, surveypage.handedness.response, surveypage.English.response, surveypage.age.response, surveypage.gender.response, surveypage.ethnicity.response,
surveypage.job.response, surveypage.education, openended.Comments.response]
</data>

Thank you,
Elena






Two options:
(1) Run your <surveypage>s via a <block> element's /trials attribute, not via a <survey> element. The will be captured in the data file just like any other type of <trial> then.
(2) Log the proper properties. A <surveypage> doesn't really have a "response", that's why surveypage.ambiguity.response returns nothing / remains empty. The things that do have responses are the actual question elements you are using, e.g as in radiobuttons.someradiobuttonsquestions.response.

Hi Dave,  I have just tried to run the experiment following the option 2), but no luck. I remember I have done it in the past with Inquisit 4, but with this is does not work and I don't have an Inquisit 4 version to try out. Am I doing it wrong? Please see experiment file and data file attached.        Regards,Elena





Attachments
GO

Merge Selected

Merge into selected topic...



Merge into merge target...



Merge into a specific topic ID...




Reading This Topic

Explore
Messages
Mentions
Search