How to program: if the participant doesn't respond - use posttrialpause(2,5 seconds), if the user...


Author
Message
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: 105K
mingwu - Wednesday, November 23, 2016
I have posttrialpause set for 2,5 seconds. What i would like to change: if the participant doesn't respond - use posttrialpause (2,5 seconds), if the participant responds - no pause.
Here is the script: 
<trial redcontrol2> 

/ontrialbegin = [
    values.congruency = 3;
]
/ timeout = 2500
/ posttrialpause = 2500
/ stimulustimes = [1=redcontrol, redreminder, greenreminder, bluereminder, purplereminder]
/ correctresponse = ("d")
/ validresponse = ("d", "f", "j", "k")
/ontrialend = [
    list.responses.insertitem(trial.redcontrol2.correct, 1);
    list.responses_control.insertitem(trial.redcontrol2.correct, 1);
    
    if (trial.redcontrol2.correct) {
        list.latencies.insertitem(trial.redcontrol.latency, 1);
        list.latencies_control.insertitem(trial.redcontrol2.latency, 1);
    }
]
</trial>

You can't do this using /posttrialpause. The currently running instance of a <trial> cannot manipulate the current instance's /posttrialpause.

What you need to do is create a separate <trial> that serves as "posttrialpause". Then /branch to that trial as needed.

<trial mytrial>
/ stimulusframes = [1=mytext]
/ correctresponse = ("d")
/ validresponse = ("d", "f", "j", "k")
/ timeout = 2500
/ branch = [
    if (trial.mytrial.response == 0) trial.post_tp;
]
</trial>

<trial post_tp>
/ trialduration = 2500
/ validresponse = (0)
</trial>


<text mytext>
/ items = ("EXAMPLE")
</text>

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



mingwu
mingwu
Partner Member (693 reputation)Partner Member (693 reputation)Partner Member (693 reputation)Partner Member (693 reputation)Partner Member (693 reputation)Partner Member (693 reputation)Partner Member (693 reputation)Partner Member (693 reputation)Partner Member (693 reputation)
Group: Forum Members
Posts: 6, Visits: 16
I have posttrialpause set for 2,5 seconds. What i would like to change: if the participant doesn't respond - use posttrialpause (2,5 seconds), if the participant responds - no pause.
Here is the script: 
<trial redcontrol2> 

/ontrialbegin = [
    values.congruency = 3;
]
/ timeout = 2500
/ posttrialpause = 2500
/ stimulustimes = [1=redcontrol, redreminder, greenreminder, bluereminder, purplereminder]
/ correctresponse = ("d")
/ validresponse = ("d", "f", "j", "k")
/ontrialend = [
    list.responses.insertitem(trial.redcontrol2.correct, 1);
    list.responses_control.insertitem(trial.redcontrol2.correct, 1);
    
    if (trial.redcontrol2.correct) {
        list.latencies.insertitem(trial.redcontrol.latency, 1);
        list.latencies_control.insertitem(trial.redcontrol2.latency, 1);
    }
]
</trial>

GO

Merge Selected

Merge into selected topic...



Merge into merge target...



Merge into a specific topic ID...




Reading This Topic

Explore
Messages
Mentions
Search