Cued-No go task


Author
Message
Sen
Sen
New Member (6 reputation)New Member (6 reputation)New Member (6 reputation)New Member (6 reputation)New Member (6 reputation)New Member (6 reputation)New Member (6 reputation)New Member (6 reputation)New Member (6 reputation)
Group: Forum Members
Posts: 1, Visits: 6
Hello, 
I am new to the world of inquisit and coding so my apologies if this is a fundamental question, but my code for the 'cuedgonogo/iqx' is not working and I was wondering if anyone had any insights into why it might be. I am just trying to add a practice trial at the beginning so that participants can get familiar with a practice block before going into the actual test block. 
I have put the full code and then the modified code below. Any help would be greatly appreciated. 

<usermanual>
___________________________________________________________________________________________________________________    

                                    Cued Go / No-Go Task
___________________________________________________________________________________________________________________

last updated: 02-23-2022 by K. Borchert (katjab@millisecond.com) for Millisecond Software, LLC
Script Copyright © 09-30-2022 Millisecond Software

___________________________________________________________________________________________________________________
BACKGROUND INFO     
___________________________________________________________________________________________________________________
Go/Nogo Tasks are used as behavioral measures of inhibition and cognitive control.                                             
This script implements a probability based cued Go / No-Go Task that presents
a) cues that predict go trials with a high probability ('go cue') and b) cues that predict nogo
trials with a high probability ('nogo cue').
In general, commission errors are of particular interest in all Go/Nogo tasks as a measure of cognitive
control. In cued Go/Nogo tasks, go-cues are thought to generate a response prepotency that
speed up correct responses in go-trials but add an additional difficulty to overcome in subsequent
nogo trials and therefore increase the likelihood of commission errors.
As a result, the cued go/nogo paradigm provides a sensitive measure of cognitive control.

The implemented procedure is based on:

Fillmore, M. T., Rush, C. R., & Hays, L. (2006). Acute effects of cocaine in two models of inhibitory control:
implications of non-linear dose effects. Addiction, 101, 1323–1332.

___________________________________________________________________________________________________________________
TASK DESCRIPTION    
___________________________________________________________________________________________________________________
Participants are asked to press the Spacebar when they see a green rectangle (=go) but refrain from pressing the Spacebar
when they see a blue rectangle (=nogo). The blue and green rectangles can be vertical or horizontal. The
vertical rectangle has a high probability of being green (a go trial) and the horizontal rectangle has a high probability of
being blue (a nogo trial). Participants get information about the orientation of the rectangle (=cue) shortly before
the color of the rectangle is revealed.

___________________________________________________________________________________________________________________    
DURATION
___________________________________________________________________________________________________________________    
the default set-up of the script takes appr. 10 minutes to complete

___________________________________________________________________________________________________________________    
DATA FILE INFORMATION
___________________________________________________________________________________________________________________
The default data stored in the data files are:

(1) Raw data file: 'cuedgonogo_raw*.iqdat' (a separate file for each participant)

build:                                The specific Inquisit version used (the 'build') that was run
computer.platform:                    the platform the script was run on (win/mac/ios/android)
date, time:                         date and time script was run
subject, group:                     with the current subject/groupnumber
session:                            with the current session id

blockcode, blocknum:                the name and number of the current block (built-in Inquisit variable)
trialcode, trialnum:                 the name and number of the currently recorded trial (built-in Inquisit variable)
                                        Note: trialnum is a built-in Inquisit variable; it counts all trials run; even those
                                        that do not store data to the data file such as feedback trials. Thus, trialnum
                                        may not reflect the number of main trials run per block.
                                        
trialcount:                            current trialcount

cuetype:                            1 = vertical cue (high probability of preceding a go-trial ~ a go cue)
                                    2 = horizontal cue (high probability of preceding a nogo-trial ~ a nogo cue)

targettype:                            1 = vertical go
                                    2 = vertical nogo
                                    3 = horizonal go
                                    4 = horizonal nogo
                                
targetcondition:                    1 = go target
                                    2 = nogo target
                                    
soa:                                current stimulus onset asynchrony
cuepic:                                the image file presented as the cue
targetpic:                            the image file presented as the target    

response:                            response made (either 57 = Spacebar or "" for no response)
correct:                            the accuracy of response (1 = correct; 0 = error)
latency:                            the latency (in ms) of the response (or if no response: trialduration); measured from onset of target


(2) Summary data file: 'cuedgonogo_summary*.iqdat' (a separate file for each participant)

inquisit.version:                         Inquisit version run
computer.platform:                    the platform the script was run on (win/mac/ios/android)
startdate:                            date script was run
starttime:                            time script was started
subjectid:                            assigned subject id number
groupid:                            assigned group id number
sessionid:                            assigned session id number
elapsedtime:                        time it took to run script (in ms); measured from onset to offset of script
completed:                            0 = script was not completed (prematurely aborted);
                                    1 = script was completed (all conditions run)

errorrate:                            overall error rate (omission + commission errors)
omissionrate:                        error rate in go-trials (participant missed to press Spacebar)
commission:                            error rate in nogo trials (participants hit the Spacebar)

error_verticalcue:                    error rate for trials in which cue = vertical
error_horizontalcue:                error rate for trials in which cue = horizontal
omissionerror_v:                    error rate for trials in which cue = vertical ('go' cue) and target = go
commission_v:                        error rate for trials in which cue = vertical ('go' cue) and target = nogo (DV of interest)
omissionerror_h:                    error rate for trials in which cue = horizontal ('nogo' cue) and target = go
commission_h:                        error rate for trials in which cue = horizontal ('nogo' cue) and target = nogo

meanrt:                                overall mean rt (in ms) for target = go (for hits = correct responses only)
meanrt_verticalcue_gotarget:        mean rt (in ms) for trial in which cue = vertical (go cue) and target = go (for hits = correct responses only)
meanrt_horizontalcue_gotarget:        mean rt (in ms) for trial in which cue = horizontal (nogo cue) and target = go (for hits = correct responses only)

___________________________________________________________________________________________________________________    
EXPERIMENTAL SET-UP
___________________________________________________________________________________________________________________    

Factorial design with
    5 x SOA (100,200,300,400,500)
    2 x Cue (1=vertical,2=horizontal)
    2 x Target (Go, No-Go)

    Vertical cue go / no-go ratio is 4:1 (80% go trials, 20% no-go trials) => higher probability of go trials after vertical cue
    Horizontal cue go / no-go ratio is 1:4 (20% go trials, 80% no-go trials) => higher probability of nogo trials after horizontal cue

    Minimum number of trials required to fulfill the above conditions is 50.
    Task runs 250 trials, i.e., each factor combination is repeated 5 times.

    => 100 vertical cue-go targets (20 for each SOA); 25 vertical cue-nogo targets (5 for each SOA)
    => 100 horizontal cue-nogo targets (20 for each SOA); 25 horizontal cue-go targets (5 for each SOA)
    
___________________________________________________________________________________________________________________    
STIMULI
___________________________________________________________________________________________________________________    
see section Editable Stimuli

___________________________________________________________________________________________________________________    
INSTRUCTIONS
___________________________________________________________________________________________________________________    
see section Editable Instructions

___________________________________________________________________________________________________________________    
EDITABLE CODE
___________________________________________________________________________________________________________________    
check below for (relatively) easily editable parameters, stimuli, instructions etc.
Keep in mind that you can use this script as a template and therefore always "mess" with the entire code
to further customize your experiment.

The parameters you can change are:

/ fixationduration:                duration of the fixation cross in ms (default: 800)
/ cue_delay:                    interstimulus interval between offset of fixation and onset of cue in ms (default: 500ms)
/ responsetimeout:                responsetimeout in ms (default: 1000)
/ iti:                            intertrial interval in ms (default: 700)

</usermanual>


**************************************************************************************************************
**************************************************************************************************************
    EDITABLE PARAMETERS: change editable parameters here
**************************************************************************************************************
**************************************************************************************************************

<parameters>
/ fixationduration = 800
/ cue_delay = 500
/ responsetimeout = 1000
/ iti = 700
</parameters>

**************************************************************************************************************
**************************************************************************************************************
    EDITABLE STIMULI: change editable stimuli here
**************************************************************************************************************
**************************************************************************************************************

<item cues>
/ 1 = "VCUE.jpg"
/ 2 = "HCUE.jpg"
</item>

<item targets>
/ 1 = "VGO.jpg"
/ 2 = "VNOGO.jpg"
/ 3 = "HGO.jpg"
/ 4 = "HNOGO.jpg"
</item>

**************************************************************************************************************
**************************************************************************************************************
    EDITABLE INSTRUCTIONS: change instructions here
**************************************************************************************************************
**************************************************************************************************************
<instruct>
/ fontstyle = ("Arial", 3%, false, false, false, false, 5, 1)
/ navigationbuttonfontstyle = ("Arial", 3%, false, false, false, false, 5, 1)
</instruct>

<page intro>
<br><br>
<h1>Welcome to the Go / No-Go Task!</h1><hr>
On each trial, a white rectangle will appear on the screen.<br>
After a short time, the rectangle will either turn <span style='color: green'>green</span> or <span style='color: blue'>blue</span>.<br><br>
<i>Press the spacebar <%expressions.buttoninstruct1%> as quickly as possible whenever the rectangle turns <span style='color: green'>green</span>.<br>
If the rectangle turns <span style='color: blue'>blue</span>, do not respond at all.</i><br><br>
Try to respond as quickly as possible while making as few errors as possible.<br>
There'll be no practice. The task will take about 10 minutes to complete.<br><br>
Press the spacebar to begin.
</page>

<page end>
<br><br><br><br><br><br><br><br>
<center>You have reached the end of the task.<br>
<h1>Thank you!</h1></center>
</page>

****************************************************************************************************
general instruction expressions: adjust the instruction text depending on device used to run script
****************************************************************************************************
<expressions>
/buttoninstruct1 = if (computer.touch && !computer.haskeyboard) {"button";} else {"key";}
</expressions>

**************************************************************************************************************
                                !!!REMAINING CODE: Customize after careful consideration only!!!
**************************************************************************************************************

**************************************************************************************************************
**************************************************************************************************************
    DEFAULTS
**************************************************************************************************************
**************************************************************************************************************
script requires Inquisit 6.6.1.0 or higher

<defaults >
/canvasaspectratio = (4,3)
/minimumversion = "6.6.1.0"
/ fontstyle = ("Arial", 3%, false, false, false, false, 5, 1)
/txbgcolor = white
/ txcolor = (0, 0, 0)
</defaults>


**************************************************************************************************************
**************************************************************************************************************
    DATA
**************************************************************************************************************
**************************************************************************************************************

Note: data file explanations under User Manual Information at the top

***********************
raw data file
***********************

<data>
/ columns = (build, computer.platform, date, time, subject, group, session, blockcode, blocknum,
trialcode, trialnum, values.trialcount,values.cuetype,values.targettype,
expressions.targetcondition, values.soa, values.cuepic,values.targetpic,response,correct,latency)
</data>

***********************
summary data file
***********************

<summarydata >
/ columns = (inquisit.version, computer.platform, script.startdate, script.starttime, script.subjectid, script.groupid, script.sessionid, script.elapsedtime,
script.completed,
expressions.errorrate, expressions.omissionrate, expressions.commission,
expressions.error_verticalcue, expressions.error_horizontalcue,
expressions.omissionerror_v, expressions.commission_v, expressions.omissionerror_h, expressions.commission_h,
expressions.meanrt, expressions.meanrt_verticalcue_gotarget, expressions.meanrt_horizontalcue_gotarget)
</summarydata>

**************************************************************************************************************
**************************************************************************************************************
    VALUES: automatically updated
**************************************************************************************************************
**************************************************************************************************************
            
/completed:                    0 = script was not completed; 1 = script was completed (all conditions were run)
/ soa:                        stimulus onset asynchrony
/ cuetype:                    1 = vertical cue; 2 = horizontal cue
/ targettype:                1 = vertical go
                            2 = vertical nogo
                            3 = horizonal go
                            4 = horizonal nogo
/ trialcount:                counts all trials
/cuepic:                    stores the current cue image
/targetpic:                    stores the current target image

<values taskparams>
/completed = 0
/ soa = 0
/ cuetype = 0
/ targettype = 0
/ trialcount = 0
/cuepic = ""
/targetpic = ""
</values>

**************************************************************************************************************
**************************************************************************************************************
    EXPRESSIONS
**************************************************************************************************************
**************************************************************************************************************

/targetcondition:                    1 = go target; 2 = nogo target
    
/errorrate:                            overall error rate
/omissionrate:                        error rate for go-trials
/commission:                        error rate for nogo-trials

/meanRT:                            overall mean rt for target = go (correct responses only)
/meanRT_verticalcue_gotarget:        mean rt for trial in which cue = vertical and target = go (correct responses only)
/meanRT_horizontalcue_gotarget:        mean rt for trial in which cue = horizontal and target = go (correct responses only)

/omissionerror_v:                    error rate for trials in which cue = vertical and target = go
/commission_v:                        error rate for trials in which cue = vertical and target = nogo
/omissionerror_h:                    error rate for trials in which cue = horizontal and target = go
/commission_h:                        error rate for trials in which cue = horizontal and target = nogo

/error_verticalcue :                error rate for trials in which cue = vertical
/error_horizontalcue :                error rate for trials in which cue = horizontal

<expressions>
/targetcondition = if (values.targettype == 1 || values.targettype == 3) 1 else 2

/errorrate = 1 - list.accuracy.mean
/omissionrate = 1 - list.accuracy_G.mean
/commission = 1 - list.accuracy_NG.mean

/meanRT = list.latencies_G.mean
/meanRT_verticalcue_gotarget = list.latencies_vG.mean
/meanRT_horizontalcue_gotarget = list.latencies_hG.mean

/omissionerror_v = 1 - list.accuracy_vG.mean
/commission_v = 1 - list.accuracy_vNG.mean
/omissionerror_h = 1 - list.accuracy_hG.mean
/commission_h = 1 - list.accuracy_hNG.mean

/error_verticalcue = 1 - list.accuracy_v.mean
/error_horizontalcue = 1 - list.accuracy_h.mean
</expressions>

**************************************************************************************************************
**************************************************************************************************************
    STIMULI
**************************************************************************************************************
**************************************************************************************************************
<picture verticalcue>
/ items = cues
/ select = 1
/ size = (25%,25%)
/ position = (50%,50%)
</picture>

<picture horizontalcue>
/ items = cues
/ select = 2
/ size = (25%,25%)
/ position = (50%,50%)
</picture>

<picture verticalgotarget>
/ items = targets
/ select = 1
/ size = (25%,25%)
/ position = (50%,50%)
</picture>

<picture verticalnogotarget>
/ items = targets
/ select = 2
/ size = (25%,25%)
/ position = (50%,50%)
</picture>

<picture horizontalgotarget>
/ items = targets
/ select = 3
/ size = (25%,25%)
/ position = (50%,50%)
</picture>

<picture horizontalnogotarget>
/ items = targets
/ select = 4
/ size = (25%,25%)
/ position = (50%,50%)
</picture>

<text fixation>
/ items = ("+")
/ fontstyle = ("Arial", 10.00%, true)
</text>

<shape blankscreen>
/ shape = rectangle
/ color = (white)
/ erase = false
/ size = (100%, 100%)
/ position = (50%, 50%)
</shape>

**************************************************************************************************************
**************************************************************************************************************
    LISTS:

    Note: Factorial design with
    5 x SOA (100,200,300,400,500)
    2 x Cue (1=vertical,2=horizontal)
    2 x Target (Go, No-Go)
    
    Vertical cue go / no-go ratio is 4:1 (80% go trials, 20% no-go trials)
    Horizontal cue go / no-go ratio is 1:4 (20% go trials, 80% no-go trials)

    Minimum number of trials required to fulfill the above conditions is 50.
    Task runs 250 trials, i.e., each factor combination is repeated 5 times.        
**************************************************************************************************************
**************************************************************************************************************

The following lists control the soa selections for the 4 experimental conditions

<list soa_verticalcue_go>
/items = (100, 200, 300, 400, 500)
/poolsize = 100
/replace = false
</list>

<list soa_verticalcue_nogo>
/items = (100, 200, 300, 400, 500)
/poolsize = 25
/replace = false
</list>

<list soa_horizontalcue_go>
/items = (100, 200, 300, 400, 500)
/poolsize = 25
/replace = false
</list>

<list soa_horizontalcue_nogo>
/items = (100, 200, 300, 400, 500)
/poolsize = 100
/replace = false
</list>

*************************************************
Data Lists: used for descriptive statistics
store correct latencies/accuracy data
fill up during runtime
*************************************************

The following lists store 1 = correct response; 0 = incorrect response for each relevant trial
overall (all test trials)
v = for all vertical trials
h = for all horizontal trials
G = for all Go trials
NG = for all Nogo trials
vG = for all vertical go trials
vNG = for all vertical nogo trials
hG = for all horizontal go trials
hNG = for all horizontal nogo trials

<list accuracy>
</list>

<list accuracy_v>
</list>

<list accuracy_h>
</list>

<list accuracy_G>
</list>

<list accuracy_NG>
</list>

<list accuracy_vG>
</list>

<list accuracy_vNG>
</list>

<list accuracy_hG>
</list>

<list accuracy_hNG>
</list>

The following lists store correct latency data
G = for all go trials
vG = vertical go trials
hG = horizontal go trials

<list latencies_G>
</list>

<list latencies_vG>
</list>

<list latencies_hG>
</list>


**************************************************************************************************************
**************************************************************************************************************
    TRIALS     
**************************************************************************************************************
**************************************************************************************************************

****************************************
vertical cue - go target
****************************************

<trial verticalcue_go>
/ ontrialbegin = [
    values.cuetype = 1;
    values.targettype = 1;
    values.soa=list.soa_verticalcue_go.nextvalue;
    values.trialcount+=1;

    trial.verticalcue_go.insertstimulustime(shape.blankscreen, parameters.fixationduration);
    trial.verticalcue_go.insertstimulustime(picture.verticalcue,(parameters.fixationduration+parameters.cue_delay));
    trial.verticalcue_go.insertstimulustime(picture.verticalgotarget,(parameters.fixationduration+parameters.cue_delay+values.soa));
]

/ stimulustimes = [0=blankscreen,fixation]
/ beginresponsetime = parameters.fixationduration + parameters.cue_delay + values.soa
/ responseinterrupt = immediate
/ validresponse = (" ", noresponse)
/ correctresponse = (" ")
/ response = timeout(parameters.responsetimeout)
/ ontrialend = [
    list.accuracy.appenditem(trial.verticalcue_go.correct);
    list.accuracy_G.appenditem(trial.verticalcue_go.correct);
    list.accuracy_v.appenditem(trial.verticalcue_go.correct);    
    list.accuracy_vG.appenditem(trial.verticalcue_go.correct);
    if (trial.verticalcue_go.correct) {
        list.latencies_G.appenditem(trial.verticalcue_go.latency);
        list.latencies_vG.appenditem(trial.verticalcue_go.latency);
    };
    values.cuepic = picture.verticalcue.currentitem;
    values.targetpic = picture.verticalgotarget.currentitem;
    trial.verticalcue_go.resetstimulusframes();
]
/ recorddata = true
/ posttrialpause = parameters.iti
</trial>

****************************************
vertical cue - nogo target
****************************************

<trial verticalcue_nogo>
/ ontrialbegin = [
    values.cuetype = 1;
    values.targettype = 2;
    values.soa=list.soa_verticalcue_nogo.nextvalue;
    values.trialcount+=1;

    trial.verticalcue_nogo.insertstimulustime(shape.blankscreen, parameters.fixationduration);
    trial.verticalcue_nogo.insertstimulustime(picture.verticalcue,(parameters.fixationduration+parameters.cue_delay));
    trial.verticalcue_nogo.insertstimulustime(picture.verticalnogotarget,(parameters.fixationduration+parameters.cue_delay+values.soa));
]
/ stimulustimes = [0=blankscreen,fixation]
/ beginresponsetime = parameters.fixationduration + parameters.cue_delay + values.soa
/ responseinterrupt = immediate
/ validresponse = (" ", noresponse)
/ correctresponse = (0)
/ response = timeout(parameters.responsetimeout)
/ ontrialend = [
    list.accuracy.appenditem(trial.verticalcue_nogo.correct);
    list.accuracy_NG.appenditem(trial.verticalcue_nogo.correct);
    list.accuracy_v.appenditem(trial.verticalcue_nogo.correct);    
    list.accuracy_vNG.appenditem(trial.verticalcue_nogo.correct);
    values.cuepic = picture.verticalcue.currentitem;
    values.targetpic = picture.verticalnogotarget.currentitem;
    trial.verticalcue_nogo.resetstimulusframes();    
]
/ recorddata = true
/ posttrialpause = parameters.iti
</trial>

****************************************
horizontal cue - go target
****************************************

<trial horizontalcue_go>
/ ontrialbegin = [
    values.cuetype = 2;
    values.targettype = 3;
    values.soa=list.soa_horizontalcue_go.nextvalue;
    values.trialcount+=1;

    trial.horizontalcue_go.insertstimulustime(shape.blankscreen, parameters.fixationduration);
    trial.horizontalcue_go.insertstimulustime(picture.horizontalcue,(parameters.fixationduration+parameters.cue_delay));
    trial.horizontalcue_go.insertstimulustime(picture.horizontalgotarget,(parameters.fixationduration+parameters.cue_delay+values.soa));
]
/ stimulustimes = [0=blankscreen,fixation]
/ beginresponsetime = parameters.fixationduration + parameters.cue_delay + values.soa
/ responseinterrupt = immediate
/ validresponse = (" ", noresponse)
/ correctresponse = (" ")
/ response = timeout(parameters.responsetimeout)
/ ontrialend = [
    list.accuracy.appenditem(trial.horizontalcue_go.correct);
    list.accuracy_G.appenditem(trial.horizontalcue_go.correct);
    list.accuracy_h.appenditem(trial.horizontalcue_go.correct);    
    list.accuracy_hG.appenditem(trial.horizontalcue_go.correct);
    if (trial.horizontalcue_go.correct) {
        list.latencies_G.appenditem(trial.horizontalcue_go.latency);
        list.latencies_hG.appenditem(trial.horizontalcue_go.latency);                    
    };
    values.cuepic = picture.horizontalcue.currentitem;
    values.targetpic = picture.horizontalgotarget.currentitem;
    trial.horizontalcue_go.resetstimulusframes();
]
/ recorddata = true
/ posttrialpause = parameters.iti
</trial>

****************************************
horizontal cue - nogo target
****************************************

<trial horizontalcue_nogo>
/ ontrialbegin = [
    values.cuetype = 2;
    values.targettype = 4;
    values.soa=list.soa_horizontalcue_nogo.nextvalue;
    values.trialcount+=1;

    trial.horizontalcue_nogo.insertstimulustime(shape.blankscreen, parameters.fixationduration);
    trial.horizontalcue_nogo.insertstimulustime(picture.horizontalcue,(parameters.fixationduration+parameters.cue_delay));
    trial.horizontalcue_nogo.insertstimulustime(picture.horizontalnogotarget,(parameters.fixationduration+parameters.cue_delay+values.soa));
]
/ stimulustimes = [0=blankscreen,fixation]
/ beginresponsetime = parameters.fixationduration + parameters.cue_delay + values.soa
/ responseinterrupt = immediate
/ validresponse = (" ", noresponse)
/ correctresponse = (0)
/ response = timeout(parameters.responsetimeout)
/ ontrialend = [
    list.accuracy.appenditem(trial.horizontalcue_nogo.correct);
    list.accuracy_NG.appenditem(trial.horizontalcue_nogo.correct);
    list.accuracy_h.appenditem(trial.horizontalcue_nogo.correct);    
    list.accuracy_hNG.appenditem(trial.horizontalcue_nogo.correct);
    values.cuepic = picture.horizontalcue.currentitem;
    values.targetpic = picture.horizontalnogotarget.currentitem;
    trial.horizontalcue_nogo.resetstimulusframes();    
]
/ recorddata = true
/ posttrialpause = parameters.iti
</trial>
/ timeout = parameters.fixationduration + parameters.cue_delay + values.soa + parameters.responsetimeout

**************************************************************************************************************
**************************************************************************************************************
    BLOCKS
**************************************************************************************************************
**************************************************************************************************************

<block testblock>
/ trials = [
    1-250=noreplace(verticalcue_go, verticalcue_go, verticalcue_go, verticalcue_go, verticalcue_nogo,
                    horizontalcue_nogo, horizontalcue_nogo, horizontalcue_nogo, horizontalcue_nogo, horizontalcue_go);
]
</block>

**************************************************************************************************************
**************************************************************************************************************
    EXPERIMENT
**************************************************************************************************************
**************************************************************************************************************

<expt cuedgonogo>
/ preinstructions = (intro)
/ postinstructions = (end)
/ blocks = [
    1=testblock;
]
</expt>


**************************************************************************************************************
                                                End of File
**************************************************************************************************************

---
**************************************************************************************************************
**************************************************************************************************************
    EDITABLE INSTRUCTIONS: change instructions here
**************************************************************************************************************
**************************************************************************************************************

<page endpractice>
<br><br><br><br><br><br><br><br>
<center>You have completed the practice block.<br>
The main task will begin shortly.<br><br>
Take a short break if needed.<br><br>
Press the spacebar to continue.
</center>
</page>

<page endtest>
<br><br><br><br><br><br><br><br>
<center>You have completed the main task.<br>
Thank you for your participation!<br><br>
Please inform the experimenter.<br><br>
Press the spacebar to finish.
</center>
</page>

**************************************************************************************************************
**************************************************************************************************************
    BLOCKS
**************************************************************************************************************
**************************************************************************************************************

<block practiceblock>
/ trials = [
    1-9=noreplace(verticalcue_go, verticalcue_nogo, horizontalcue_go, horizontalcue_nogo);
    10=endpractice;
]
</block>

<block testblock>
/ trials = [
    1-249=noreplace(verticalcue_go, verticalcue_go, verticalcue_go, verticalcue_go, verticalcue_nogo,
                    horizontalcue_nogo, horizontalcue_nogo, horizontalcue_nogo, horizontalcue_nogo, horizontalcue_go);
    250=endtest;
]
</block>

**************************************************************************************************************
**************************************************************************************************************
    EXPERIMENT
**************************************************************************************************************
**************************************************************************************************************

<expt cuedgonogo>
/ preinstructions = (intro)
/ postinstructions = (end)
/ blocks = [
    1=practiceblock;
    2=testblock;
]
</expt>



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: 12K, Visits: 98K
Sen - 3/11/2024
Hello, 
I am new to the world of inquisit and coding so my apologies if this is a fundamental question, but my code for the 'cuedgonogo/iqx' is not working and I was wondering if anyone had any insights into why it might be. I am just trying to add a practice trial at the beginning so that participants can get familiar with a practice block before going into the actual test block. 
I have put the full code and then the modified code below. Any help would be greatly appreciated. 

<usermanual>
___________________________________________________________________________________________________________________    

                                    Cued Go / No-Go Task
___________________________________________________________________________________________________________________

last updated: 02-23-2022 by K. Borchert (katjab@millisecond.com) for Millisecond Software, LLC
Script Copyright © 09-30-2022 Millisecond Software

___________________________________________________________________________________________________________________
BACKGROUND INFO     
___________________________________________________________________________________________________________________
Go/Nogo Tasks are used as behavioral measures of inhibition and cognitive control.                                             
This script implements a probability based cued Go / No-Go Task that presents
a) cues that predict go trials with a high probability ('go cue') and b) cues that predict nogo
trials with a high probability ('nogo cue').
In general, commission errors are of particular interest in all Go/Nogo tasks as a measure of cognitive
control. In cued Go/Nogo tasks, go-cues are thought to generate a response prepotency that
speed up correct responses in go-trials but add an additional difficulty to overcome in subsequent
nogo trials and therefore increase the likelihood of commission errors.
As a result, the cued go/nogo paradigm provides a sensitive measure of cognitive control.

The implemented procedure is based on:

Fillmore, M. T., Rush, C. R., & Hays, L. (2006). Acute effects of cocaine in two models of inhibitory control:
implications of non-linear dose effects. Addiction, 101, 1323–1332.

___________________________________________________________________________________________________________________
TASK DESCRIPTION    
___________________________________________________________________________________________________________________
Participants are asked to press the Spacebar when they see a green rectangle (=go) but refrain from pressing the Spacebar
when they see a blue rectangle (=nogo). The blue and green rectangles can be vertical or horizontal. The
vertical rectangle has a high probability of being green (a go trial) and the horizontal rectangle has a high probability of
being blue (a nogo trial). Participants get information about the orientation of the rectangle (=cue) shortly before
the color of the rectangle is revealed.

___________________________________________________________________________________________________________________    
DURATION
___________________________________________________________________________________________________________________    
the default set-up of the script takes appr. 10 minutes to complete

___________________________________________________________________________________________________________________    
DATA FILE INFORMATION
___________________________________________________________________________________________________________________
The default data stored in the data files are:

(1) Raw data file: 'cuedgonogo_raw*.iqdat' (a separate file for each participant)

build:                                The specific Inquisit version used (the 'build') that was run
computer.platform:                    the platform the script was run on (win/mac/ios/android)
date, time:                         date and time script was run
subject, group:                     with the current subject/groupnumber
session:                            with the current session id

blockcode, blocknum:                the name and number of the current block (built-in Inquisit variable)
trialcode, trialnum:                 the name and number of the currently recorded trial (built-in Inquisit variable)
                                        Note: trialnum is a built-in Inquisit variable; it counts all trials run; even those
                                        that do not store data to the data file such as feedback trials. Thus, trialnum
                                        may not reflect the number of main trials run per block.
                                        
trialcount:                            current trialcount

cuetype:                            1 = vertical cue (high probability of preceding a go-trial ~ a go cue)
                                    2 = horizontal cue (high probability of preceding a nogo-trial ~ a nogo cue)

targettype:                            1 = vertical go
                                    2 = vertical nogo
                                    3 = horizonal go
                                    4 = horizonal nogo
                                
targetcondition:                    1 = go target
                                    2 = nogo target
                                    
soa:                                current stimulus onset asynchrony
cuepic:                                the image file presented as the cue
targetpic:                            the image file presented as the target    

response:                            response made (either 57 = Spacebar or "" for no response)
correct:                            the accuracy of response (1 = correct; 0 = error)
latency:                            the latency (in ms) of the response (or if no response: trialduration); measured from onset of target


(2) Summary data file: 'cuedgonogo_summary*.iqdat' (a separate file for each participant)

inquisit.version:                         Inquisit version run
computer.platform:                    the platform the script was run on (win/mac/ios/android)
startdate:                            date script was run
starttime:                            time script was started
subjectid:                            assigned subject id number
groupid:                            assigned group id number
sessionid:                            assigned session id number
elapsedtime:                        time it took to run script (in ms); measured from onset to offset of script
completed:                            0 = script was not completed (prematurely aborted);
                                    1 = script was completed (all conditions run)

errorrate:                            overall error rate (omission + commission errors)
omissionrate:                        error rate in go-trials (participant missed to press Spacebar)
commission:                            error rate in nogo trials (participants hit the Spacebar)

error_verticalcue:                    error rate for trials in which cue = vertical
error_horizontalcue:                error rate for trials in which cue = horizontal
omissionerror_v:                    error rate for trials in which cue = vertical ('go' cue) and target = go
commission_v:                        error rate for trials in which cue = vertical ('go' cue) and target = nogo (DV of interest)
omissionerror_h:                    error rate for trials in which cue = horizontal ('nogo' cue) and target = go
commission_h:                        error rate for trials in which cue = horizontal ('nogo' cue) and target = nogo

meanrt:                                overall mean rt (in ms) for target = go (for hits = correct responses only)
meanrt_verticalcue_gotarget:        mean rt (in ms) for trial in which cue = vertical (go cue) and target = go (for hits = correct responses only)
meanrt_horizontalcue_gotarget:        mean rt (in ms) for trial in which cue = horizontal (nogo cue) and target = go (for hits = correct responses only)

___________________________________________________________________________________________________________________    
EXPERIMENTAL SET-UP
___________________________________________________________________________________________________________________    

Factorial design with
    5 x SOA (100,200,300,400,500)
    2 x Cue (1=vertical,2=horizontal)
    2 x Target (Go, No-Go)

    Vertical cue go / no-go ratio is 4:1 (80% go trials, 20% no-go trials) => higher probability of go trials after vertical cue
    Horizontal cue go / no-go ratio is 1:4 (20% go trials, 80% no-go trials) => higher probability of nogo trials after horizontal cue

    Minimum number of trials required to fulfill the above conditions is 50.
    Task runs 250 trials, i.e., each factor combination is repeated 5 times.

    => 100 vertical cue-go targets (20 for each SOA); 25 vertical cue-nogo targets (5 for each SOA)
    => 100 horizontal cue-nogo targets (20 for each SOA); 25 horizontal cue-go targets (5 for each SOA)
    
___________________________________________________________________________________________________________________    
STIMULI
___________________________________________________________________________________________________________________    
see section Editable Stimuli

___________________________________________________________________________________________________________________    
INSTRUCTIONS
___________________________________________________________________________________________________________________    
see section Editable Instructions

___________________________________________________________________________________________________________________    
EDITABLE CODE
___________________________________________________________________________________________________________________    
check below for (relatively) easily editable parameters, stimuli, instructions etc.
Keep in mind that you can use this script as a template and therefore always "mess" with the entire code
to further customize your experiment.

The parameters you can change are:

/ fixationduration:                duration of the fixation cross in ms (default: 800)
/ cue_delay:                    interstimulus interval between offset of fixation and onset of cue in ms (default: 500ms)
/ responsetimeout:                responsetimeout in ms (default: 1000)
/ iti:                            intertrial interval in ms (default: 700)

</usermanual>


**************************************************************************************************************
**************************************************************************************************************
    EDITABLE PARAMETERS: change editable parameters here
**************************************************************************************************************
**************************************************************************************************************

<parameters>
/ fixationduration = 800
/ cue_delay = 500
/ responsetimeout = 1000
/ iti = 700
</parameters>

**************************************************************************************************************
**************************************************************************************************************
    EDITABLE STIMULI: change editable stimuli here
**************************************************************************************************************
**************************************************************************************************************

<item cues>
/ 1 = "VCUE.jpg"
/ 2 = "HCUE.jpg"
</item>

<item targets>
/ 1 = "VGO.jpg"
/ 2 = "VNOGO.jpg"
/ 3 = "HGO.jpg"
/ 4 = "HNOGO.jpg"
</item>

**************************************************************************************************************
**************************************************************************************************************
    EDITABLE INSTRUCTIONS: change instructions here
**************************************************************************************************************
**************************************************************************************************************
<instruct>
/ fontstyle = ("Arial", 3%, false, false, false, false, 5, 1)
/ navigationbuttonfontstyle = ("Arial", 3%, false, false, false, false, 5, 1)
</instruct>

<page intro>
<br><br>
<h1>Welcome to the Go / No-Go Task!</h1><hr>
On each trial, a white rectangle will appear on the screen.<br>
After a short time, the rectangle will either turn <span style='color: green'>green</span> or <span style='color: blue'>blue</span>.<br><br>
<i>Press the spacebar <%expressions.buttoninstruct1%> as quickly as possible whenever the rectangle turns <span style='color: green'>green</span>.<br>
If the rectangle turns <span style='color: blue'>blue</span>, do not respond at all.</i><br><br>
Try to respond as quickly as possible while making as few errors as possible.<br>
There'll be no practice. The task will take about 10 minutes to complete.<br><br>
Press the spacebar to begin.
</page>

<page end>
<br><br><br><br><br><br><br><br>
<center>You have reached the end of the task.<br>
<h1>Thank you!</h1></center>
</page>

****************************************************************************************************
general instruction expressions: adjust the instruction text depending on device used to run script
****************************************************************************************************
<expressions>
/buttoninstruct1 = if (computer.touch && !computer.haskeyboard) {"button";} else {"key";}
</expressions>

**************************************************************************************************************
                                !!!REMAINING CODE: Customize after careful consideration only!!!
**************************************************************************************************************

**************************************************************************************************************
**************************************************************************************************************
    DEFAULTS
**************************************************************************************************************
**************************************************************************************************************
script requires Inquisit 6.6.1.0 or higher

<defaults >
/canvasaspectratio = (4,3)
/minimumversion = "6.6.1.0"
/ fontstyle = ("Arial", 3%, false, false, false, false, 5, 1)
/txbgcolor = white
/ txcolor = (0, 0, 0)
</defaults>


**************************************************************************************************************
**************************************************************************************************************
    DATA
**************************************************************************************************************
**************************************************************************************************************

Note: data file explanations under User Manual Information at the top

***********************
raw data file
***********************

<data>
/ columns = (build, computer.platform, date, time, subject, group, session, blockcode, blocknum,
trialcode, trialnum, values.trialcount,values.cuetype,values.targettype,
expressions.targetcondition, values.soa, values.cuepic,values.targetpic,response,correct,latency)
</data>

***********************
summary data file
***********************

<summarydata >
/ columns = (inquisit.version, computer.platform, script.startdate, script.starttime, script.subjectid, script.groupid, script.sessionid, script.elapsedtime,
script.completed,
expressions.errorrate, expressions.omissionrate, expressions.commission,
expressions.error_verticalcue, expressions.error_horizontalcue,
expressions.omissionerror_v, expressions.commission_v, expressions.omissionerror_h, expressions.commission_h,
expressions.meanrt, expressions.meanrt_verticalcue_gotarget, expressions.meanrt_horizontalcue_gotarget)
</summarydata>

**************************************************************************************************************
**************************************************************************************************************
    VALUES: automatically updated
**************************************************************************************************************
**************************************************************************************************************
            
/completed:                    0 = script was not completed; 1 = script was completed (all conditions were run)
/ soa:                        stimulus onset asynchrony
/ cuetype:                    1 = vertical cue; 2 = horizontal cue
/ targettype:                1 = vertical go
                            2 = vertical nogo
                            3 = horizonal go
                            4 = horizonal nogo
/ trialcount:                counts all trials
/cuepic:                    stores the current cue image
/targetpic:                    stores the current target image

<values taskparams>
/completed = 0
/ soa = 0
/ cuetype = 0
/ targettype = 0
/ trialcount = 0
/cuepic = ""
/targetpic = ""
</values>

**************************************************************************************************************
**************************************************************************************************************
    EXPRESSIONS
**************************************************************************************************************
**************************************************************************************************************

/targetcondition:                    1 = go target; 2 = nogo target
    
/errorrate:                            overall error rate
/omissionrate:                        error rate for go-trials
/commission:                        error rate for nogo-trials

/meanRT:                            overall mean rt for target = go (correct responses only)
/meanRT_verticalcue_gotarget:        mean rt for trial in which cue = vertical and target = go (correct responses only)
/meanRT_horizontalcue_gotarget:        mean rt for trial in which cue = horizontal and target = go (correct responses only)

/omissionerror_v:                    error rate for trials in which cue = vertical and target = go
/commission_v:                        error rate for trials in which cue = vertical and target = nogo
/omissionerror_h:                    error rate for trials in which cue = horizontal and target = go
/commission_h:                        error rate for trials in which cue = horizontal and target = nogo

/error_verticalcue :                error rate for trials in which cue = vertical
/error_horizontalcue :                error rate for trials in which cue = horizontal

<expressions>
/targetcondition = if (values.targettype == 1 || values.targettype == 3) 1 else 2

/errorrate = 1 - list.accuracy.mean
/omissionrate = 1 - list.accuracy_G.mean
/commission = 1 - list.accuracy_NG.mean

/meanRT = list.latencies_G.mean
/meanRT_verticalcue_gotarget = list.latencies_vG.mean
/meanRT_horizontalcue_gotarget = list.latencies_hG.mean

/omissionerror_v = 1 - list.accuracy_vG.mean
/commission_v = 1 - list.accuracy_vNG.mean
/omissionerror_h = 1 - list.accuracy_hG.mean
/commission_h = 1 - list.accuracy_hNG.mean

/error_verticalcue = 1 - list.accuracy_v.mean
/error_horizontalcue = 1 - list.accuracy_h.mean
</expressions>

**************************************************************************************************************
**************************************************************************************************************
    STIMULI
**************************************************************************************************************
**************************************************************************************************************
<picture verticalcue>
/ items = cues
/ select = 1
/ size = (25%,25%)
/ position = (50%,50%)
</picture>

<picture horizontalcue>
/ items = cues
/ select = 2
/ size = (25%,25%)
/ position = (50%,50%)
</picture>

<picture verticalgotarget>
/ items = targets
/ select = 1
/ size = (25%,25%)
/ position = (50%,50%)
</picture>

<picture verticalnogotarget>
/ items = targets
/ select = 2
/ size = (25%,25%)
/ position = (50%,50%)
</picture>

<picture horizontalgotarget>
/ items = targets
/ select = 3
/ size = (25%,25%)
/ position = (50%,50%)
</picture>

<picture horizontalnogotarget>
/ items = targets
/ select = 4
/ size = (25%,25%)
/ position = (50%,50%)
</picture>

<text fixation>
/ items = ("+")
/ fontstyle = ("Arial", 10.00%, true)
</text>

<shape blankscreen>
/ shape = rectangle
/ color = (white)
/ erase = false
/ size = (100%, 100%)
/ position = (50%, 50%)
</shape>

**************************************************************************************************************
**************************************************************************************************************
    LISTS:

    Note: Factorial design with
    5 x SOA (100,200,300,400,500)
    2 x Cue (1=vertical,2=horizontal)
    2 x Target (Go, No-Go)
    
    Vertical cue go / no-go ratio is 4:1 (80% go trials, 20% no-go trials)
    Horizontal cue go / no-go ratio is 1:4 (20% go trials, 80% no-go trials)

    Minimum number of trials required to fulfill the above conditions is 50.
    Task runs 250 trials, i.e., each factor combination is repeated 5 times.        
**************************************************************************************************************
**************************************************************************************************************

The following lists control the soa selections for the 4 experimental conditions

<list soa_verticalcue_go>
/items = (100, 200, 300, 400, 500)
/poolsize = 100
/replace = false
</list>

<list soa_verticalcue_nogo>
/items = (100, 200, 300, 400, 500)
/poolsize = 25
/replace = false
</list>

<list soa_horizontalcue_go>
/items = (100, 200, 300, 400, 500)
/poolsize = 25
/replace = false
</list>

<list soa_horizontalcue_nogo>
/items = (100, 200, 300, 400, 500)
/poolsize = 100
/replace = false
</list>

*************************************************
Data Lists: used for descriptive statistics
store correct latencies/accuracy data
fill up during runtime
*************************************************

The following lists store 1 = correct response; 0 = incorrect response for each relevant trial
overall (all test trials)
v = for all vertical trials
h = for all horizontal trials
G = for all Go trials
NG = for all Nogo trials
vG = for all vertical go trials
vNG = for all vertical nogo trials
hG = for all horizontal go trials
hNG = for all horizontal nogo trials

<list accuracy>
</list>

<list accuracy_v>
</list>

<list accuracy_h>
</list>

<list accuracy_G>
</list>

<list accuracy_NG>
</list>

<list accuracy_vG>
</list>

<list accuracy_vNG>
</list>

<list accuracy_hG>
</list>

<list accuracy_hNG>
</list>

The following lists store correct latency data
G = for all go trials
vG = vertical go trials
hG = horizontal go trials

<list latencies_G>
</list>

<list latencies_vG>
</list>

<list latencies_hG>
</list>


**************************************************************************************************************
**************************************************************************************************************
    TRIALS     
**************************************************************************************************************
**************************************************************************************************************

****************************************
vertical cue - go target
****************************************

<trial verticalcue_go>
/ ontrialbegin = [
    values.cuetype = 1;
    values.targettype = 1;
    values.soa=list.soa_verticalcue_go.nextvalue;
    values.trialcount+=1;

    trial.verticalcue_go.insertstimulustime(shape.blankscreen, parameters.fixationduration);
    trial.verticalcue_go.insertstimulustime(picture.verticalcue,(parameters.fixationduration+parameters.cue_delay));
    trial.verticalcue_go.insertstimulustime(picture.verticalgotarget,(parameters.fixationduration+parameters.cue_delay+values.soa));
]

/ stimulustimes = [0=blankscreen,fixation]
/ beginresponsetime = parameters.fixationduration + parameters.cue_delay + values.soa
/ responseinterrupt = immediate
/ validresponse = (" ", noresponse)
/ correctresponse = (" ")
/ response = timeout(parameters.responsetimeout)
/ ontrialend = [
    list.accuracy.appenditem(trial.verticalcue_go.correct);
    list.accuracy_G.appenditem(trial.verticalcue_go.correct);
    list.accuracy_v.appenditem(trial.verticalcue_go.correct);    
    list.accuracy_vG.appenditem(trial.verticalcue_go.correct);
    if (trial.verticalcue_go.correct) {
        list.latencies_G.appenditem(trial.verticalcue_go.latency);
        list.latencies_vG.appenditem(trial.verticalcue_go.latency);
    };
    values.cuepic = picture.verticalcue.currentitem;
    values.targetpic = picture.verticalgotarget.currentitem;
    trial.verticalcue_go.resetstimulusframes();
]
/ recorddata = true
/ posttrialpause = parameters.iti
</trial>

****************************************
vertical cue - nogo target
****************************************

<trial verticalcue_nogo>
/ ontrialbegin = [
    values.cuetype = 1;
    values.targettype = 2;
    values.soa=list.soa_verticalcue_nogo.nextvalue;
    values.trialcount+=1;

    trial.verticalcue_nogo.insertstimulustime(shape.blankscreen, parameters.fixationduration);
    trial.verticalcue_nogo.insertstimulustime(picture.verticalcue,(parameters.fixationduration+parameters.cue_delay));
    trial.verticalcue_nogo.insertstimulustime(picture.verticalnogotarget,(parameters.fixationduration+parameters.cue_delay+values.soa));
]
/ stimulustimes = [0=blankscreen,fixation]
/ beginresponsetime = parameters.fixationduration + parameters.cue_delay + values.soa
/ responseinterrupt = immediate
/ validresponse = (" ", noresponse)
/ correctresponse = (0)
/ response = timeout(parameters.responsetimeout)
/ ontrialend = [
    list.accuracy.appenditem(trial.verticalcue_nogo.correct);
    list.accuracy_NG.appenditem(trial.verticalcue_nogo.correct);
    list.accuracy_v.appenditem(trial.verticalcue_nogo.correct);    
    list.accuracy_vNG.appenditem(trial.verticalcue_nogo.correct);
    values.cuepic = picture.verticalcue.currentitem;
    values.targetpic = picture.verticalnogotarget.currentitem;
    trial.verticalcue_nogo.resetstimulusframes();    
]
/ recorddata = true
/ posttrialpause = parameters.iti
</trial>

****************************************
horizontal cue - go target
****************************************

<trial horizontalcue_go>
/ ontrialbegin = [
    values.cuetype = 2;
    values.targettype = 3;
    values.soa=list.soa_horizontalcue_go.nextvalue;
    values.trialcount+=1;

    trial.horizontalcue_go.insertstimulustime(shape.blankscreen, parameters.fixationduration);
    trial.horizontalcue_go.insertstimulustime(picture.horizontalcue,(parameters.fixationduration+parameters.cue_delay));
    trial.horizontalcue_go.insertstimulustime(picture.horizontalgotarget,(parameters.fixationduration+parameters.cue_delay+values.soa));
]
/ stimulustimes = [0=blankscreen,fixation]
/ beginresponsetime = parameters.fixationduration + parameters.cue_delay + values.soa
/ responseinterrupt = immediate
/ validresponse = (" ", noresponse)
/ correctresponse = (" ")
/ response = timeout(parameters.responsetimeout)
/ ontrialend = [
    list.accuracy.appenditem(trial.horizontalcue_go.correct);
    list.accuracy_G.appenditem(trial.horizontalcue_go.correct);
    list.accuracy_h.appenditem(trial.horizontalcue_go.correct);    
    list.accuracy_hG.appenditem(trial.horizontalcue_go.correct);
    if (trial.horizontalcue_go.correct) {
        list.latencies_G.appenditem(trial.horizontalcue_go.latency);
        list.latencies_hG.appenditem(trial.horizontalcue_go.latency);                    
    };
    values.cuepic = picture.horizontalcue.currentitem;
    values.targetpic = picture.horizontalgotarget.currentitem;
    trial.horizontalcue_go.resetstimulusframes();
]
/ recorddata = true
/ posttrialpause = parameters.iti
</trial>

****************************************
horizontal cue - nogo target
****************************************

<trial horizontalcue_nogo>
/ ontrialbegin = [
    values.cuetype = 2;
    values.targettype = 4;
    values.soa=list.soa_horizontalcue_nogo.nextvalue;
    values.trialcount+=1;

    trial.horizontalcue_nogo.insertstimulustime(shape.blankscreen, parameters.fixationduration);
    trial.horizontalcue_nogo.insertstimulustime(picture.horizontalcue,(parameters.fixationduration+parameters.cue_delay));
    trial.horizontalcue_nogo.insertstimulustime(picture.horizontalnogotarget,(parameters.fixationduration+parameters.cue_delay+values.soa));
]
/ stimulustimes = [0=blankscreen,fixation]
/ beginresponsetime = parameters.fixationduration + parameters.cue_delay + values.soa
/ responseinterrupt = immediate
/ validresponse = (" ", noresponse)
/ correctresponse = (0)
/ response = timeout(parameters.responsetimeout)
/ ontrialend = [
    list.accuracy.appenditem(trial.horizontalcue_nogo.correct);
    list.accuracy_NG.appenditem(trial.horizontalcue_nogo.correct);
    list.accuracy_h.appenditem(trial.horizontalcue_nogo.correct);    
    list.accuracy_hNG.appenditem(trial.horizontalcue_nogo.correct);
    values.cuepic = picture.horizontalcue.currentitem;
    values.targetpic = picture.horizontalnogotarget.currentitem;
    trial.horizontalcue_nogo.resetstimulusframes();    
]
/ recorddata = true
/ posttrialpause = parameters.iti
</trial>
/ timeout = parameters.fixationduration + parameters.cue_delay + values.soa + parameters.responsetimeout

**************************************************************************************************************
**************************************************************************************************************
    BLOCKS
**************************************************************************************************************
**************************************************************************************************************

<block testblock>
/ trials = [
    1-250=noreplace(verticalcue_go, verticalcue_go, verticalcue_go, verticalcue_go, verticalcue_nogo,
                    horizontalcue_nogo, horizontalcue_nogo, horizontalcue_nogo, horizontalcue_nogo, horizontalcue_go);
]
</block>

**************************************************************************************************************
**************************************************************************************************************
    EXPERIMENT
**************************************************************************************************************
**************************************************************************************************************

<expt cuedgonogo>
/ preinstructions = (intro)
/ postinstructions = (end)
/ blocks = [
    1=testblock;
]
</expt>


**************************************************************************************************************
                                                End of File
**************************************************************************************************************

---
**************************************************************************************************************
**************************************************************************************************************
    EDITABLE INSTRUCTIONS: change instructions here
**************************************************************************************************************
**************************************************************************************************************

<page endpractice>
<br><br><br><br><br><br><br><br>
<center>You have completed the practice block.<br>
The main task will begin shortly.<br><br>
Take a short break if needed.<br><br>
Press the spacebar to continue.
</center>
</page>

<page endtest>
<br><br><br><br><br><br><br><br>
<center>You have completed the main task.<br>
Thank you for your participation!<br><br>
Please inform the experimenter.<br><br>
Press the spacebar to finish.
</center>
</page>

**************************************************************************************************************
**************************************************************************************************************
    BLOCKS
**************************************************************************************************************
**************************************************************************************************************

<block practiceblock>
/ trials = [
    1-9=noreplace(verticalcue_go, verticalcue_nogo, horizontalcue_go, horizontalcue_nogo);
    10=endpractice;
]
</block>

<block testblock>
/ trials = [
    1-249=noreplace(verticalcue_go, verticalcue_go, verticalcue_go, verticalcue_go, verticalcue_nogo,
                    horizontalcue_nogo, horizontalcue_nogo, horizontalcue_nogo, horizontalcue_nogo, horizontalcue_go);
    250=endtest;
]
</block>

**************************************************************************************************************
**************************************************************************************************************
    EXPERIMENT
**************************************************************************************************************
**************************************************************************************************************

<expt cuedgonogo>
/ preinstructions = (intro)
/ postinstructions = (end)
/ blocks = [
    1=practiceblock;
    2=testblock;
]
</expt>



As a general matter, you'll want to explain what -- precisely -- you think is "not working."

Do take note that <page> elements are not trials. <page> elements are instruction pages, to be presented via an <expt>'s or <block>'s /pre- and/or /postinstructions. <page> elements have no place whatsoever in a <block>'s /trials attribute.

Edited Last Month by Dave
GO

Merge Selected

Merge into selected topic...



Merge into merge target...



Merge into a specific topic ID...




Reading This Topic

Explore
Messages
Mentions
Search