Millisecond Forums

Introducing a timeout after a trial and restart the trial!

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

By NinaBergner - 1/25/2021

Hello!

In my experimental study, avatars are moving towards each other to measure social distancing behavior. Participants are asked to indicate within 30 seconds the least appropriate distance between these avatars by pressing the spacebar. If participants do not respond in time, I would like to include a timeout (10 seconds break for the participants with a text - stating that they did not respond in time and the trial will begin again). Afterward, the trial after this message should start again.

I thought about using the responsetrial function and /responsetrial = (noresponse, sametrial*) to restart the trial after the error message. However, it did not work and I do not know how to include it. Do you know how I could adjust my script to include a timeout + restart of the trial?

As the available space is already used, I will upload the ZIP file as a response to this message.

Thank you in advance for helping!

****************************************************
Defaults and settings for all distancing tasks
****************************************************

<defaults>
/ canvasaspectratio = (1,1)
/ canvassize = (100%, 100%)
</defaults>

<clock timer>
/ mode = timer
/ resetrate = block
/ erase = false
/ txcolor = white
/ txbgcolor = black
/ timeout = 30000
/ position = (50%, 10%)
/ format = "mm:ss"
</clock>

<text spacebar_SD>
/ items = ("Please press the SPACE BAR at the least
    appropriate social distance.")
/ position = (50%, 95%)
/ valign = bottom
</text>

**************************************
Social Distancing Task 4
**************************************
<item SD4Woman>
/1 = "SD4Woman.png"
</item>

<item SD4Scenario>
/1 = "SD4Scenario.png"
</item>

<picture SD4Woman>
/ items = item.SD4Woman
/ size = (46%, 46%)
/ animation=path(5000, 6, 5%, 56%, 41%, 62%)
</picture>

<picture SD4Scenario>
/ items = item.SD4Scenario
/ position = (50%, 50%)
/ size = (100%, 80%)
</picture>

<trial SD4Woman>
/ stimulusframes = [1=SD4Woman, SD4Scenario, clock.timer, spacebar_SD]
/ validresponse = (57)
</trial>

<trial SD4Scenario>
/ stimulustimes = [1=SD4Scenario]
/ correctresponse = (" ")
/ errormessage = false
/ recorddata = false
</trial>

<block SD4Woman>
/ trials = [1 = SD4Woman]
</block>

<block Social_Distancing4>
/ trials = [1 = SD4Woman]
</block>

******************************************************
<expt>
/ blocks = [1=block.Social_Distancing4]
</expt>
******************************************************
By NinaBergner - 1/25/2021

https://we.tl/t-xeuvCQL9H2


This is the link for downloading the two pictures for the animation.
By Dave - 1/25/2021

NinaBergner - 1/25/2021
https://we.tl/t-xeuvCQL9H2


This is the link for downloading the two pictures for the animation.

****************************************************
Defaults and settings for all distancing tasks
****************************************************

<defaults>
/ canvasaspectratio = (1,1)
/ canvassize = (100%, 100%)
</defaults>

<clock timer>
/ mode = timer
/ resetrate = trial
/ erase = false
/ txcolor = white
/ txbgcolor = black
/ timeout = 30000
/ position = (50%, 10%)
/ format = "mm:ss"
</clock>

<text spacebar_SD>
/ items = ("Please press the SPACE BAR at the least
  appropriate social distance.")
/ position = (50%, 95%)
/ valign = bottom
</text>

**************************************
Social Distancing Task 4
**************************************
<item SD4Woman>
/1 = "SD4Woman.png"
</item>

<item SD4Scenario>
/1 = "SD4Scenario.png"
</item>

<picture SD4Woman>
/ items = item.SD4Woman
/ size = (46%, 46%)
/ animation=path(5000, 6, 5%, 56%, 41%, 62%)
</picture>

<picture SD4Scenario>
/ items = item.SD4Scenario
/ position = (50%, 50%)
/ size = (100%, 80%)
</picture>

<trial SD4Woman>
/ stimulusframes = [1=SD4Woman, SD4Scenario, clock.timer, spacebar_SD]
/ validresponse = (57)
/ timeout = 30000
/ branch = [
    if (trial.SD4Woman.response == 0) {
        trial.sd4_reminder;
    }
]
</trial>

<trial sd4_reminder>
/ stimulusframes = [1=clearscreen, remindertext]
/ validresponse = (0)
/ trialduration = 10000
/ branch = [
    trial.SD4Woman;
]
</trial>

<text remindertext>
/ items = ("You did not respond in time. The trial will restart in 10 seconds.")
</text>


<trial SD4Scenario>
/ stimulustimes = [1=SD4Scenario]
/ correctresponse = (" ")
/ errormessage = false
/ recorddata = false
</trial>

<block SD4Woman>
/ trials = [1 = SD4Woman]
</block>

<block Social_Distancing4>
/ trials = [1 = SD4Woman]
</block>

******************************************************
<expt>
/ blocks = [1=block.Social_Distancing4]
</expt>
******************************************************
By NinaBergner - 1/25/2021

Thanks a lot, Dave!