Record response within a time window


Author
Message
Libra
Libra
Associate Member (90 reputation)Associate Member (90 reputation)Associate Member (90 reputation)Associate Member (90 reputation)Associate Member (90 reputation)Associate Member (90 reputation)Associate Member (90 reputation)Associate Member (90 reputation)Associate Member (90 reputation)
Group: Forum Members
Posts: 26, Visits: 99
Hi, 

I am using Inquisit 6 lab to code for a priming task. In a given trial, a fixation cross will be presented for 500ms. Then a prime word will be presented for 200ms, followed by a blank screen of 100ms. Then a target word will show up for 500ms. Participants' task is to categorize the target word as either positive or negative by pressing one of the two keys "a" or "l". The inter-trial interval will be jittered between 1500ms to 3500ms, during which a blank screen is presented. 

While the target word is only presented for 500ms, we want to continue to record their response as long as the response is made within 1000ms from the presentation of the target word. I wonder if the following way to code a single trial would work? Thank you for your suggestions! 

<trial POSOBJ_posBG_1>
/ validresponse = ("a", "l")
/ correctresponse = ("l")
/ stimulustimes = [0 = fixation; 500=noreplace (POSOBJ);
700 = blanks;
800 = goodtarget;
1300=blanks]
/ trialdata = [POSOBJ goodtarget]
/ responsetrial = ("a", lefterr)
/ responsetrial = ("l", rightcor)
/posttrialpause = noreplace(1000,1500,2000,2500,3000)
/ timeout=1800
</trial>
Dave
Dave
Supreme Being (968K reputation)Supreme Being (968K reputation)Supreme Being (968K reputation)Supreme Being (968K reputation)Supreme Being (968K reputation)Supreme Being (968K reputation)Supreme Being (968K reputation)Supreme Being (968K reputation)Supreme Being (968K reputation)
Group: Administrators
Posts: 11K, Visits: 74K
Libra - 10/6/2021
Hi, 

I am using Inquisit 6 lab to code for a priming task. In a given trial, a fixation cross will be presented for 500ms. Then a prime word will be presented for 200ms, followed by a blank screen of 100ms. Then a target word will show up for 500ms. Participants' task is to categorize the target word as either positive or negative by pressing one of the two keys "a" or "l". The inter-trial interval will be jittered between 1500ms to 3500ms, during which a blank screen is presented. 

While the target word is only presented for 500ms, we want to continue to record their response as long as the response is made within 1000ms from the presentation of the target word. I wonder if the following way to code a single trial would work? Thank you for your suggestions! 

<trial POSOBJ_posBG_1>
/ validresponse = ("a", "l")
/ correctresponse = ("l")
/ stimulustimes = [0 = fixation; 500=noreplace (POSOBJ);
700 = blanks;
800 = goodtarget;
1300=blanks]
/ trialdata = [POSOBJ goodtarget]
/ responsetrial = ("a", lefterr)
/ responsetrial = ("l", rightcor)
/posttrialpause = noreplace(1000,1500,2000,2500,3000)
/ timeout=1800
</trial>

You'll want a few additions:
(1) /beginresponsetime set to 800 to have the trial accept responses starting with the onset of the target at 800ms into the trial.
https://www.millisecond.com/support/docs/v6/html/language/attributes/beginresponsetime.htm
https://www.millisecond.com/support/docs/v6/html/language/responsetiming.htm
(2) /responseinterrupt set to frames in order to have the "blanks" stimulus at 1300ms still show up even if response occurs before the onset of said stimulus.
https://www.millisecond.com/support/docs/v6/html/language/attributes/responseinterrupt.htm

<trial POSOBJ_posBG_1>
/ validresponse = ("a", "l")
/ correctresponse = ("l")
/ stimulustimes = [0 = fixation; 500=noreplace (POSOBJ);
700 = blanks;
800 = goodtarget;
1300=blanks]
/ trialdata = [POSOBJ goodtarget]
/ responsetrial = ("a", lefterr)
/ responsetrial = ("l", rightcor)
/posttrialpause = noreplace(1000,1500,2000,2500,3000)
/ timeout=1800
/ beginresponsetime = 800 // start accepting responses with onset of target stimulus at 800ms
/ responseinterrupt = frames // do not terminate stimulus presentation sequence immediately upon detecting response, but complete presentation of all frames
</trial>


Edited 3 Weeks Ago by Dave
Libra
Libra
Associate Member (90 reputation)Associate Member (90 reputation)Associate Member (90 reputation)Associate Member (90 reputation)Associate Member (90 reputation)Associate Member (90 reputation)Associate Member (90 reputation)Associate Member (90 reputation)Associate Member (90 reputation)
Group: Forum Members
Posts: 26, Visits: 99
Thank you, Dave! 
Best, 
Minghui

Libra
Libra
Associate Member (90 reputation)Associate Member (90 reputation)Associate Member (90 reputation)Associate Member (90 reputation)Associate Member (90 reputation)Associate Member (90 reputation)Associate Member (90 reputation)Associate Member (90 reputation)Associate Member (90 reputation)
Group: Forum Members
Posts: 26, Visits: 99
Hi Dave, 
I wonder if it is possible to achieve a more complicated jittering of the inter-trial interval (ITI). We want to use pseudo-exponential jittering. Specifically, we hope that the ITI will be set so that 50% of trials have a 4s ITI, 25% have a 5s ITI, 12% have a 6s ITI, 7% with a 7s ITI, and 6% with an 8s ITI. Is there any simple code to specify the "posttrialpause" so that we could achieve this? Thank you!
Minghui

Dave
Dave
Supreme Being (968K reputation)Supreme Being (968K reputation)Supreme Being (968K reputation)Supreme Being (968K reputation)Supreme Being (968K reputation)Supreme Being (968K reputation)Supreme Being (968K reputation)Supreme Being (968K reputation)Supreme Being (968K reputation)
Group: Administrators
Posts: 11K, Visits: 74K
Libra - 10/7/2021
Hi Dave, 
I wonder if it is possible to achieve a more complicated jittering of the inter-trial interval (ITI). We want to use pseudo-exponential jittering. Specifically, we hope that the ITI will be set so that 50% of trials have a 4s ITI, 25% have a 5s ITI, 12% have a 6s ITI, 7% with a 7s ITI, and 6% with an 8s ITI. Is there any simple code to specify the "posttrialpause" so that we could achieve this? Thank you!
Minghui

You can put the ITI values in the proportions you want into a <list> and sample from that list for the /posttrialpause. Suppose you have 100 trials, then this amounts to

<values>
/ iti = 0
</values>

<list itis>
/ items = (4000, 5000, 6000, 7000, 8000)
/ itemprobabilities = (.50, .25, .12, .07, .06)
/ poolsize = 100
</list>

<block exampleblock>
/ trials = [1-100 = exampletrial]
</block>

<trial exampletrial>
/ ontrialbegin = [
    values.iti = list.itis.nextvalue;
]
/ timeout = 0
/ posttrialpause = values.iti
</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