Trying to fix script errors!


Author
Message
scripty
scripty
New Member (25 reputation)New Member (25 reputation)New Member (25 reputation)New Member (25 reputation)New Member (25 reputation)New Member (25 reputation)New Member (25 reputation)New Member (25 reputation)New Member (25 reputation)
Group: Forum Members
Posts: 2, Visits: 5
Hi everyone,
I am very new to the Inquisit script writing process, so I'd really appreciate some help with this. I have created 3 different versions of the same task (SART) where each has a different background color. The original SART script includes optional Mindwanderingprobe and Norms files, but I have decided not to use either. I thought I had disabled them, but I'm running into script errors related to those two optional files. The errors are the same across all 3 versions. 

Here are the errors listed for the gray version of the task:
Error sartgray.iqx 'dropdown.age.response' Expression contains an invalid identifier. 99
Error sartgray.iqx Invalid expression 'dropdown.age.response' 75
Error sartgray.iqx 'values.agegroup' The expression contains an unknown property. 100
Error sartgray.iqx 'values.z_commission' The expression contains an unknown property. 100
Error sartgray.iqx 'values.percentile_commission' The expression contains an unknown property. 100
Error sartgray.iqx 'values.z_omission' The expression contains an unknown property. 100
Error sartgray.iqx 'values.percentile_omission' The expression contains an unknown property. 100
Error sartgray.iqx 'values.z_anticipatoryresponses' The expression contains an unknown property. 100
Error sartgray.iqx 'values.percentile_anticipatoryresponses' The expression contains an unknown property. 100
Error sartgray.iqx 'values.z_gort' The expression contains an unknown property. 100
Error sartgray.iqx 'values.percentile_gort' The expression contains an unknown property. 100
Error sartgray.iqx 'values.z_cv' The expression contains an unknown property. 100
Error sartgray.iqx 'values.percentile_cv' The expression contains an unknown property. 100

Here is the full script for this version:

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

<parameters>
/digitpresentationtime = 250
/maskpresentationtime = 900
/ITI = 0
/responsekey = " "
/maskheight = 20%
/anticipatoryresponsetime = 100
/validresponsetime = 200

/run_mindwanderingprobe = false
/postprobeduration = 500
</parameters>

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

Note: picture of the mask
<item mask>
/1 = "maskred.png"
</item>

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

Note: These instructions are not original. Please customize.

***************************************
intro page 1
***************************************
<text intro1>
/ items = ("In this study you will be shown a stream of single digits (1-9) in varying sizes in the middle of the screen.

Each digit is only presented for a short duration and is immediately covered by a crossed circle.")
/ fontstyle = ("Arial", 3%, true, false, false, false, 5, 1)
/ position = (50%, 20%)
/ size = (80%, 20%)
/ vjustify = center
/ hjustify = left
/ halign = center
/ valign = center
/ txcolor = white
/ txbgcolor = red
</text>

<text continueInstruct>
/ items = ("Press Spacebar to continue")
/ position = (50%, 90%)
/ size = (80%, 5%)
/ fontstyle = ("Courier New", 3%, true, false, false, false, 5, 1)
/ vjustify = center
</text>

<video sarttask>
/ items = ("sarttaskred1.gif")
/ position = (50%, 50%)
/ size = (25%, 25%)
/ loop = true
/ erase = false
</video>

***************************************
intro page 2
***************************************

<text intro2a>
/ items = ("TASK:
Press the SPACEBAR when you see any digit other than 3.
Press NO key when you see digit 3. Just wait for the next digit.")
/ fontstyle = ("Arial", 4%, true, false, false, false, 5, 1)
/ position = (50%, 20%)
/ size = (80%, 30%)
/ vjustify = center
/ hjustify = center
</text>

<text intro2b>
/ items = ("Be accurate and fast.
Use the index finger of your dominant hand when responding (e.g. if you are left-handed, use your left index finger to press the SPACEBAR).

Let's practice this task.")
/ fontstyle = ("Arial", 3%, true, false, false, false, 5, 1)
/ position = (50%, 75%)
/ size = (80%, 25%)
/ vjustify = center
/ hjustify = left
</text>

<text startInstruct>
/ items = ("Press Spacebar to START")
/ position = (50%, 90%)
/ size = (80%, 5%)
/ fontstyle = ("Courier New", 3%, true, false, false, false, 5, 1)
/ vjustify = center
</text>

***************************************
test intro page
***************************************

<text testIntro1>
/items = ("Practice is over and the actual task is about to start. The task is the same as during practice but there will be no more error feedback.

It will take approx. 4 minutes.
~n~n~n~n~n~n~n~n~n
Be accurate and fast.
Use the index finger of your dominant hand when responding (e.g. if you are left-handed, use your left index finger to press the SPACEBAR)."
)
/ fontstyle = ("Arial", 3%, true, false, false, false, 5, 1)
/ position = (50%, 50%)
/ size = (80%, 80%)
/ vjustify = center
/ hjustify = left
</text>

<text testIntro2>
/ items = ("TASK:
Press the SPACEBAR when you see any digit other than 3.
Press NO key when you see digit 3. Just wait for the next digit.")
/ fontstyle = ("Arial", 4%, true, false, false, false, 5, 1)
/ position = (50%, 50%)
/ size = (80%, 25%)
/ vjustify = center
/ hjustify = center
/ txbgcolor =#ff4646
</text>


***************************************
finish page
***************************************

<text finish>
/ items = ("Thank you!")
/ fontstyle = ("Arial", 8%, true, false, false, false, 5, 1)
/ position = (50%, 50%)
/ size = (40%, 10%)
/ vjustify = center
/ valign = center
/ halign = center
</text>

<openended subjectid>
/ stimulusframes = [1=enterid]
/size = (60%,10%)
/ validresponse = (anyresponse)
/ recorddata = true
</openended>

<text enterid>
/ items = ("Please provide your name and UMBC Campus ID (Name, QQ33333) if you wish to recieve course credit. If you do not wish to recieve course credit, please press continue. ")
/ position = (50%, 40%)
/size = (70%,30%)
</text>

<text exit>
/ items = ("<press spacebar to exit>")
/ fontstyle = ("Arial", 3%, false, false, false, false, 5, 1)
/ position = (50%, 90%)
/ size = (80%, 5%)
/ vjustify = center
/ valign = center
/ halign = center
</text>


*******************************
General Helper Instructions
******************************

<text getReady>
/items = ("Get Ready:
~n<%expressions.buttoninstruct2%>")
/ fontstyle = ("Arial", 3.00%, false, false, false, false, 5, 1)
/ size = (80%, 40%)
/ txbgcolor = red
/ txcolor = white
</text>

****************************************************************************************************
general instruction expressions: adjust the instruction text depending on device used to run script
****************************************************************************************************
<expressions>
/buttoninstruct1 = if (computer.touch && !computer.haskeyboard) {"The Spacebar response button will be located at the bottom of your screen.";} else {"";}
/buttoninstruct2 = if (computer.touch && !computer.haskeyboard) {"Place your index finger of your dominant hand over the SPACEBAR button.";} else {"Place your index finger of your dominant hand on the SPACEBAR.";}
</expressions>


**************************************************************************************************************
**************************************************************************************************************
    EDITABLE LISTS: change editable lists here
**************************************************************************************************************
**************************************************************************************************************

Note:
* pre-fixed, semi-randomly assembled sequence of trialtypes/225 digits (9 digits * 25 repetitions)
=> Robertson et al (1997) distributed digit 3 in a prefixed semi-randomly fashion across the 225 trials
* to create a randomly selected sequence of digits that is created while running the experiment as
opposed to a pre-fixed one: replace /selectionmode = sequence with /replace = false


<list trialtype>
/items = (trial.go,trial.go,trial.go,trial.go,trial.go,trial.go,trial.go,trial.go,trial.go,trial.go,trial.go,trial.go,trial.go,trial.nogo,trial.go,trial.go,trial.go,trial.go,trial.go,trial.go,trial.go,trial.go,trial.go,trial.go,trial.go,
trial.go,trial.go,trial.go,trial.go,trial.go,trial.go,trial.go,trial.go,trial.go,trial.go,trial.go,trial.nogo,trial.go,trial.go,trial.go,trial.nogo,trial.go,trial.go,trial.go,trial.go,trial.go,trial.go,trial.go,trial.go,trial.go,
trial.nogo,trial.go,trial.go,trial.go,trial.go,trial.go,trial.go,trial.go,trial.go,trial.go,trial.go,trial.go,trial.go,trial.go,trial.go,trial.go,trial.go,trial.nogo,trial.go,trial.go,trial.go,trial.go,trial.nogo,trial.go,trial.go,
trial.go,trial.go,trial.go,trial.go,trial.go,trial.go,trial.go,trial.go,trial.go,trial.go,trial.go,trial.go,trial.go,trial.go,trial.go,trial.go,trial.go,trial.go,trial.nogo,trial.nogo,trial.go,trial.go,trial.go,trial.go,trial.go,
trial.go,trial.go,trial.go,trial.go,trial.nogo,trial.go,trial.go,trial.go,trial.go,trial.go,trial.nogo,trial.go,trial.go,trial.go,trial.go,trial.nogo,trial.go,trial.go,trial.go,trial.go,trial.go,trial.go,trial.go,trial.nogo,trial.go,
trial.go,trial.go,trial.go,trial.go,trial.go,trial.go,trial.go,trial.go,trial.go,trial.go,trial.go,trial.go,trial.nogo,trial.go,trial.go,trial.go,trial.go,trial.go,trial.go,trial.go,trial.nogo,trial.go,trial.go,trial.go,trial.go,
trial.go,trial.go,trial.go,trial.go,trial.go,trial.go,trial.nogo,trial.go,trial.nogo,trial.go,trial.go,trial.nogo,trial.go,trial.go,trial.go,trial.go,trial.go,trial.go,trial.go,trial.go,trial.go,trial.nogo,trial.go,trial.go,trial.go,
trial.go,trial.nogo,trial.go,trial.go,trial.go,trial.go,trial.go,trial.go,trial.go,trial.go,trial.go,trial.go,trial.go,trial.go,trial.go,trial.go,trial.go,trial.go,trial.go,trial.go,trial.go,trial.nogo,trial.go,trial.go,trial.go,
trial.nogo,trial.go,trial.nogo,trial.go,trial.go,trial.go,trial.go,trial.go,trial.go,trial.go,trial.go,trial.go,trial.go,trial.go,trial.go,trial.nogo,trial.nogo,trial.go,trial.go,trial.go,trial.go,trial.nogo,trial.go,trial.go,trial.go)
/selectionmode = sequence
/resetinterval = 1
</list>

<list digitsequence>
/items = (1,4,1,1,5,1,8,6,5,7,7,9,2,3,8,5,5,6,1,8,9,8,2,7,6,
4,8,6,8,2,9,8,9,5,2,4,3,5,5,6,3,2,7,5,7,8,2,7,4,1,
3,7,4,6,4,8,8,4,1,9,9,4,8,2,2,8,7,3,4,7,1,4,3,5,9,
8,4,7,4,1,2,6,6,4,6,6,9,9,7,6,4,1,7,3,3,9,8,2,7,6,
6,1,9,9,3,1,4,1,1,2,3,6,8,5,9,3,9,5,5,4,2,6,8,3,8,
4,4,2,5,2,1,1,5,9,5,4,5,3,4,2,5,6,9,4,6,3,1,5,5,4,
6,4,5,5,6,2,3,8,3,1,9,3,2,7,6,6,2,2,8,8,6,3,2,1,6,
1,3,1,7,2,9,9,8,7,2,7,9,7,1,4,8,5,9,5,6,9,3,9,8,7,
3,4,3,1,6,5,9,2,7,7,1,8,7,1,7,3,3,2,2,7,5,3,7,8,9)
/selectionmode = list.trialtype.currentindex
/resetinterval = 1
</list>

Note: list of practice trialtypes
<list practice_trialtype>
/items = (
trial.practice_go, trial.practice_go, trial.practice_nogo, trial.practice_go, trial.practice_go, trial.practice_go, trial.practice_go, trial.practice_go, trial.practice_go,
trial.practice_go, trial.practice_go, trial.practice_nogo, trial.practice_go, trial.practice_go, trial.practice_go, trial.practice_go, trial.practice_go, trial.practice_go)
/replace = false
</list>

Note: list of digits used for practice; tied to list.practice_trialtypes
<list practice_digitsequence>
/items = (
1, 2, 3, 4, 5, 6, 7, 8, 9,
1, 2, 3, 4, 5, 6, 7, 8, 9)
/selectionmode = list.practice_trialtype.currentindex
</list>

Note:
*list of random fontsizes in % of canvas height. Customize % to fit your screen.
=> Robertson et al (1997): sizes on their screen ranged from 12mm-29mm
* Fontsizes are randomly selected without replacement => same frequency
across all 225 trials

<list fontsizes>
/items = (4%, 7%, 10%, 13%, 16%)
/poolsize = 225
/replace = false
/ resetinterval = 1
</list>

<list practice_fontsizes>
/items = (4%, 7%, 10%, 13%, 16%)
/replace = true
</list>

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


**************************************************************************************************************
**************************************************************************************************************
    DEFAULTS
**************************************************************************************************************
**************************************************************************************************************
script requires Inquisit 6.1.0.0 or higher

<defaults>
/minimumversion = "6.1.0.0"
/ fontstyle = ("Arial", 3%, false, false, false, false, 5, 1)
/txbgcolor = red
/ txcolor = white
/screencolor = red
</defaults>

**************************************************************************************************************
**************************************************************************************************************
    INCLUDE
**************************************************************************************************************
**************************************************************************************************************

<include>
/ file = "SART_MindWanderingProbeAddition.iqx"
</include>

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

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

********************
raw data
********************

<data>
/ columns = (build, computer.platform, date, time, subject, group, script.sessionid, blockcode, blocknum,
trialcode, trialnum,
expressions.trialcount,
parameters.digitpresentationtime, parameters.maskpresentationtime, values.trialtype, values.digit, values.fontsize,
response, correct, values.RT, latency, values.latencytype, values.responsetype, values.count_anticipatory,
values.correctsuppressions, values.incorrectsuppressions, values.count_NoGo, values.count_Go, values.count_validgo, values.countprobes,
radiobuttons.difficulty.response, radiobuttons.interest.response)

</data>

********************
summary data
********************

<summarydata>
/ columns = (computer.platform, script.startdate, script.starttime, script.subjectid, script.groupid, script.sessionid, script.elapsedtime,
script.completed,dropdown.age.response, values.ageGroup
radiobuttons.difficulty.response, radiobuttons.interest.response,
expressions.nr_commissions, expressions.percent_commissions, values.z_commission, values.percentile_commission,
expressions.nr_omissions, expressions.percent_omissions, values.z_Omission, values.percentile_Omission,
values.count_anticipatory, values.z_AnticipatoryResponses, values.percentile_AnticipatoryResponses,
expressions.meanRT_go, expressions.stdRT_go, values.z_goRT, values.percentile_goRT,
expressions.CV_go, values.z_CV, values.percentile_CV,
expressions.meanRT_GObeforesuccessNOGO, expressions.meanRT_GObeforefailedNOGO)
</summarydata>

**************************************************************************************************************
**************************************************************************************************************
    VALUES: automatically updated
**************************************************************************************************************
**************************************************************************************************************
            
/probetrial:                        stores whether the current SART trial is followed by a probe (1) or not (0) (if parameters.run_mindwanderingprobe = true)
/trialtype:                            "Go" (digit !=3); "NoGo" (digit == 3)
/digit:                                contains the currently selected digit
/fontsize:                            contains the currently (randomly) selected fontsize
/correctsuppressions:                counts number of correct suppressions (-> no response to digit 3)
/incorrectsuppressions:                counts number of incorrect suppressions or omission of response (-> no response to digit other than 3)
/count_NoGo:                        counts NoGo trials (digit 3)
/count_Go:                            counts Go trials (digits other than 3)
/count_validGo:                        counts correct Go trials with valid latencies
/RT:                                saves the response latency (in ms) unless response is suppressed. In that case values.RT = ""
/latencytype:                        0 = no response given (suppression); 1 = anticipatory latency (< parameters.anticipatoryresponsetime);
                                    2 = ambiguous latency; 3 = valid latency (>= parameters.validresponsetime)
                                    Note: independent of Go-NoGo trial
/responsetype:                        "NoGo Success": correctly suppressed response to NoGo trial (digit 3)
                                    "Omission": incorrectly suppressed response to a Go trial (digit other than 3)
                                    "NoGo Failure": any response to a NoGo trial
                                    "Go Anticipatory": anticipatory response for Go trials with latencies < parameters.anticipatoryresponsetime
                                    "Go Ambiguous": ambiguous response for Go trials
                                    "Go Success": valid response for Go trials with latencies >= parameters.validresponsetime
/count_anticipatory:                counts the number of times a G0-latency was faster than parameters.anticipatoryresponsetime
/sumRT_GO:                            sums up the valid latencies (in ms) of correct responses (latencies >= parameters.validresponsetime)
/ssdiffRT_go:                        sums up the squared differences between valid latencies of correct responses latencies and mean latency
/RT1-
/RT4:                                store the last four consecutive latencies of correctly responded nondigit3 trials (irrespective of values.latencytype)

/fourfilled:                        1 = 4 consecutive latencies of correctly responded nondigit3 trials are available
                                    0 = fewer than 4 consecutive latencies of correctly responded nondigit3 trials are available

/count_4RTs_successsuppression:        counts how often 4 consecutive latencies of correctly responded nondigit3 trials are available before a
                                    successfully suppressed digit3 trial
/count_4RTs_failedsuppression:        counts how often 4 consecutive latencies of correctly responded nondigit3 trials are available before a
                                    failed suppressed digit3 trial
/sumRT_successsuppression:            sums up all the latencies of 4 consecutive latencies of correctly responded nondigit3 trials before a
                                    successfully suppressed digit3 trial
/sumRT_failedsuppression:            sums up all the latencies of 4 consecutive latencies of correctly responded nondigit3 trials before a
                                    failed suppressed digit3 trial

/countprobes:                        counts the number of probes run

<values>
/probetrial = 0
/trialtype = 0
/digit = 0
/fontsize = 0
/correctsuppressions = 0
/incorrectsuppressions = 0
/count_NoGo = 0
/count_Go = 0
/count_validGo = 0
/RT = 0
/latencytype = ""
/responsetype = 0
/count_anticipatory = 0
/fourfilled = 0
/RT1 = 0
/RT2 = 0
/RT3 = 0
/RT4 = 0
/count_4RTs_successsuppression = 0
/count_4RTs_failedsuppression = 0
/sumRT_successsuppression = 0
/sumRT_failedsuppression = 0
/countprobes = 0
</values>

*******************************************************************************************************************
*******************************************************************************************************************
    EXPRESSIONS
*******************************************************************************************************************
*******************************************************************************************************************
/percent_NoGosuccess:                    percentage of correct suppressions in NoGo trials (=No go success)
/percent_commissions:                    percentage of commission errors in NoGo trials (=NoGo failures; also reported as SART errors)
/nr_commissions:                        absolute number of commissions
/percent_omissions:                        percentage of incorrect suppressions in Go trials (=omission of response)
/nr_omissions:                            absolute number of omissions

Mean RTs are calculated for the correct consecutive (not interrupted either by a NoGo or by an omission trial) last four Go- trials (digit other than 3) preceding successful NoGo trial
Mean RTs are calculated for the correct consecutive (not interrupted either by a NoGo or by an omission trial) last four Go- trials (digit other than 3) preceding preceding failed NoGo trial
Note: in this script any 4 correct Go trials (=> Go trials that are responded to) are counted irrespective of values.latencytype

/meanRT_GObeforesuccessNOGO:                mean latency of consecutive 4 correct trials before correct suppression of response to digit 3
                                            (=> a measure of speed before successful NoGo trials)
/meanRT_GObeforefailedNOGO:                    mean latency of consecutive 4 correct trials before incorrect response of response to digit 3
                                            (=> a measure of speed before failed NoGo trials)

/meanRT_go:                                    mean latency (in ms) of valid and correct Go trials (latencies >= parameters.validresponsetime)
/stdRT_go:                                    estimated standard deviation (STD) of valid and correct Go trial latencies
/CV_go:                                        coefficient of variablity (CV = STD/Mean) => a measure of variability independent of mean differences

<expressions>
/percent_NoGosuccess = (values.correctsuppressions/values.count_NoGo) * 100
/percent_commissions = 100 - expressions.percent_NoGosuccess
/nr_commissions = values.count_NoGo - values.correctsuppressions
/percent_omissions = (values.incorrectsuppressions/values.count_Go) * 100
/nr_omissions = values.incorrectsuppressions

/meanRT_GObeforesuccessNOGO = values.sumrt_successsuppression/(4* values.count_4rts_successsuppression)
/meanRT_GObeforefailedNOGO = values.sumrt_failedsuppression/(4*values.count_4rts_failedsuppression)

/meanRT_go = list.validGolatencies.mean
/stdRT_go = list.validGolatencies.standarddeviation
/CV_go = expressions.stdRT_go/expressions.meanRT_go

/trialcount = values.count_go + values.count_nogo
</expressions>

*******************************************************************************************************************
*******************************************************************************************************************
    INSTRUCTIONS
*******************************************************************************************************************
*******************************************************************************************************************

<trial intro1>
/ stimulusframes = [1 = intro1, sarttask, continueInstruct]
/ validresponse = (" ")
/ recorddata = false
</trial>

<trial intro2>
/ stimulusframes = [1 = intro2a, sarttask, intro2b, startInstruct]
/ validresponse = (" ")
/ recorddata = false
</trial>

<trial teststart>
/ stimulusframes = [1 = testIntro1, testIntro2, startInstruct]
/ validresponse = (" ")
/ recorddata = false
</trial>

<trial finish>
/ inputdevice = keyboard
/ stimulusframes = [1 = finish, exit]
/ validresponse = (" ")
/ recorddata = false
</trial>


*******************************************************************************************************************
*******************************************************************************************************************
    STIMULI
*******************************************************************************************************************
*******************************************************************************************************************

<text digit>
/items = ("<%values.digit%>")
/ fontstyle = ("Symbol", values.fontsize, false, false, false, false, 5, 1)
/ txcolor = white
/txbgcolor = red
/position = (50%, 50%)
/erase = false
</text>

<picture mask>
/items = mask
/select = 1
/position = (50%, 50%)
/size = (100%, parameters.maskheight)
/erase = false
</picture>

Note: shape background is used to present the black background and erase the mask and achieve a steady SOA between digits
(Note: a black background element was used rather than setting the default background 'black' in order to
to present radiobuttons during the (optional) mindwandering task. Radiobuttons do not show up on a default black background
in Inquisit 4.0.7)
<shape background>
/shape = rectangle
/position = (50%, 50%)
/size = (100%, 100%)
/color = red
/erase = false
</shape>

<text errorfeedback>
/items = ("Incorrect")
/txcolor = white
/txbgcolor = red
/position = (50%, 50%)
/ fontstyle = ("Arial", 5%, true, false, false, false, 5, 1)
/erase = false
</text>

*******************************************************************************************************************
*******************************************************************************************************************
    LISTS
*******************************************************************************************************************
*******************************************************************************************************************

Note: list created on runtime; it saves all valid latencies of correct Go trials
in order to calculate Std of correct and valid Go-latencies
<list validGolatencies>
</list>

*******************************************************************************************************************
*******************************************************************************************************************
    PRACTICE TRIALS
*******************************************************************************************************************
*******************************************************************************************************************

<trial practice_go>
/pretrialpause = parameters.ITI
/ontrialbegin = [
    values.trialtype = "Go";
    values.digit = list.practice_digitsequence.nextvalue;
    values.fontsize = list.practice_fontsizes.nextvalue;
    trial.practice_go.insertstimulustime(picture.mask, parameters.digitpresentationtime);
    trial.practice_go.insertstimulustime(shape.background, (parameters.digitpresentationtime + parameters.maskpresentationtime));
]
/stimulustimes = [0 = background, digit]
/beginresponsetime = 0
/responseinterrupt = frames
/ validresponse = (parameters.responsekey, 0)
/monkeyresponse = (parameters.responsekey)
/correctresponse = (parameters.responsekey)
/trialduration = parameters.digitpresentationtime + parameters.maskpresentationtime

/ontrialend = [
    trial.practice_go.resetstimulusframes();

    if (trial.practice_go.responsetext == parameters.responsekey){
        values.RT = trial.practice_go.latency;
        
        if (values.RT < parameters.anticipatoryresponsetime) {
            values.latencytype = 1;
            values.responsetype = "Go Anticipatory";
        } else if (values.RT >= parameters.anticipatoryresponsetime){
            if (values.RT < parameters.validresponsetime) {
                values.latencytype = 2;
                values.responsetype = "Go Ambiguous";
            } else if (values.RT >= parameters.validresponsetime) {
                values.latencytype = 3;
                values.responsetype = "Go Success";
            };
        };
    } else {
        values.RT = "";
        values.latencytype = 0;
        values.responsetype = "Omission";
    };
]
/recorddata = true
/branch = [
    if (trial.practice_go.error) {
        return trial.feedback;
    } else {
        if (parameters.iti > 0){
            return trial.iti;
        };
    };
]
</trial>


<trial practice_nogo>
/ontrialbegin = [
    values.trialtype = "NoGo";
    values.digit = list.practice_digitsequence.nextvalue;
    values.fontsize = list.practice_fontsizes.nextvalue;
    trial.practice_nogo.insertstimulustime(picture.mask, parameters.digitpresentationtime);
    trial.practice_nogo.insertstimulustime(shape.background, (parameters.digitpresentationtime + parameters.maskpresentationtime));
]

/stimulustimes = [0 = background, digit]
/beginresponsetime = 0
/responseinterrupt = frames
/validresponse = (parameters.responsekey, 0)
/monkeyresponse = (parameters.responsekey, 0)
/correctresponse = (0)
/trialduration = parameters.digitpresentationtime + parameters.maskpresentationtime

/ontrialend = [
    trial.practice_nogo.resetstimulusframes();

    if (trial.practice_nogo.responsetext == parameters.responsekey){
        values.RT = trial.practice_nogo.latency;
        values.responsetype = "NoGo Failure";
                
        if (values.RT < parameters.anticipatoryresponsetime) {
            values.latencytype = 1;
        } else if (values.RT != "" && values.RT >= parameters.anticipatoryresponsetime){
            if (values.RT < parameters.validresponsetime) {
                values.latencytype = 2;
            } else if (values.RT >= parameters.validresponsetime) {
                values.latencytype = 3;
            };
        };        
        
    } else {
        values.RT = "";
        values.latencytype = 0;
        values.responsetype = "NoGo Success";
    };
]

/recorddata = true
/branch = [
    if (trial.practice_nogo.error) {
        return trial.feedback;
    } else {
        if (parameters.ITI > 0){
            return trial.iti;
        };
    };
]
</trial>


Note: presents an error feedback stimulus for 500ms
<trial feedback>
/recorddata = false
/stimulusframes = [1 = background, errorfeedback]
/ validresponse = (57, 0)
/ beginresponsetime = 500
/timeout = 500
/ branch = [
    if (parameters.ITI > 0){
        return trial.iti;
    };
]
</trial>

*****************************
General Helper Trial
*****************************

This trial is used when participants are asked to place their fingers on specific response
buttons. On the touchscreen, this trial presents the (inactive) response buttons to the participants.
<trial getReady>
/ stimulusframes = [1 = getReady]
/ timeout = 5000
/ validresponse = (parameters.responsekey)
/ beginresponsetime = 5000
/ errormessage = false
/ recorddata = false
/ posttrialpause = 500
</trial>

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

Note:
* presents digit for parameters.digitpresentationtime followed by a mask for parameters.maskpresentationtime
* latency is measured from onset of digit
* summary variables are updated
* latencies are tracked to be able to calculate the mean latencies of the last 4 consecutive non-digit3 trials
that elicited a correct response before a digit3 trial
* latencies of Go-success trials are stored in list.validgolatencies to calculate Std


presents the go-trials (digits !=3))
<trial go>
/ontrialbegin = [
    values.trialtype = "Go";
    values.digit = list.digitsequence.nextvalue;
    values.count_Go += 1;
    values.fontsize = list.fontsizes.nextvalue;
    values.probetrial = list.mindwanderingprobes.nextvalue;    
    
    trial.go.insertstimulustime(picture.mask, parameters.digitpresentationtime);
    trial.go.insertstimulustime(shape.background, (parameters.digitpresentationtime + parameters.maskpresentationtime));
]
/stimulustimes = [0 = background, digit]
/beginresponsetime = 0
/responseinterrupt = frames
/validresponse = (parameters.responsekey, 0)
/monkeyresponse = (parameters.responsekey, 0)
/correctresponse = (parameters.responsekey)
/trialduration = parameters.digitpresentationtime + parameters.maskpresentationtime

/ontrialend = [
    trial.go.resetstimulusframes();

    if (trial.go.responsetext == parameters.responsekey){
        values.RT = trial.go.latency;
        
        if (values.RT < parameters.anticipatoryresponsetime) {
            values.latencytype = 1;
            values.responsetype = "Go Anticipatory";
            values.count_anticipatory += 1;
        } else if (values.RT >= parameters.anticipatoryresponsetime){
            if (values.RT < parameters.validresponsetime) {
                values.latencytype = 2;
                values.responsetype = "Go Ambiguous";
            } else if (values.RT >= parameters.validresponsetime) {
                values.latencytype = 3;
                values.responsetype = "Go Success";
                values.count_validgo += 1;
                list.validgolatencies.appenditem(values.RT);
            };
        };
        
    } else {
        values.RT = "";
        values.latencytype = 0;
        
        values.responsetype = "Omission";
        values.incorrectsuppressions += 1;        
    };

    
// latencies are tracked to be able to calculate the mean latencies of the last 4 consecutive go trials
// that elicited a correct response before a nogo trial    
    if (values.RT !="" && trial.go.correct) {
        values.RT1 = values.RT2;
        values.RT2 = values.RT3;
        values.RT3 = values.RT4;
        values.RT4 = values.RT;
    } else {
        //for error responses all variables need to be reset
        values.RT1 = 0;
        values.RT2 = 0;
        values.RT3 = 0;
        values.RT4 = 0;
        values.fourfilled = 0;
    };

    if (trial.go.correct && values.RT1 != 0 && values.RT2 != 0 && values.RT3 != 0 && values.RT4 != 0 ) {
        values.fourfilled = 1;
    };
]
/recorddata = true
/branch = [
    if (parameters.run_mindwanderingprobe == 1 && values.probetrial == 1) {
        return surveypage.probe;
    } else {
        if (parameters.ITI > 0){
            return trial.iti;
        };
    };
]
</trial>


presents the nogo trials (digit == 3)
<trial nogo>
/ontrialbegin = [
    values.trialtype = "NoGo";
    values.count_NoGo += 1;
    values.digit = list.digitsequence.nextvalue;
    values.fontsize = list.fontsizes.nextvalue;
    values.probetrial = list.mindwanderingprobes.nextvalue;

    trial.nogo.insertstimulustime(picture.mask, parameters.digitpresentationtime);
    trial.nogo.insertstimulustime(shape.background, (parameters.digitpresentationtime + parameters.maskpresentationtime));
]
/stimulustimes = [0 = background, digit]
/responsetime = 0
/responseinterrupt = frames
/validresponse = (parameters.responsekey, 0)
/monkeyresponse = (parameters.responsekey, 0)
/correctresponse = (0)
/trialduration = parameters.digitpresentationtime + parameters.maskpresentationtime

/ontrialend = [
    trial.nogo.resetstimulusframes();
    
    if (trial.nogo.responsetext == parameters.responsekey) {
        values.RT = trial.nogo.latency;
        
        if (values.RT < parameters.anticipatoryresponsetime) {
            values.latencytype = 1;
        } else if (values.RT >= parameters.anticipatoryresponsetime){
            if (values.RT < parameters.validresponsetime) {
                values.latencytype = 2;
            } else if (values.RT >= parameters.validresponsetime) {
                values.latencytype = 3;
            };
        };
        
        values.responsetype = "NoGo Failure";
        
        //check whether this response follows 4 consecutive correct responses to a go-trial:
        if (values.fourfilled == 1) {
            //the error response followed 4 consecutive correct responses to a go-trial
            values.count_4rts_failedsuppression += 1;
            values.sumrt_failedsuppression += (values.RT1 + values.RT2 + values.RT3 + values.RT4);
        };

    } else {
        values.RT = "";
        values.latencytype = 0;
        values.responsetype = "NoGo Success";
        values.correctsuppressions += 1;
        
        //check whether this no-response follows 4 consecutive correct responses to a go-trial:
        if (values.fourfilled == 1) {
            //the successful no response followed 4 consecutive correct responses to a go-trial
            values.count_4rts_successsuppression += 1;
            values.sumrt_successsuppression += (values.RT1 + values.RT2 + values.RT3 + values.RT4);
        };        
    };
    
    //reset all the variables that potentially store response times for 4 consecutive correct responses to a go-trial
    values.RT1 = 0;
    values.RT2 = 0;
    values.RT3 = 0;
    values.RT4 = 0;
    values.fourfilled = 0;
]

/recorddata = true
/branch = [
    if (parameters.run_mindwanderingprobe == 1 && values.probetrial == 1) {
        return surveypage.probe;
    } else {
        if (parameters.ITI > 0){
            return trial.iti;
        };
    };
]
</trial>

<trial iti>
/ stimulusframes = [1 = clearscreen]
/ trialduration = parameters.ITI
/ recorddata = false
</trial>



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

<block intro>
/ trials = [
    1 = intro1;
    2 = intro2;
]
</block>


<block practice>
/ onblockbegin = [
    block.SART.screencolor = red;
]
/trials = [
    1 = getReady;
    2-19 = list.practice_trialtype;
]
/onblockend = [
    list.fontsizes.reset();
]
</block>

<block SART>
/trials = [
    1 = teststart;
    2 = getReady;
    3-227 = list.trialtype;
]
</block>

<block finish>
/ trials = [
    1 = subjectid, finish;
]
</block>

*******************************************************************************************************************
*******************************************************************************************************************
    EXPERIMENT
*******************************************************************************************************************
*******************************************************************************************************************
<expt>
/blocks = [
    1 = intro;
    2 = practice;
    3 = SART;
    4 = finish;
]
</expt>

<monkey>
/ latencydistribution = normal(300, 250)
</monkey>

**************************************************************************************************************
                                                End of File
**************************************************************************************************************
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
scripty - 4/14/2021
Hi everyone,
I am very new to the Inquisit script writing process, so I'd really appreciate some help with this. I have created 3 different versions of the same task (SART) where each has a different background color. The original SART script includes optional Mindwanderingprobe and Norms files, but I have decided not to use either. I thought I had disabled them, but I'm running into script errors related to those two optional files. The errors are the same across all 3 versions. 

Here are the errors listed for the gray version of the task:
Error sartgray.iqx 'dropdown.age.response' Expression contains an invalid identifier. 99
Error sartgray.iqx Invalid expression 'dropdown.age.response' 75
Error sartgray.iqx 'values.agegroup' The expression contains an unknown property. 100
Error sartgray.iqx 'values.z_commission' The expression contains an unknown property. 100
Error sartgray.iqx 'values.percentile_commission' The expression contains an unknown property. 100
Error sartgray.iqx 'values.z_omission' The expression contains an unknown property. 100
Error sartgray.iqx 'values.percentile_omission' The expression contains an unknown property. 100
Error sartgray.iqx 'values.z_anticipatoryresponses' The expression contains an unknown property. 100
Error sartgray.iqx 'values.percentile_anticipatoryresponses' The expression contains an unknown property. 100
Error sartgray.iqx 'values.z_gort' The expression contains an unknown property. 100
Error sartgray.iqx 'values.percentile_gort' The expression contains an unknown property. 100
Error sartgray.iqx 'values.z_cv' The expression contains an unknown property. 100
Error sartgray.iqx 'values.percentile_cv' The expression contains an unknown property. 100

Here is the full script for this version:

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

<parameters>
/digitpresentationtime = 250
/maskpresentationtime = 900
/ITI = 0
/responsekey = " "
/maskheight = 20%
/anticipatoryresponsetime = 100
/validresponsetime = 200

/run_mindwanderingprobe = false
/postprobeduration = 500
</parameters>

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

Note: picture of the mask
<item mask>
/1 = "maskred.png"
</item>

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

Note: These instructions are not original. Please customize.

***************************************
intro page 1
***************************************
<text intro1>
/ items = ("In this study you will be shown a stream of single digits (1-9) in varying sizes in the middle of the screen.

Each digit is only presented for a short duration and is immediately covered by a crossed circle.")
/ fontstyle = ("Arial", 3%, true, false, false, false, 5, 1)
/ position = (50%, 20%)
/ size = (80%, 20%)
/ vjustify = center
/ hjustify = left
/ halign = center
/ valign = center
/ txcolor = white
/ txbgcolor = red
</text>

<text continueInstruct>
/ items = ("Press Spacebar to continue")
/ position = (50%, 90%)
/ size = (80%, 5%)
/ fontstyle = ("Courier New", 3%, true, false, false, false, 5, 1)
/ vjustify = center
</text>

<video sarttask>
/ items = ("sarttaskred1.gif")
/ position = (50%, 50%)
/ size = (25%, 25%)
/ loop = true
/ erase = false
</video>

***************************************
intro page 2
***************************************

<text intro2a>
/ items = ("TASK:
Press the SPACEBAR when you see any digit other than 3.
Press NO key when you see digit 3. Just wait for the next digit.")
/ fontstyle = ("Arial", 4%, true, false, false, false, 5, 1)
/ position = (50%, 20%)
/ size = (80%, 30%)
/ vjustify = center
/ hjustify = center
</text>

<text intro2b>
/ items = ("Be accurate and fast.
Use the index finger of your dominant hand when responding (e.g. if you are left-handed, use your left index finger to press the SPACEBAR).

Let's practice this task.")
/ fontstyle = ("Arial", 3%, true, false, false, false, 5, 1)
/ position = (50%, 75%)
/ size = (80%, 25%)
/ vjustify = center
/ hjustify = left
</text>

<text startInstruct>
/ items = ("Press Spacebar to START")
/ position = (50%, 90%)
/ size = (80%, 5%)
/ fontstyle = ("Courier New", 3%, true, false, false, false, 5, 1)
/ vjustify = center
</text>

***************************************
test intro page
***************************************

<text testIntro1>
/items = ("Practice is over and the actual task is about to start. The task is the same as during practice but there will be no more error feedback.

It will take approx. 4 minutes.
~n~n~n~n~n~n~n~n~n
Be accurate and fast.
Use the index finger of your dominant hand when responding (e.g. if you are left-handed, use your left index finger to press the SPACEBAR)."
)
/ fontstyle = ("Arial", 3%, true, false, false, false, 5, 1)
/ position = (50%, 50%)
/ size = (80%, 80%)
/ vjustify = center
/ hjustify = left
</text>

<text testIntro2>
/ items = ("TASK:
Press the SPACEBAR when you see any digit other than 3.
Press NO key when you see digit 3. Just wait for the next digit.")
/ fontstyle = ("Arial", 4%, true, false, false, false, 5, 1)
/ position = (50%, 50%)
/ size = (80%, 25%)
/ vjustify = center
/ hjustify = center
/ txbgcolor =#ff4646
</text>


***************************************
finish page
***************************************

<text finish>
/ items = ("Thank you!")
/ fontstyle = ("Arial", 8%, true, false, false, false, 5, 1)
/ position = (50%, 50%)
/ size = (40%, 10%)
/ vjustify = center
/ valign = center
/ halign = center
</text>

<openended subjectid>
/ stimulusframes = [1=enterid]
/size = (60%,10%)
/ validresponse = (anyresponse)
/ recorddata = true
</openended>

<text enterid>
/ items = ("Please provide your name and UMBC Campus ID (Name, QQ33333) if you wish to recieve course credit. If you do not wish to recieve course credit, please press continue. ")
/ position = (50%, 40%)
/size = (70%,30%)
</text>

<text exit>
/ items = ("<press spacebar to exit>")
/ fontstyle = ("Arial", 3%, false, false, false, false, 5, 1)
/ position = (50%, 90%)
/ size = (80%, 5%)
/ vjustify = center
/ valign = center
/ halign = center
</text>


*******************************
General Helper Instructions
******************************

<text getReady>
/items = ("Get Ready:
~n<%expressions.buttoninstruct2%>")
/ fontstyle = ("Arial", 3.00%, false, false, false, false, 5, 1)
/ size = (80%, 40%)
/ txbgcolor = red
/ txcolor = white
</text>

****************************************************************************************************
general instruction expressions: adjust the instruction text depending on device used to run script
****************************************************************************************************
<expressions>
/buttoninstruct1 = if (computer.touch && !computer.haskeyboard) {"The Spacebar response button will be located at the bottom of your screen.";} else {"";}
/buttoninstruct2 = if (computer.touch && !computer.haskeyboard) {"Place your index finger of your dominant hand over the SPACEBAR button.";} else {"Place your index finger of your dominant hand on the SPACEBAR.";}
</expressions>


**************************************************************************************************************
**************************************************************************************************************
    EDITABLE LISTS: change editable lists here
**************************************************************************************************************
**************************************************************************************************************

Note:
* pre-fixed, semi-randomly assembled sequence of trialtypes/225 digits (9 digits * 25 repetitions)
=> Robertson et al (1997) distributed digit 3 in a prefixed semi-randomly fashion across the 225 trials
* to create a randomly selected sequence of digits that is created while running the experiment as
opposed to a pre-fixed one: replace /selectionmode = sequence with /replace = false


<list trialtype>
/items = (trial.go,trial.go,trial.go,trial.go,trial.go,trial.go,trial.go,trial.go,trial.go,trial.go,trial.go,trial.go,trial.go,trial.nogo,trial.go,trial.go,trial.go,trial.go,trial.go,trial.go,trial.go,trial.go,trial.go,trial.go,trial.go,
trial.go,trial.go,trial.go,trial.go,trial.go,trial.go,trial.go,trial.go,trial.go,trial.go,trial.go,trial.nogo,trial.go,trial.go,trial.go,trial.nogo,trial.go,trial.go,trial.go,trial.go,trial.go,trial.go,trial.go,trial.go,trial.go,
trial.nogo,trial.go,trial.go,trial.go,trial.go,trial.go,trial.go,trial.go,trial.go,trial.go,trial.go,trial.go,trial.go,trial.go,trial.go,trial.go,trial.go,trial.nogo,trial.go,trial.go,trial.go,trial.go,trial.nogo,trial.go,trial.go,
trial.go,trial.go,trial.go,trial.go,trial.go,trial.go,trial.go,trial.go,trial.go,trial.go,trial.go,trial.go,trial.go,trial.go,trial.go,trial.go,trial.go,trial.go,trial.nogo,trial.nogo,trial.go,trial.go,trial.go,trial.go,trial.go,
trial.go,trial.go,trial.go,trial.go,trial.nogo,trial.go,trial.go,trial.go,trial.go,trial.go,trial.nogo,trial.go,trial.go,trial.go,trial.go,trial.nogo,trial.go,trial.go,trial.go,trial.go,trial.go,trial.go,trial.go,trial.nogo,trial.go,
trial.go,trial.go,trial.go,trial.go,trial.go,trial.go,trial.go,trial.go,trial.go,trial.go,trial.go,trial.go,trial.nogo,trial.go,trial.go,trial.go,trial.go,trial.go,trial.go,trial.go,trial.nogo,trial.go,trial.go,trial.go,trial.go,
trial.go,trial.go,trial.go,trial.go,trial.go,trial.go,trial.nogo,trial.go,trial.nogo,trial.go,trial.go,trial.nogo,trial.go,trial.go,trial.go,trial.go,trial.go,trial.go,trial.go,trial.go,trial.go,trial.nogo,trial.go,trial.go,trial.go,
trial.go,trial.nogo,trial.go,trial.go,trial.go,trial.go,trial.go,trial.go,trial.go,trial.go,trial.go,trial.go,trial.go,trial.go,trial.go,trial.go,trial.go,trial.go,trial.go,trial.go,trial.go,trial.nogo,trial.go,trial.go,trial.go,
trial.nogo,trial.go,trial.nogo,trial.go,trial.go,trial.go,trial.go,trial.go,trial.go,trial.go,trial.go,trial.go,trial.go,trial.go,trial.go,trial.nogo,trial.nogo,trial.go,trial.go,trial.go,trial.go,trial.nogo,trial.go,trial.go,trial.go)
/selectionmode = sequence
/resetinterval = 1
</list>

<list digitsequence>
/items = (1,4,1,1,5,1,8,6,5,7,7,9,2,3,8,5,5,6,1,8,9,8,2,7,6,
4,8,6,8,2,9,8,9,5,2,4,3,5,5,6,3,2,7,5,7,8,2,7,4,1,
3,7,4,6,4,8,8,4,1,9,9,4,8,2,2,8,7,3,4,7,1,4,3,5,9,
8,4,7,4,1,2,6,6,4,6,6,9,9,7,6,4,1,7,3,3,9,8,2,7,6,
6,1,9,9,3,1,4,1,1,2,3,6,8,5,9,3,9,5,5,4,2,6,8,3,8,
4,4,2,5,2,1,1,5,9,5,4,5,3,4,2,5,6,9,4,6,3,1,5,5,4,
6,4,5,5,6,2,3,8,3,1,9,3,2,7,6,6,2,2,8,8,6,3,2,1,6,
1,3,1,7,2,9,9,8,7,2,7,9,7,1,4,8,5,9,5,6,9,3,9,8,7,
3,4,3,1,6,5,9,2,7,7,1,8,7,1,7,3,3,2,2,7,5,3,7,8,9)
/selectionmode = list.trialtype.currentindex
/resetinterval = 1
</list>

Note: list of practice trialtypes
<list practice_trialtype>
/items = (
trial.practice_go, trial.practice_go, trial.practice_nogo, trial.practice_go, trial.practice_go, trial.practice_go, trial.practice_go, trial.practice_go, trial.practice_go,
trial.practice_go, trial.practice_go, trial.practice_nogo, trial.practice_go, trial.practice_go, trial.practice_go, trial.practice_go, trial.practice_go, trial.practice_go)
/replace = false
</list>

Note: list of digits used for practice; tied to list.practice_trialtypes
<list practice_digitsequence>
/items = (
1, 2, 3, 4, 5, 6, 7, 8, 9,
1, 2, 3, 4, 5, 6, 7, 8, 9)
/selectionmode = list.practice_trialtype.currentindex
</list>

Note:
*list of random fontsizes in % of canvas height. Customize % to fit your screen.
=> Robertson et al (1997): sizes on their screen ranged from 12mm-29mm
* Fontsizes are randomly selected without replacement => same frequency
across all 225 trials

<list fontsizes>
/items = (4%, 7%, 10%, 13%, 16%)
/poolsize = 225
/replace = false
/ resetinterval = 1
</list>

<list practice_fontsizes>
/items = (4%, 7%, 10%, 13%, 16%)
/replace = true
</list>

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


**************************************************************************************************************
**************************************************************************************************************
    DEFAULTS
**************************************************************************************************************
**************************************************************************************************************
script requires Inquisit 6.1.0.0 or higher

<defaults>
/minimumversion = "6.1.0.0"
/ fontstyle = ("Arial", 3%, false, false, false, false, 5, 1)
/txbgcolor = red
/ txcolor = white
/screencolor = red
</defaults>

**************************************************************************************************************
**************************************************************************************************************
    INCLUDE
**************************************************************************************************************
**************************************************************************************************************

<include>
/ file = "SART_MindWanderingProbeAddition.iqx"
</include>

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

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

********************
raw data
********************

<data>
/ columns = (build, computer.platform, date, time, subject, group, script.sessionid, blockcode, blocknum,
trialcode, trialnum,
expressions.trialcount,
parameters.digitpresentationtime, parameters.maskpresentationtime, values.trialtype, values.digit, values.fontsize,
response, correct, values.RT, latency, values.latencytype, values.responsetype, values.count_anticipatory,
values.correctsuppressions, values.incorrectsuppressions, values.count_NoGo, values.count_Go, values.count_validgo, values.countprobes,
radiobuttons.difficulty.response, radiobuttons.interest.response)

</data>

********************
summary data
********************

<summarydata>
/ columns = (computer.platform, script.startdate, script.starttime, script.subjectid, script.groupid, script.sessionid, script.elapsedtime,
script.completed,dropdown.age.response, values.ageGroup
radiobuttons.difficulty.response, radiobuttons.interest.response,
expressions.nr_commissions, expressions.percent_commissions, values.z_commission, values.percentile_commission,
expressions.nr_omissions, expressions.percent_omissions, values.z_Omission, values.percentile_Omission,
values.count_anticipatory, values.z_AnticipatoryResponses, values.percentile_AnticipatoryResponses,
expressions.meanRT_go, expressions.stdRT_go, values.z_goRT, values.percentile_goRT,
expressions.CV_go, values.z_CV, values.percentile_CV,
expressions.meanRT_GObeforesuccessNOGO, expressions.meanRT_GObeforefailedNOGO)
</summarydata>

**************************************************************************************************************
**************************************************************************************************************
    VALUES: automatically updated
**************************************************************************************************************
**************************************************************************************************************
            
/probetrial:                        stores whether the current SART trial is followed by a probe (1) or not (0) (if parameters.run_mindwanderingprobe = true)
/trialtype:                            "Go" (digit !=3); "NoGo" (digit == 3)
/digit:                                contains the currently selected digit
/fontsize:                            contains the currently (randomly) selected fontsize
/correctsuppressions:                counts number of correct suppressions (-> no response to digit 3)
/incorrectsuppressions:                counts number of incorrect suppressions or omission of response (-> no response to digit other than 3)
/count_NoGo:                        counts NoGo trials (digit 3)
/count_Go:                            counts Go trials (digits other than 3)
/count_validGo:                        counts correct Go trials with valid latencies
/RT:                                saves the response latency (in ms) unless response is suppressed. In that case values.RT = ""
/latencytype:                        0 = no response given (suppression); 1 = anticipatory latency (< parameters.anticipatoryresponsetime);
                                    2 = ambiguous latency; 3 = valid latency (>= parameters.validresponsetime)
                                    Note: independent of Go-NoGo trial
/responsetype:                        "NoGo Success": correctly suppressed response to NoGo trial (digit 3)
                                    "Omission": incorrectly suppressed response to a Go trial (digit other than 3)
                                    "NoGo Failure": any response to a NoGo trial
                                    "Go Anticipatory": anticipatory response for Go trials with latencies < parameters.anticipatoryresponsetime
                                    "Go Ambiguous": ambiguous response for Go trials
                                    "Go Success": valid response for Go trials with latencies >= parameters.validresponsetime
/count_anticipatory:                counts the number of times a G0-latency was faster than parameters.anticipatoryresponsetime
/sumRT_GO:                            sums up the valid latencies (in ms) of correct responses (latencies >= parameters.validresponsetime)
/ssdiffRT_go:                        sums up the squared differences between valid latencies of correct responses latencies and mean latency
/RT1-
/RT4:                                store the last four consecutive latencies of correctly responded nondigit3 trials (irrespective of values.latencytype)

/fourfilled:                        1 = 4 consecutive latencies of correctly responded nondigit3 trials are available
                                    0 = fewer than 4 consecutive latencies of correctly responded nondigit3 trials are available

/count_4RTs_successsuppression:        counts how often 4 consecutive latencies of correctly responded nondigit3 trials are available before a
                                    successfully suppressed digit3 trial
/count_4RTs_failedsuppression:        counts how often 4 consecutive latencies of correctly responded nondigit3 trials are available before a
                                    failed suppressed digit3 trial
/sumRT_successsuppression:            sums up all the latencies of 4 consecutive latencies of correctly responded nondigit3 trials before a
                                    successfully suppressed digit3 trial
/sumRT_failedsuppression:            sums up all the latencies of 4 consecutive latencies of correctly responded nondigit3 trials before a
                                    failed suppressed digit3 trial

/countprobes:                        counts the number of probes run

<values>
/probetrial = 0
/trialtype = 0
/digit = 0
/fontsize = 0
/correctsuppressions = 0
/incorrectsuppressions = 0
/count_NoGo = 0
/count_Go = 0
/count_validGo = 0
/RT = 0
/latencytype = ""
/responsetype = 0
/count_anticipatory = 0
/fourfilled = 0
/RT1 = 0
/RT2 = 0
/RT3 = 0
/RT4 = 0
/count_4RTs_successsuppression = 0
/count_4RTs_failedsuppression = 0
/sumRT_successsuppression = 0
/sumRT_failedsuppression = 0
/countprobes = 0
</values>

*******************************************************************************************************************
*******************************************************************************************************************
    EXPRESSIONS
*******************************************************************************************************************
*******************************************************************************************************************
/percent_NoGosuccess:                    percentage of correct suppressions in NoGo trials (=No go success)
/percent_commissions:                    percentage of commission errors in NoGo trials (=NoGo failures; also reported as SART errors)
/nr_commissions:                        absolute number of commissions
/percent_omissions:                        percentage of incorrect suppressions in Go trials (=omission of response)
/nr_omissions:                            absolute number of omissions

Mean RTs are calculated for the correct consecutive (not interrupted either by a NoGo or by an omission trial) last four Go- trials (digit other than 3) preceding successful NoGo trial
Mean RTs are calculated for the correct consecutive (not interrupted either by a NoGo or by an omission trial) last four Go- trials (digit other than 3) preceding preceding failed NoGo trial
Note: in this script any 4 correct Go trials (=> Go trials that are responded to) are counted irrespective of values.latencytype

/meanRT_GObeforesuccessNOGO:                mean latency of consecutive 4 correct trials before correct suppression of response to digit 3
                                            (=> a measure of speed before successful NoGo trials)
/meanRT_GObeforefailedNOGO:                    mean latency of consecutive 4 correct trials before incorrect response of response to digit 3
                                            (=> a measure of speed before failed NoGo trials)

/meanRT_go:                                    mean latency (in ms) of valid and correct Go trials (latencies >= parameters.validresponsetime)
/stdRT_go:                                    estimated standard deviation (STD) of valid and correct Go trial latencies
/CV_go:                                        coefficient of variablity (CV = STD/Mean) => a measure of variability independent of mean differences

<expressions>
/percent_NoGosuccess = (values.correctsuppressions/values.count_NoGo) * 100
/percent_commissions = 100 - expressions.percent_NoGosuccess
/nr_commissions = values.count_NoGo - values.correctsuppressions
/percent_omissions = (values.incorrectsuppressions/values.count_Go) * 100
/nr_omissions = values.incorrectsuppressions

/meanRT_GObeforesuccessNOGO = values.sumrt_successsuppression/(4* values.count_4rts_successsuppression)
/meanRT_GObeforefailedNOGO = values.sumrt_failedsuppression/(4*values.count_4rts_failedsuppression)

/meanRT_go = list.validGolatencies.mean
/stdRT_go = list.validGolatencies.standarddeviation
/CV_go = expressions.stdRT_go/expressions.meanRT_go

/trialcount = values.count_go + values.count_nogo
</expressions>

*******************************************************************************************************************
*******************************************************************************************************************
    INSTRUCTIONS
*******************************************************************************************************************
*******************************************************************************************************************

<trial intro1>
/ stimulusframes = [1 = intro1, sarttask, continueInstruct]
/ validresponse = (" ")
/ recorddata = false
</trial>

<trial intro2>
/ stimulusframes = [1 = intro2a, sarttask, intro2b, startInstruct]
/ validresponse = (" ")
/ recorddata = false
</trial>

<trial teststart>
/ stimulusframes = [1 = testIntro1, testIntro2, startInstruct]
/ validresponse = (" ")
/ recorddata = false
</trial>

<trial finish>
/ inputdevice = keyboard
/ stimulusframes = [1 = finish, exit]
/ validresponse = (" ")
/ recorddata = false
</trial>


*******************************************************************************************************************
*******************************************************************************************************************
    STIMULI
*******************************************************************************************************************
*******************************************************************************************************************

<text digit>
/items = ("<%values.digit%>")
/ fontstyle = ("Symbol", values.fontsize, false, false, false, false, 5, 1)
/ txcolor = white
/txbgcolor = red
/position = (50%, 50%)
/erase = false
</text>

<picture mask>
/items = mask
/select = 1
/position = (50%, 50%)
/size = (100%, parameters.maskheight)
/erase = false
</picture>

Note: shape background is used to present the black background and erase the mask and achieve a steady SOA between digits
(Note: a black background element was used rather than setting the default background 'black' in order to
to present radiobuttons during the (optional) mindwandering task. Radiobuttons do not show up on a default black background
in Inquisit 4.0.7)
<shape background>
/shape = rectangle
/position = (50%, 50%)
/size = (100%, 100%)
/color = red
/erase = false
</shape>

<text errorfeedback>
/items = ("Incorrect")
/txcolor = white
/txbgcolor = red
/position = (50%, 50%)
/ fontstyle = ("Arial", 5%, true, false, false, false, 5, 1)
/erase = false
</text>

*******************************************************************************************************************
*******************************************************************************************************************
    LISTS
*******************************************************************************************************************
*******************************************************************************************************************

Note: list created on runtime; it saves all valid latencies of correct Go trials
in order to calculate Std of correct and valid Go-latencies
<list validGolatencies>
</list>

*******************************************************************************************************************
*******************************************************************************************************************
    PRACTICE TRIALS
*******************************************************************************************************************
*******************************************************************************************************************

<trial practice_go>
/pretrialpause = parameters.ITI
/ontrialbegin = [
    values.trialtype = "Go";
    values.digit = list.practice_digitsequence.nextvalue;
    values.fontsize = list.practice_fontsizes.nextvalue;
    trial.practice_go.insertstimulustime(picture.mask, parameters.digitpresentationtime);
    trial.practice_go.insertstimulustime(shape.background, (parameters.digitpresentationtime + parameters.maskpresentationtime));
]
/stimulustimes = [0 = background, digit]
/beginresponsetime = 0
/responseinterrupt = frames
/ validresponse = (parameters.responsekey, 0)
/monkeyresponse = (parameters.responsekey)
/correctresponse = (parameters.responsekey)
/trialduration = parameters.digitpresentationtime + parameters.maskpresentationtime

/ontrialend = [
    trial.practice_go.resetstimulusframes();

    if (trial.practice_go.responsetext == parameters.responsekey){
        values.RT = trial.practice_go.latency;
        
        if (values.RT < parameters.anticipatoryresponsetime) {
            values.latencytype = 1;
            values.responsetype = "Go Anticipatory";
        } else if (values.RT >= parameters.anticipatoryresponsetime){
            if (values.RT < parameters.validresponsetime) {
                values.latencytype = 2;
                values.responsetype = "Go Ambiguous";
            } else if (values.RT >= parameters.validresponsetime) {
                values.latencytype = 3;
                values.responsetype = "Go Success";
            };
        };
    } else {
        values.RT = "";
        values.latencytype = 0;
        values.responsetype = "Omission";
    };
]
/recorddata = true
/branch = [
    if (trial.practice_go.error) {
        return trial.feedback;
    } else {
        if (parameters.iti > 0){
            return trial.iti;
        };
    };
]
</trial>


<trial practice_nogo>
/ontrialbegin = [
    values.trialtype = "NoGo";
    values.digit = list.practice_digitsequence.nextvalue;
    values.fontsize = list.practice_fontsizes.nextvalue;
    trial.practice_nogo.insertstimulustime(picture.mask, parameters.digitpresentationtime);
    trial.practice_nogo.insertstimulustime(shape.background, (parameters.digitpresentationtime + parameters.maskpresentationtime));
]

/stimulustimes = [0 = background, digit]
/beginresponsetime = 0
/responseinterrupt = frames
/validresponse = (parameters.responsekey, 0)
/monkeyresponse = (parameters.responsekey, 0)
/correctresponse = (0)
/trialduration = parameters.digitpresentationtime + parameters.maskpresentationtime

/ontrialend = [
    trial.practice_nogo.resetstimulusframes();

    if (trial.practice_nogo.responsetext == parameters.responsekey){
        values.RT = trial.practice_nogo.latency;
        values.responsetype = "NoGo Failure";
                
        if (values.RT < parameters.anticipatoryresponsetime) {
            values.latencytype = 1;
        } else if (values.RT != "" && values.RT >= parameters.anticipatoryresponsetime){
            if (values.RT < parameters.validresponsetime) {
                values.latencytype = 2;
            } else if (values.RT >= parameters.validresponsetime) {
                values.latencytype = 3;
            };
        };        
        
    } else {
        values.RT = "";
        values.latencytype = 0;
        values.responsetype = "NoGo Success";
    };
]

/recorddata = true
/branch = [
    if (trial.practice_nogo.error) {
        return trial.feedback;
    } else {
        if (parameters.ITI > 0){
            return trial.iti;
        };
    };
]
</trial>


Note: presents an error feedback stimulus for 500ms
<trial feedback>
/recorddata = false
/stimulusframes = [1 = background, errorfeedback]
/ validresponse = (57, 0)
/ beginresponsetime = 500
/timeout = 500
/ branch = [
    if (parameters.ITI > 0){
        return trial.iti;
    };
]
</trial>

*****************************
General Helper Trial
*****************************

This trial is used when participants are asked to place their fingers on specific response
buttons. On the touchscreen, this trial presents the (inactive) response buttons to the participants.
<trial getReady>
/ stimulusframes = [1 = getReady]
/ timeout = 5000
/ validresponse = (parameters.responsekey)
/ beginresponsetime = 5000
/ errormessage = false
/ recorddata = false
/ posttrialpause = 500
</trial>

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

Note:
* presents digit for parameters.digitpresentationtime followed by a mask for parameters.maskpresentationtime
* latency is measured from onset of digit
* summary variables are updated
* latencies are tracked to be able to calculate the mean latencies of the last 4 consecutive non-digit3 trials
that elicited a correct response before a digit3 trial
* latencies of Go-success trials are stored in list.validgolatencies to calculate Std


presents the go-trials (digits !=3))
<trial go>
/ontrialbegin = [
    values.trialtype = "Go";
    values.digit = list.digitsequence.nextvalue;
    values.count_Go += 1;
    values.fontsize = list.fontsizes.nextvalue;
    values.probetrial = list.mindwanderingprobes.nextvalue;    
    
    trial.go.insertstimulustime(picture.mask, parameters.digitpresentationtime);
    trial.go.insertstimulustime(shape.background, (parameters.digitpresentationtime + parameters.maskpresentationtime));
]
/stimulustimes = [0 = background, digit]
/beginresponsetime = 0
/responseinterrupt = frames
/validresponse = (parameters.responsekey, 0)
/monkeyresponse = (parameters.responsekey, 0)
/correctresponse = (parameters.responsekey)
/trialduration = parameters.digitpresentationtime + parameters.maskpresentationtime

/ontrialend = [
    trial.go.resetstimulusframes();

    if (trial.go.responsetext == parameters.responsekey){
        values.RT = trial.go.latency;
        
        if (values.RT < parameters.anticipatoryresponsetime) {
            values.latencytype = 1;
            values.responsetype = "Go Anticipatory";
            values.count_anticipatory += 1;
        } else if (values.RT >= parameters.anticipatoryresponsetime){
            if (values.RT < parameters.validresponsetime) {
                values.latencytype = 2;
                values.responsetype = "Go Ambiguous";
            } else if (values.RT >= parameters.validresponsetime) {
                values.latencytype = 3;
                values.responsetype = "Go Success";
                values.count_validgo += 1;
                list.validgolatencies.appenditem(values.RT);
            };
        };
        
    } else {
        values.RT = "";
        values.latencytype = 0;
        
        values.responsetype = "Omission";
        values.incorrectsuppressions += 1;        
    };

    
// latencies are tracked to be able to calculate the mean latencies of the last 4 consecutive go trials
// that elicited a correct response before a nogo trial    
    if (values.RT !="" && trial.go.correct) {
        values.RT1 = values.RT2;
        values.RT2 = values.RT3;
        values.RT3 = values.RT4;
        values.RT4 = values.RT;
    } else {
        //for error responses all variables need to be reset
        values.RT1 = 0;
        values.RT2 = 0;
        values.RT3 = 0;
        values.RT4 = 0;
        values.fourfilled = 0;
    };

    if (trial.go.correct && values.RT1 != 0 && values.RT2 != 0 && values.RT3 != 0 && values.RT4 != 0 ) {
        values.fourfilled = 1;
    };
]
/recorddata = true
/branch = [
    if (parameters.run_mindwanderingprobe == 1 && values.probetrial == 1) {
        return surveypage.probe;
    } else {
        if (parameters.ITI > 0){
            return trial.iti;
        };
    };
]
</trial>


presents the nogo trials (digit == 3)
<trial nogo>
/ontrialbegin = [
    values.trialtype = "NoGo";
    values.count_NoGo += 1;
    values.digit = list.digitsequence.nextvalue;
    values.fontsize = list.fontsizes.nextvalue;
    values.probetrial = list.mindwanderingprobes.nextvalue;

    trial.nogo.insertstimulustime(picture.mask, parameters.digitpresentationtime);
    trial.nogo.insertstimulustime(shape.background, (parameters.digitpresentationtime + parameters.maskpresentationtime));
]
/stimulustimes = [0 = background, digit]
/responsetime = 0
/responseinterrupt = frames
/validresponse = (parameters.responsekey, 0)
/monkeyresponse = (parameters.responsekey, 0)
/correctresponse = (0)
/trialduration = parameters.digitpresentationtime + parameters.maskpresentationtime

/ontrialend = [
    trial.nogo.resetstimulusframes();
    
    if (trial.nogo.responsetext == parameters.responsekey) {
        values.RT = trial.nogo.latency;
        
        if (values.RT < parameters.anticipatoryresponsetime) {
            values.latencytype = 1;
        } else if (values.RT >= parameters.anticipatoryresponsetime){
            if (values.RT < parameters.validresponsetime) {
                values.latencytype = 2;
            } else if (values.RT >= parameters.validresponsetime) {
                values.latencytype = 3;
            };
        };
        
        values.responsetype = "NoGo Failure";
        
        //check whether this response follows 4 consecutive correct responses to a go-trial:
        if (values.fourfilled == 1) {
            //the error response followed 4 consecutive correct responses to a go-trial
            values.count_4rts_failedsuppression += 1;
            values.sumrt_failedsuppression += (values.RT1 + values.RT2 + values.RT3 + values.RT4);
        };

    } else {
        values.RT = "";
        values.latencytype = 0;
        values.responsetype = "NoGo Success";
        values.correctsuppressions += 1;
        
        //check whether this no-response follows 4 consecutive correct responses to a go-trial:
        if (values.fourfilled == 1) {
            //the successful no response followed 4 consecutive correct responses to a go-trial
            values.count_4rts_successsuppression += 1;
            values.sumrt_successsuppression += (values.RT1 + values.RT2 + values.RT3 + values.RT4);
        };        
    };
    
    //reset all the variables that potentially store response times for 4 consecutive correct responses to a go-trial
    values.RT1 = 0;
    values.RT2 = 0;
    values.RT3 = 0;
    values.RT4 = 0;
    values.fourfilled = 0;
]

/recorddata = true
/branch = [
    if (parameters.run_mindwanderingprobe == 1 && values.probetrial == 1) {
        return surveypage.probe;
    } else {
        if (parameters.ITI > 0){
            return trial.iti;
        };
    };
]
</trial>

<trial iti>
/ stimulusframes = [1 = clearscreen]
/ trialduration = parameters.ITI
/ recorddata = false
</trial>



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

<block intro>
/ trials = [
    1 = intro1;
    2 = intro2;
]
</block>


<block practice>
/ onblockbegin = [
    block.SART.screencolor = red;
]
/trials = [
    1 = getReady;
    2-19 = list.practice_trialtype;
]
/onblockend = [
    list.fontsizes.reset();
]
</block>

<block SART>
/trials = [
    1 = teststart;
    2 = getReady;
    3-227 = list.trialtype;
]
</block>

<block finish>
/ trials = [
    1 = subjectid, finish;
]
</block>

*******************************************************************************************************************
*******************************************************************************************************************
    EXPERIMENT
*******************************************************************************************************************
*******************************************************************************************************************
<expt>
/blocks = [
    1 = intro;
    2 = practice;
    3 = SART;
    4 = finish;
]
</expt>

<monkey>
/ latencydistribution = normal(300, 250)
</monkey>

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

Even if you don't want to run the norms part, you're not supposed to remove the <include> of the norms file. The errors stem from the fact that the rest of the script references things contained in that file. Either re-instate the <include> or work through the script in detail and strip out those parts.
scripty
scripty
New Member (25 reputation)New Member (25 reputation)New Member (25 reputation)New Member (25 reputation)New Member (25 reputation)New Member (25 reputation)New Member (25 reputation)New Member (25 reputation)New Member (25 reputation)
Group: Forum Members
Posts: 2, Visits: 5
Dave - 4/14/2021
scripty - 4/14/2021
Hi everyone,
I am very new to the Inquisit script writing process, so I'd really appreciate some help with this. I have created 3 different versions of the same task (SART) where each has a different background color. The original SART script includes optional Mindwanderingprobe and Norms files, but I have decided not to use either. I thought I had disabled them, but I'm running into script errors related to those two optional files. The errors are the same across all 3 versions. 

Here are the errors listed for the gray version of the task:
Error sartgray.iqx 'dropdown.age.response' Expression contains an invalid identifier. 99
Error sartgray.iqx Invalid expression 'dropdown.age.response' 75
Error sartgray.iqx 'values.agegroup' The expression contains an unknown property. 100
Error sartgray.iqx 'values.z_commission' The expression contains an unknown property. 100
Error sartgray.iqx 'values.percentile_commission' The expression contains an unknown property. 100
Error sartgray.iqx 'values.z_omission' The expression contains an unknown property. 100
Error sartgray.iqx 'values.percentile_omission' The expression contains an unknown property. 100
Error sartgray.iqx 'values.z_anticipatoryresponses' The expression contains an unknown property. 100
Error sartgray.iqx 'values.percentile_anticipatoryresponses' The expression contains an unknown property. 100
Error sartgray.iqx 'values.z_gort' The expression contains an unknown property. 100
Error sartgray.iqx 'values.percentile_gort' The expression contains an unknown property. 100
Error sartgray.iqx 'values.z_cv' The expression contains an unknown property. 100
Error sartgray.iqx 'values.percentile_cv' The expression contains an unknown property. 100

Here is the full script for this version:

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

<parameters>
/digitpresentationtime = 250
/maskpresentationtime = 900
/ITI = 0
/responsekey = " "
/maskheight = 20%
/anticipatoryresponsetime = 100
/validresponsetime = 200

/run_mindwanderingprobe = false
/postprobeduration = 500
</parameters>

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

Note: picture of the mask
<item mask>
/1 = "maskred.png"
</item>

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

Note: These instructions are not original. Please customize.

***************************************
intro page 1
***************************************
<text intro1>
/ items = ("In this study you will be shown a stream of single digits (1-9) in varying sizes in the middle of the screen.

Each digit is only presented for a short duration and is immediately covered by a crossed circle.")
/ fontstyle = ("Arial", 3%, true, false, false, false, 5, 1)
/ position = (50%, 20%)
/ size = (80%, 20%)
/ vjustify = center
/ hjustify = left
/ halign = center
/ valign = center
/ txcolor = white
/ txbgcolor = red
</text>

<text continueInstruct>
/ items = ("Press Spacebar to continue")
/ position = (50%, 90%)
/ size = (80%, 5%)
/ fontstyle = ("Courier New", 3%, true, false, false, false, 5, 1)
/ vjustify = center
</text>

<video sarttask>
/ items = ("sarttaskred1.gif")
/ position = (50%, 50%)
/ size = (25%, 25%)
/ loop = true
/ erase = false
</video>

***************************************
intro page 2
***************************************

<text intro2a>
/ items = ("TASK:
Press the SPACEBAR when you see any digit other than 3.
Press NO key when you see digit 3. Just wait for the next digit.")
/ fontstyle = ("Arial", 4%, true, false, false, false, 5, 1)
/ position = (50%, 20%)
/ size = (80%, 30%)
/ vjustify = center
/ hjustify = center
</text>

<text intro2b>
/ items = ("Be accurate and fast.
Use the index finger of your dominant hand when responding (e.g. if you are left-handed, use your left index finger to press the SPACEBAR).

Let's practice this task.")
/ fontstyle = ("Arial", 3%, true, false, false, false, 5, 1)
/ position = (50%, 75%)
/ size = (80%, 25%)
/ vjustify = center
/ hjustify = left
</text>

<text startInstruct>
/ items = ("Press Spacebar to START")
/ position = (50%, 90%)
/ size = (80%, 5%)
/ fontstyle = ("Courier New", 3%, true, false, false, false, 5, 1)
/ vjustify = center
</text>

***************************************
test intro page
***************************************

<text testIntro1>
/items = ("Practice is over and the actual task is about to start. The task is the same as during practice but there will be no more error feedback.

It will take approx. 4 minutes.
~n~n~n~n~n~n~n~n~n
Be accurate and fast.
Use the index finger of your dominant hand when responding (e.g. if you are left-handed, use your left index finger to press the SPACEBAR)."
)
/ fontstyle = ("Arial", 3%, true, false, false, false, 5, 1)
/ position = (50%, 50%)
/ size = (80%, 80%)
/ vjustify = center
/ hjustify = left
</text>

<text testIntro2>
/ items = ("TASK:
Press the SPACEBAR when you see any digit other than 3.
Press NO key when you see digit 3. Just wait for the next digit.")
/ fontstyle = ("Arial", 4%, true, false, false, false, 5, 1)
/ position = (50%, 50%)
/ size = (80%, 25%)
/ vjustify = center
/ hjustify = center
/ txbgcolor =#ff4646
</text>


***************************************
finish page
***************************************

<text finish>
/ items = ("Thank you!")
/ fontstyle = ("Arial", 8%, true, false, false, false, 5, 1)
/ position = (50%, 50%)
/ size = (40%, 10%)
/ vjustify = center
/ valign = center
/ halign = center
</text>

<openended subjectid>
/ stimulusframes = [1=enterid]
/size = (60%,10%)
/ validresponse = (anyresponse)
/ recorddata = true
</openended>

<text enterid>
/ items = ("Please provide your name and UMBC Campus ID (Name, QQ33333) if you wish to recieve course credit. If you do not wish to recieve course credit, please press continue. ")
/ position = (50%, 40%)
/size = (70%,30%)
</text>

<text exit>
/ items = ("<press spacebar to exit>")
/ fontstyle = ("Arial", 3%, false, false, false, false, 5, 1)
/ position = (50%, 90%)
/ size = (80%, 5%)
/ vjustify = center
/ valign = center
/ halign = center
</text>


*******************************
General Helper Instructions
******************************

<text getReady>
/items = ("Get Ready:
~n<%expressions.buttoninstruct2%>")
/ fontstyle = ("Arial", 3.00%, false, false, false, false, 5, 1)
/ size = (80%, 40%)
/ txbgcolor = red
/ txcolor = white
</text>

****************************************************************************************************
general instruction expressions: adjust the instruction text depending on device used to run script
****************************************************************************************************
<expressions>
/buttoninstruct1 = if (computer.touch && !computer.haskeyboard) {"The Spacebar response button will be located at the bottom of your screen.";} else {"";}
/buttoninstruct2 = if (computer.touch && !computer.haskeyboard) {"Place your index finger of your dominant hand over the SPACEBAR button.";} else {"Place your index finger of your dominant hand on the SPACEBAR.";}
</expressions>


**************************************************************************************************************
**************************************************************************************************************
    EDITABLE LISTS: change editable lists here
**************************************************************************************************************
**************************************************************************************************************

Note:
* pre-fixed, semi-randomly assembled sequence of trialtypes/225 digits (9 digits * 25 repetitions)
=> Robertson et al (1997) distributed digit 3 in a prefixed semi-randomly fashion across the 225 trials
* to create a randomly selected sequence of digits that is created while running the experiment as
opposed to a pre-fixed one: replace /selectionmode = sequence with /replace = false


<list trialtype>
/items = (trial.go,trial.go,trial.go,trial.go,trial.go,trial.go,trial.go,trial.go,trial.go,trial.go,trial.go,trial.go,trial.go,trial.nogo,trial.go,trial.go,trial.go,trial.go,trial.go,trial.go,trial.go,trial.go,trial.go,trial.go,trial.go,
trial.go,trial.go,trial.go,trial.go,trial.go,trial.go,trial.go,trial.go,trial.go,trial.go,trial.go,trial.nogo,trial.go,trial.go,trial.go,trial.nogo,trial.go,trial.go,trial.go,trial.go,trial.go,trial.go,trial.go,trial.go,trial.go,
trial.nogo,trial.go,trial.go,trial.go,trial.go,trial.go,trial.go,trial.go,trial.go,trial.go,trial.go,trial.go,trial.go,trial.go,trial.go,trial.go,trial.go,trial.nogo,trial.go,trial.go,trial.go,trial.go,trial.nogo,trial.go,trial.go,
trial.go,trial.go,trial.go,trial.go,trial.go,trial.go,trial.go,trial.go,trial.go,trial.go,trial.go,trial.go,trial.go,trial.go,trial.go,trial.go,trial.go,trial.go,trial.nogo,trial.nogo,trial.go,trial.go,trial.go,trial.go,trial.go,
trial.go,trial.go,trial.go,trial.go,trial.nogo,trial.go,trial.go,trial.go,trial.go,trial.go,trial.nogo,trial.go,trial.go,trial.go,trial.go,trial.nogo,trial.go,trial.go,trial.go,trial.go,trial.go,trial.go,trial.go,trial.nogo,trial.go,
trial.go,trial.go,trial.go,trial.go,trial.go,trial.go,trial.go,trial.go,trial.go,trial.go,trial.go,trial.go,trial.nogo,trial.go,trial.go,trial.go,trial.go,trial.go,trial.go,trial.go,trial.nogo,trial.go,trial.go,trial.go,trial.go,
trial.go,trial.go,trial.go,trial.go,trial.go,trial.go,trial.nogo,trial.go,trial.nogo,trial.go,trial.go,trial.nogo,trial.go,trial.go,trial.go,trial.go,trial.go,trial.go,trial.go,trial.go,trial.go,trial.nogo,trial.go,trial.go,trial.go,
trial.go,trial.nogo,trial.go,trial.go,trial.go,trial.go,trial.go,trial.go,trial.go,trial.go,trial.go,trial.go,trial.go,trial.go,trial.go,trial.go,trial.go,trial.go,trial.go,trial.go,trial.go,trial.nogo,trial.go,trial.go,trial.go,
trial.nogo,trial.go,trial.nogo,trial.go,trial.go,trial.go,trial.go,trial.go,trial.go,trial.go,trial.go,trial.go,trial.go,trial.go,trial.go,trial.nogo,trial.nogo,trial.go,trial.go,trial.go,trial.go,trial.nogo,trial.go,trial.go,trial.go)
/selectionmode = sequence
/resetinterval = 1
</list>

<list digitsequence>
/items = (1,4,1,1,5,1,8,6,5,7,7,9,2,3,8,5,5,6,1,8,9,8,2,7,6,
4,8,6,8,2,9,8,9,5,2,4,3,5,5,6,3,2,7,5,7,8,2,7,4,1,
3,7,4,6,4,8,8,4,1,9,9,4,8,2,2,8,7,3,4,7,1,4,3,5,9,
8,4,7,4,1,2,6,6,4,6,6,9,9,7,6,4,1,7,3,3,9,8,2,7,6,
6,1,9,9,3,1,4,1,1,2,3,6,8,5,9,3,9,5,5,4,2,6,8,3,8,
4,4,2,5,2,1,1,5,9,5,4,5,3,4,2,5,6,9,4,6,3,1,5,5,4,
6,4,5,5,6,2,3,8,3,1,9,3,2,7,6,6,2,2,8,8,6,3,2,1,6,
1,3,1,7,2,9,9,8,7,2,7,9,7,1,4,8,5,9,5,6,9,3,9,8,7,
3,4,3,1,6,5,9,2,7,7,1,8,7,1,7,3,3,2,2,7,5,3,7,8,9)
/selectionmode = list.trialtype.currentindex
/resetinterval = 1
</list>

Note: list of practice trialtypes
<list practice_trialtype>
/items = (
trial.practice_go, trial.practice_go, trial.practice_nogo, trial.practice_go, trial.practice_go, trial.practice_go, trial.practice_go, trial.practice_go, trial.practice_go,
trial.practice_go, trial.practice_go, trial.practice_nogo, trial.practice_go, trial.practice_go, trial.practice_go, trial.practice_go, trial.practice_go, trial.practice_go)
/replace = false
</list>

Note: list of digits used for practice; tied to list.practice_trialtypes
<list practice_digitsequence>
/items = (
1, 2, 3, 4, 5, 6, 7, 8, 9,
1, 2, 3, 4, 5, 6, 7, 8, 9)
/selectionmode = list.practice_trialtype.currentindex
</list>

Note:
*list of random fontsizes in % of canvas height. Customize % to fit your screen.
=> Robertson et al (1997): sizes on their screen ranged from 12mm-29mm
* Fontsizes are randomly selected without replacement => same frequency
across all 225 trials

<list fontsizes>
/items = (4%, 7%, 10%, 13%, 16%)
/poolsize = 225
/replace = false
/ resetinterval = 1
</list>

<list practice_fontsizes>
/items = (4%, 7%, 10%, 13%, 16%)
/replace = true
</list>

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


**************************************************************************************************************
**************************************************************************************************************
    DEFAULTS
**************************************************************************************************************
**************************************************************************************************************
script requires Inquisit 6.1.0.0 or higher

<defaults>
/minimumversion = "6.1.0.0"
/ fontstyle = ("Arial", 3%, false, false, false, false, 5, 1)
/txbgcolor = red
/ txcolor = white
/screencolor = red
</defaults>

**************************************************************************************************************
**************************************************************************************************************
    INCLUDE
**************************************************************************************************************
**************************************************************************************************************

<include>
/ file = "SART_MindWanderingProbeAddition.iqx"
</include>

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

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

********************
raw data
********************

<data>
/ columns = (build, computer.platform, date, time, subject, group, script.sessionid, blockcode, blocknum,
trialcode, trialnum,
expressions.trialcount,
parameters.digitpresentationtime, parameters.maskpresentationtime, values.trialtype, values.digit, values.fontsize,
response, correct, values.RT, latency, values.latencytype, values.responsetype, values.count_anticipatory,
values.correctsuppressions, values.incorrectsuppressions, values.count_NoGo, values.count_Go, values.count_validgo, values.countprobes,
radiobuttons.difficulty.response, radiobuttons.interest.response)

</data>

********************
summary data
********************

<summarydata>
/ columns = (computer.platform, script.startdate, script.starttime, script.subjectid, script.groupid, script.sessionid, script.elapsedtime,
script.completed,dropdown.age.response, values.ageGroup
radiobuttons.difficulty.response, radiobuttons.interest.response,
expressions.nr_commissions, expressions.percent_commissions, values.z_commission, values.percentile_commission,
expressions.nr_omissions, expressions.percent_omissions, values.z_Omission, values.percentile_Omission,
values.count_anticipatory, values.z_AnticipatoryResponses, values.percentile_AnticipatoryResponses,
expressions.meanRT_go, expressions.stdRT_go, values.z_goRT, values.percentile_goRT,
expressions.CV_go, values.z_CV, values.percentile_CV,
expressions.meanRT_GObeforesuccessNOGO, expressions.meanRT_GObeforefailedNOGO)
</summarydata>

**************************************************************************************************************
**************************************************************************************************************
    VALUES: automatically updated
**************************************************************************************************************
**************************************************************************************************************
            
/probetrial:                        stores whether the current SART trial is followed by a probe (1) or not (0) (if parameters.run_mindwanderingprobe = true)
/trialtype:                            "Go" (digit !=3); "NoGo" (digit == 3)
/digit:                                contains the currently selected digit
/fontsize:                            contains the currently (randomly) selected fontsize
/correctsuppressions:                counts number of correct suppressions (-> no response to digit 3)
/incorrectsuppressions:                counts number of incorrect suppressions or omission of response (-> no response to digit other than 3)
/count_NoGo:                        counts NoGo trials (digit 3)
/count_Go:                            counts Go trials (digits other than 3)
/count_validGo:                        counts correct Go trials with valid latencies
/RT:                                saves the response latency (in ms) unless response is suppressed. In that case values.RT = ""
/latencytype:                        0 = no response given (suppression); 1 = anticipatory latency (< parameters.anticipatoryresponsetime);
                                    2 = ambiguous latency; 3 = valid latency (>= parameters.validresponsetime)
                                    Note: independent of Go-NoGo trial
/responsetype:                        "NoGo Success": correctly suppressed response to NoGo trial (digit 3)
                                    "Omission": incorrectly suppressed response to a Go trial (digit other than 3)
                                    "NoGo Failure": any response to a NoGo trial
                                    "Go Anticipatory": anticipatory response for Go trials with latencies < parameters.anticipatoryresponsetime
                                    "Go Ambiguous": ambiguous response for Go trials
                                    "Go Success": valid response for Go trials with latencies >= parameters.validresponsetime
/count_anticipatory:                counts the number of times a G0-latency was faster than parameters.anticipatoryresponsetime
/sumRT_GO:                            sums up the valid latencies (in ms) of correct responses (latencies >= parameters.validresponsetime)
/ssdiffRT_go:                        sums up the squared differences between valid latencies of correct responses latencies and mean latency
/RT1-
/RT4:                                store the last four consecutive latencies of correctly responded nondigit3 trials (irrespective of values.latencytype)

/fourfilled:                        1 = 4 consecutive latencies of correctly responded nondigit3 trials are available
                                    0 = fewer than 4 consecutive latencies of correctly responded nondigit3 trials are available

/count_4RTs_successsuppression:        counts how often 4 consecutive latencies of correctly responded nondigit3 trials are available before a
                                    successfully suppressed digit3 trial
/count_4RTs_failedsuppression:        counts how often 4 consecutive latencies of correctly responded nondigit3 trials are available before a
                                    failed suppressed digit3 trial
/sumRT_successsuppression:            sums up all the latencies of 4 consecutive latencies of correctly responded nondigit3 trials before a
                                    successfully suppressed digit3 trial
/sumRT_failedsuppression:            sums up all the latencies of 4 consecutive latencies of correctly responded nondigit3 trials before a
                                    failed suppressed digit3 trial

/countprobes:                        counts the number of probes run

<values>
/probetrial = 0
/trialtype = 0
/digit = 0
/fontsize = 0
/correctsuppressions = 0
/incorrectsuppressions = 0
/count_NoGo = 0
/count_Go = 0
/count_validGo = 0
/RT = 0
/latencytype = ""
/responsetype = 0
/count_anticipatory = 0
/fourfilled = 0
/RT1 = 0
/RT2 = 0
/RT3 = 0
/RT4 = 0
/count_4RTs_successsuppression = 0
/count_4RTs_failedsuppression = 0
/sumRT_successsuppression = 0
/sumRT_failedsuppression = 0
/countprobes = 0
</values>

*******************************************************************************************************************
*******************************************************************************************************************
    EXPRESSIONS
*******************************************************************************************************************
*******************************************************************************************************************
/percent_NoGosuccess:                    percentage of correct suppressions in NoGo trials (=No go success)
/percent_commissions:                    percentage of commission errors in NoGo trials (=NoGo failures; also reported as SART errors)
/nr_commissions:                        absolute number of commissions
/percent_omissions:                        percentage of incorrect suppressions in Go trials (=omission of response)
/nr_omissions:                            absolute number of omissions

Mean RTs are calculated for the correct consecutive (not interrupted either by a NoGo or by an omission trial) last four Go- trials (digit other than 3) preceding successful NoGo trial
Mean RTs are calculated for the correct consecutive (not interrupted either by a NoGo or by an omission trial) last four Go- trials (digit other than 3) preceding preceding failed NoGo trial
Note: in this script any 4 correct Go trials (=> Go trials that are responded to) are counted irrespective of values.latencytype

/meanRT_GObeforesuccessNOGO:                mean latency of consecutive 4 correct trials before correct suppression of response to digit 3
                                            (=> a measure of speed before successful NoGo trials)
/meanRT_GObeforefailedNOGO:                    mean latency of consecutive 4 correct trials before incorrect response of response to digit 3
                                            (=> a measure of speed before failed NoGo trials)

/meanRT_go:                                    mean latency (in ms) of valid and correct Go trials (latencies >= parameters.validresponsetime)
/stdRT_go:                                    estimated standard deviation (STD) of valid and correct Go trial latencies
/CV_go:                                        coefficient of variablity (CV = STD/Mean) => a measure of variability independent of mean differences

<expressions>
/percent_NoGosuccess = (values.correctsuppressions/values.count_NoGo) * 100
/percent_commissions = 100 - expressions.percent_NoGosuccess
/nr_commissions = values.count_NoGo - values.correctsuppressions
/percent_omissions = (values.incorrectsuppressions/values.count_Go) * 100
/nr_omissions = values.incorrectsuppressions

/meanRT_GObeforesuccessNOGO = values.sumrt_successsuppression/(4* values.count_4rts_successsuppression)
/meanRT_GObeforefailedNOGO = values.sumrt_failedsuppression/(4*values.count_4rts_failedsuppression)

/meanRT_go = list.validGolatencies.mean
/stdRT_go = list.validGolatencies.standarddeviation
/CV_go = expressions.stdRT_go/expressions.meanRT_go

/trialcount = values.count_go + values.count_nogo
</expressions>

*******************************************************************************************************************
*******************************************************************************************************************
    INSTRUCTIONS
*******************************************************************************************************************
*******************************************************************************************************************

<trial intro1>
/ stimulusframes = [1 = intro1, sarttask, continueInstruct]
/ validresponse = (" ")
/ recorddata = false
</trial>

<trial intro2>
/ stimulusframes = [1 = intro2a, sarttask, intro2b, startInstruct]
/ validresponse = (" ")
/ recorddata = false
</trial>

<trial teststart>
/ stimulusframes = [1 = testIntro1, testIntro2, startInstruct]
/ validresponse = (" ")
/ recorddata = false
</trial>

<trial finish>
/ inputdevice = keyboard
/ stimulusframes = [1 = finish, exit]
/ validresponse = (" ")
/ recorddata = false
</trial>


*******************************************************************************************************************
*******************************************************************************************************************
    STIMULI
*******************************************************************************************************************
*******************************************************************************************************************

<text digit>
/items = ("<%values.digit%>")
/ fontstyle = ("Symbol", values.fontsize, false, false, false, false, 5, 1)
/ txcolor = white
/txbgcolor = red
/position = (50%, 50%)
/erase = false
</text>

<picture mask>
/items = mask
/select = 1
/position = (50%, 50%)
/size = (100%, parameters.maskheight)
/erase = false
</picture>

Note: shape background is used to present the black background and erase the mask and achieve a steady SOA between digits
(Note: a black background element was used rather than setting the default background 'black' in order to
to present radiobuttons during the (optional) mindwandering task. Radiobuttons do not show up on a default black background
in Inquisit 4.0.7)
<shape background>
/shape = rectangle
/position = (50%, 50%)
/size = (100%, 100%)
/color = red
/erase = false
</shape>

<text errorfeedback>
/items = ("Incorrect")
/txcolor = white
/txbgcolor = red
/position = (50%, 50%)
/ fontstyle = ("Arial", 5%, true, false, false, false, 5, 1)
/erase = false
</text>

*******************************************************************************************************************
*******************************************************************************************************************
    LISTS
*******************************************************************************************************************
*******************************************************************************************************************

Note: list created on runtime; it saves all valid latencies of correct Go trials
in order to calculate Std of correct and valid Go-latencies
<list validGolatencies>
</list>

*******************************************************************************************************************
*******************************************************************************************************************
    PRACTICE TRIALS
*******************************************************************************************************************
*******************************************************************************************************************

<trial practice_go>
/pretrialpause = parameters.ITI
/ontrialbegin = [
    values.trialtype = "Go";
    values.digit = list.practice_digitsequence.nextvalue;
    values.fontsize = list.practice_fontsizes.nextvalue;
    trial.practice_go.insertstimulustime(picture.mask, parameters.digitpresentationtime);
    trial.practice_go.insertstimulustime(shape.background, (parameters.digitpresentationtime + parameters.maskpresentationtime));
]
/stimulustimes = [0 = background, digit]
/beginresponsetime = 0
/responseinterrupt = frames
/ validresponse = (parameters.responsekey, 0)
/monkeyresponse = (parameters.responsekey)
/correctresponse = (parameters.responsekey)
/trialduration = parameters.digitpresentationtime + parameters.maskpresentationtime

/ontrialend = [
    trial.practice_go.resetstimulusframes();

    if (trial.practice_go.responsetext == parameters.responsekey){
        values.RT = trial.practice_go.latency;
        
        if (values.RT < parameters.anticipatoryresponsetime) {
            values.latencytype = 1;
            values.responsetype = "Go Anticipatory";
        } else if (values.RT >= parameters.anticipatoryresponsetime){
            if (values.RT < parameters.validresponsetime) {
                values.latencytype = 2;
                values.responsetype = "Go Ambiguous";
            } else if (values.RT >= parameters.validresponsetime) {
                values.latencytype = 3;
                values.responsetype = "Go Success";
            };
        };
    } else {
        values.RT = "";
        values.latencytype = 0;
        values.responsetype = "Omission";
    };
]
/recorddata = true
/branch = [
    if (trial.practice_go.error) {
        return trial.feedback;
    } else {
        if (parameters.iti > 0){
            return trial.iti;
        };
    };
]
</trial>


<trial practice_nogo>
/ontrialbegin = [
    values.trialtype = "NoGo";
    values.digit = list.practice_digitsequence.nextvalue;
    values.fontsize = list.practice_fontsizes.nextvalue;
    trial.practice_nogo.insertstimulustime(picture.mask, parameters.digitpresentationtime);
    trial.practice_nogo.insertstimulustime(shape.background, (parameters.digitpresentationtime + parameters.maskpresentationtime));
]

/stimulustimes = [0 = background, digit]
/beginresponsetime = 0
/responseinterrupt = frames
/validresponse = (parameters.responsekey, 0)
/monkeyresponse = (parameters.responsekey, 0)
/correctresponse = (0)
/trialduration = parameters.digitpresentationtime + parameters.maskpresentationtime

/ontrialend = [
    trial.practice_nogo.resetstimulusframes();

    if (trial.practice_nogo.responsetext == parameters.responsekey){
        values.RT = trial.practice_nogo.latency;
        values.responsetype = "NoGo Failure";
                
        if (values.RT < parameters.anticipatoryresponsetime) {
            values.latencytype = 1;
        } else if (values.RT != "" && values.RT >= parameters.anticipatoryresponsetime){
            if (values.RT < parameters.validresponsetime) {
                values.latencytype = 2;
            } else if (values.RT >= parameters.validresponsetime) {
                values.latencytype = 3;
            };
        };        
        
    } else {
        values.RT = "";
        values.latencytype = 0;
        values.responsetype = "NoGo Success";
    };
]

/recorddata = true
/branch = [
    if (trial.practice_nogo.error) {
        return trial.feedback;
    } else {
        if (parameters.ITI > 0){
            return trial.iti;
        };
    };
]
</trial>


Note: presents an error feedback stimulus for 500ms
<trial feedback>
/recorddata = false
/stimulusframes = [1 = background, errorfeedback]
/ validresponse = (57, 0)
/ beginresponsetime = 500
/timeout = 500
/ branch = [
    if (parameters.ITI > 0){
        return trial.iti;
    };
]
</trial>

*****************************
General Helper Trial
*****************************

This trial is used when participants are asked to place their fingers on specific response
buttons. On the touchscreen, this trial presents the (inactive) response buttons to the participants.
<trial getReady>
/ stimulusframes = [1 = getReady]
/ timeout = 5000
/ validresponse = (parameters.responsekey)
/ beginresponsetime = 5000
/ errormessage = false
/ recorddata = false
/ posttrialpause = 500
</trial>

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

Note:
* presents digit for parameters.digitpresentationtime followed by a mask for parameters.maskpresentationtime
* latency is measured from onset of digit
* summary variables are updated
* latencies are tracked to be able to calculate the mean latencies of the last 4 consecutive non-digit3 trials
that elicited a correct response before a digit3 trial
* latencies of Go-success trials are stored in list.validgolatencies to calculate Std


presents the go-trials (digits !=3))
<trial go>
/ontrialbegin = [
    values.trialtype = "Go";
    values.digit = list.digitsequence.nextvalue;
    values.count_Go += 1;
    values.fontsize = list.fontsizes.nextvalue;
    values.probetrial = list.mindwanderingprobes.nextvalue;    
    
    trial.go.insertstimulustime(picture.mask, parameters.digitpresentationtime);
    trial.go.insertstimulustime(shape.background, (parameters.digitpresentationtime + parameters.maskpresentationtime));
]
/stimulustimes = [0 = background, digit]
/beginresponsetime = 0
/responseinterrupt = frames
/validresponse = (parameters.responsekey, 0)
/monkeyresponse = (parameters.responsekey, 0)
/correctresponse = (parameters.responsekey)
/trialduration = parameters.digitpresentationtime + parameters.maskpresentationtime

/ontrialend = [
    trial.go.resetstimulusframes();

    if (trial.go.responsetext == parameters.responsekey){
        values.RT = trial.go.latency;
        
        if (values.RT < parameters.anticipatoryresponsetime) {
            values.latencytype = 1;
            values.responsetype = "Go Anticipatory";
            values.count_anticipatory += 1;
        } else if (values.RT >= parameters.anticipatoryresponsetime){
            if (values.RT < parameters.validresponsetime) {
                values.latencytype = 2;
                values.responsetype = "Go Ambiguous";
            } else if (values.RT >= parameters.validresponsetime) {
                values.latencytype = 3;
                values.responsetype = "Go Success";
                values.count_validgo += 1;
                list.validgolatencies.appenditem(values.RT);
            };
        };
        
    } else {
        values.RT = "";
        values.latencytype = 0;
        
        values.responsetype = "Omission";
        values.incorrectsuppressions += 1;        
    };

    
// latencies are tracked to be able to calculate the mean latencies of the last 4 consecutive go trials
// that elicited a correct response before a nogo trial    
    if (values.RT !="" && trial.go.correct) {
        values.RT1 = values.RT2;
        values.RT2 = values.RT3;
        values.RT3 = values.RT4;
        values.RT4 = values.RT;
    } else {
        //for error responses all variables need to be reset
        values.RT1 = 0;
        values.RT2 = 0;
        values.RT3 = 0;
        values.RT4 = 0;
        values.fourfilled = 0;
    };

    if (trial.go.correct && values.RT1 != 0 && values.RT2 != 0 && values.RT3 != 0 && values.RT4 != 0 ) {
        values.fourfilled = 1;
    };
]
/recorddata = true
/branch = [
    if (parameters.run_mindwanderingprobe == 1 && values.probetrial == 1) {
        return surveypage.probe;
    } else {
        if (parameters.ITI > 0){
            return trial.iti;
        };
    };
]
</trial>


presents the nogo trials (digit == 3)
<trial nogo>
/ontrialbegin = [
    values.trialtype = "NoGo";
    values.count_NoGo += 1;
    values.digit = list.digitsequence.nextvalue;
    values.fontsize = list.fontsizes.nextvalue;
    values.probetrial = list.mindwanderingprobes.nextvalue;

    trial.nogo.insertstimulustime(picture.mask, parameters.digitpresentationtime);
    trial.nogo.insertstimulustime(shape.background, (parameters.digitpresentationtime + parameters.maskpresentationtime));
]
/stimulustimes = [0 = background, digit]
/responsetime = 0
/responseinterrupt = frames
/validresponse = (parameters.responsekey, 0)
/monkeyresponse = (parameters.responsekey, 0)
/correctresponse = (0)
/trialduration = parameters.digitpresentationtime + parameters.maskpresentationtime

/ontrialend = [
    trial.nogo.resetstimulusframes();
    
    if (trial.nogo.responsetext == parameters.responsekey) {
        values.RT = trial.nogo.latency;
        
        if (values.RT < parameters.anticipatoryresponsetime) {
            values.latencytype = 1;
        } else if (values.RT >= parameters.anticipatoryresponsetime){
            if (values.RT < parameters.validresponsetime) {
                values.latencytype = 2;
            } else if (values.RT >= parameters.validresponsetime) {
                values.latencytype = 3;
            };
        };
        
        values.responsetype = "NoGo Failure";
        
        //check whether this response follows 4 consecutive correct responses to a go-trial:
        if (values.fourfilled == 1) {
            //the error response followed 4 consecutive correct responses to a go-trial
            values.count_4rts_failedsuppression += 1;
            values.sumrt_failedsuppression += (values.RT1 + values.RT2 + values.RT3 + values.RT4);
        };

    } else {
        values.RT = "";
        values.latencytype = 0;
        values.responsetype = "NoGo Success";
        values.correctsuppressions += 1;
        
        //check whether this no-response follows 4 consecutive correct responses to a go-trial:
        if (values.fourfilled == 1) {
            //the successful no response followed 4 consecutive correct responses to a go-trial
            values.count_4rts_successsuppression += 1;
            values.sumrt_successsuppression += (values.RT1 + values.RT2 + values.RT3 + values.RT4);
        };        
    };
    
    //reset all the variables that potentially store response times for 4 consecutive correct responses to a go-trial
    values.RT1 = 0;
    values.RT2 = 0;
    values.RT3 = 0;
    values.RT4 = 0;
    values.fourfilled = 0;
]

/recorddata = true
/branch = [
    if (parameters.run_mindwanderingprobe == 1 && values.probetrial == 1) {
        return surveypage.probe;
    } else {
        if (parameters.ITI > 0){
            return trial.iti;
        };
    };
]
</trial>

<trial iti>
/ stimulusframes = [1 = clearscreen]
/ trialduration = parameters.ITI
/ recorddata = false
</trial>



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

<block intro>
/ trials = [
    1 = intro1;
    2 = intro2;
]
</block>


<block practice>
/ onblockbegin = [
    block.SART.screencolor = red;
]
/trials = [
    1 = getReady;
    2-19 = list.practice_trialtype;
]
/onblockend = [
    list.fontsizes.reset();
]
</block>

<block SART>
/trials = [
    1 = teststart;
    2 = getReady;
    3-227 = list.trialtype;
]
</block>

<block finish>
/ trials = [
    1 = subjectid, finish;
]
</block>

*******************************************************************************************************************
*******************************************************************************************************************
    EXPERIMENT
*******************************************************************************************************************
*******************************************************************************************************************
<expt>
/blocks = [
    1 = intro;
    2 = practice;
    3 = SART;
    4 = finish;
]
</expt>

<monkey>
/ latencydistribution = normal(300, 250)
</monkey>

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

Even if you don't want to run the norms part, you're not supposed to remove the <include> of the norms file. The errors stem from the fact that the rest of the script references things contained in that file. Either re-instate the <include> or work through the script in detail and strip out those parts.

I see. I just reinstated the norms file and it worked like a charm.

Thank you for the help!
GO

Merge Selected

Merge into selected topic...



Merge into merge target...



Merge into a specific topic ID...




Reading This Topic

Explore
Messages
Mentions
Search