Millisecond Forums

aborting experiment conditional on response

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

By nrouhani - 4/3/2019

hello!

during the instructions portion of my task, participants have to correctly respond to some questions before starting the real task. however, if they exit out of the experiment, the next file within the batch section automatically begins to load allowing them to continue with the experiment. is there a command or a way that forces them to exit the whole experiment? 

thank you!
By Dave - 4/3/2019

nrouhani - Wednesday, April 3, 2019
hello!

during the instructions portion of my task, participants have to correctly respond to some questions before starting the real task. however, if they exit out of the experiment, the next file within the batch section automatically begins to load allowing them to continue with the experiment. is there a command or a way that forces them to exit the whole experiment? 

thank you!

Yes, you can terminate the entire batch of scripts by calling script.abort(true) conditionally /ontrialend (or /onblockend, depending on your script's structure).

https://www.millisecond.com/support/docs/v5/html/language/functions/abort.htm
By nrouhani - 4/3/2019

Dave - Wednesday, April 3, 2019
nrouhani - Wednesday, April 3, 2019
hello!

during the instructions portion of my task, participants have to correctly respond to some questions before starting the real task. however, if they exit out of the experiment, the next file within the batch section automatically begins to load allowing them to continue with the experiment. is there a command or a way that forces them to exit the whole experiment? 

thank you!

Yes, you can terminate the entire batch of scripts by calling script.abort(true) conditionally /ontrialend (or /onblockend, depending on your script's structure).

https://www.millisecond.com/support/docs/v5/html/language/functions/abort.htm

thank you for this response! is there a way to do this on a surveypage? based on previous questions i've created the following, but when i dropdown to "abort" nothing happens, thank you!

<surveypage fail>
/ caption = "You did not answer every question correctly. Please re-read the instructions" 
/ questions = [1=abort]
/ fontstyle = ("Arial", 20)
/ txcolor = white
/ nextbuttonposition = (-10%, -10%)
/ branch = [
  if (dropdown.abort.response == "Abort") script.abort(true)
]
</surveypage>

<dropdown abort>
/ options = ("Keep going", "Abort")
/ defaultresponse = "Keep going"
</dropdown>
By Dave - 4/3/2019

nrouhani - Wednesday, April 3, 2019
Dave - Wednesday, April 3, 2019
nrouhani - Wednesday, April 3, 2019
hello!

during the instructions portion of my task, participants have to correctly respond to some questions before starting the real task. however, if they exit out of the experiment, the next file within the batch section automatically begins to load allowing them to continue with the experiment. is there a command or a way that forces them to exit the whole experiment? 

thank you!

Yes, you can terminate the entire batch of scripts by calling script.abort(true) conditionally /ontrialend (or /onblockend, depending on your script's structure).

https://www.millisecond.com/support/docs/v5/html/language/functions/abort.htm

thank you for this response! is there a way to do this on a surveypage? based on previous questions i've created the following, but when i dropdown to "abort" nothing happens, thank you!

<surveypage fail>
/ caption = "You did not answer every question correctly. Please re-read the instructions" 
/ questions = [1=abort]
/ fontstyle = ("Arial", 20)
/ txcolor = white
/ nextbuttonposition = (-10%, -10%)
/ branch = [
  if (dropdown.abort.response == "Abort") script.abort(true)
]
</surveypage>

<dropdown abort>
/ options = ("Keep going", "Abort")
/ defaultresponse = "Keep going"
</dropdown>

Yes, you can do this on a surveypage, but as noted before the attribute you need to use is /ontrialend, not /branch:

<surveypage fail>
/ caption = "You did not answer every question correctly. Please re-read the instructions" 
/ questions = [1=abort]
/ fontstyle = ("Arial", 20)
/ txcolor = white
/ nextbuttonposition = (-10%, -10%)
/ ontrialend = [
  if (dropdown.abort.response == "Abort") script.abort(true)
]
</surveypage>


By James Rounds - 9/24/2020


Thank you - this is exactly what I was looking for!