<values>
/ learninginterval = 1500
/ probepause = 1000
/ mindigits = 2
/ maxdigits = 6
/ setsize = ""
/ first = ""
/ second = ""
/ third = ""
/ fourth = ""
/ fifth = ""
/ sixth = ""
/ seventh = ""
/ target = ""
</values>

<data>
/ columns = [date time subject latency response correct values.setsize values.first values.second values.third values.fourth values.fifth values.sixth values.seventh values.target]
</data>

<counter setsize>
/ items = (2, 3, 4, 5, 6, 2, 3, 4, 5, 6, 2, 3, 4, 5, 6)
/ select = noreplace
</counter>

<counter digits>
/ select = noreplace(1, 2, 3, 4, 5, 6, 7, 8, 9, 10)
</counter>

<defaults>
/ screencolor = black
/ txcolor = white
/ txbgcolor = black
/ fontstyle = ("Arial", 3%)
/ minimumversion = "3.0.3.0"
</defaults>

<item digits>
/1 = "1"
/2 = "2"
/3 = "3"
/4 = "4"
/5 = "5"
/6 = "6"
/7 = "7"
/8 = "8"
/9 = "9"
/10 = "0"
</item>

<item in>
</item>

<text digit>
/ items = digits
/ txcolor = white
/ fontstyle = ("Arial", 10%)
/ select = digits
</text>

<text blank>
/ items = ("00")
/ txcolor = black
/ txbgcolor = black
/ fontstyle = ("Arial", 10%)
</text>

<text in>
/ items = in
/ txcolor = yellow
/ fontstyle = ("Arial", 10%)
/ erase = false
/ select = noreplace
</text>

<text out>
/ items = digits
/ txcolor = yellow
/ fontstyle = ("Arial", 10%)
/ erase = false
/ select = digits
</text>

<text errorsignal>
/ items = ("X")
/ fontstyle = ("Arial", 10%)
/ txcolor = red
/ position = (50%, 80%)
</text>

<text correctsignal>
/ items = ("O")
/ fontstyle = ("Arial", 10%)
/ txcolor = green
/ position = (50%, 80%)
</text>

<text inreminder>
/ items = ("F = yes")
/ fontstyle = ("Arial", 5%)
/ txcolor = white
/ position = (10%, 10%)
</text>

<text outreminder>
/ items = ("J = no")
/ fontstyle = ("Arial", 5%)
/ txcolor = white
/ position = (90%, 10%)
</text>

<trial first>
/ ontrialbegin = [values.setsize = counter.setsize.selectedvalue]
/ stimulusframes = [1=digit]
/ trialduration = values.learninginterval
/ validresponse = (noresponse)
/ ontrialend = [item.in.item = text.digit.currentitem]
/ ontrialend = [values.first = text.digit.currentitem]
/ branch = [trial.second]
/ recorddata = false
</trial>

<trial second>
/ stimulusframes = [1=digit]
/ trialduration = values.learninginterval
/ validresponse = (noresponse)
/ ontrialend = [item.in.item = text.digit.currentitem]
/ ontrialend = [values.second = text.digit.currentitem]
/ branch = [trial.third]
/ recorddata = false
</trial>

<trial third>
/ skip = [values.setsize < 3]
/ stimulusframes = [1=digit]
/ trialduration = values.learninginterval
/ validresponse = (noresponse)
/ ontrialend = [item.in.item = text.digit.currentitem]
/ ontrialend = [values.third = text.digit.currentitem]
/ branch = [trial.fourth]
/ recorddata = false
</trial>

<trial fourth>
/ skip = [values.setsize < 4]
/ stimulusframes = [1=digit]
/ trialduration = values.learninginterval
/ validresponse = (noresponse)
/ ontrialend = [item.in.item = text.digit.currentitem]
/ ontrialend = [values.fourth = text.digit.currentitem]
/ branch = [trial.fifth]
/ recorddata = false
</trial>

<trial fifth>
/ skip = [values.setsize < 5]
/ stimulusframes = [1=digit]
/ trialduration = values.learninginterval
/ validresponse = (noresponse)
/ ontrialend = [item.in.item = text.digit.currentitem]
/ ontrialend = [values.fifth = text.digit.currentitem]
/ branch = [trial.sixth]
/ recorddata = false
</trial>

<trial sixth>
/ skip = [values.setsize < 6]
/ stimulusframes = [1=digit]
/ trialduration = values.learninginterval
/ validresponse = (noresponse)
/ ontrialend = [item.in.item = text.digit.currentitem]
/ ontrialend = [values.sixth = text.digit.currentitem]
/ branch = [trial.seventh]
/ recorddata = false
</trial>

<trial seventh>
/ skip = [values.setsize < 7]
/ stimulusframes = [1=digit]
/ trialduration = values.learninginterval
/ validresponse = (noresponse)
/ ontrialend = [item.in.item = text.digit.currentitem]
/ ontrialend = [values.seventh = text.digit.currentitem]
/ recorddata = false
</trial>

<trial in>
/ pretrialpause = values.probepause
/ stimulusframes = [1=in]
/ validresponse = ("f", "j")
/ correctresponse = ("f")
/ errormessage = (errorsignal, 0)
/ correctmessage = (correctsignal, 0)
/ posttrialpause = 500
/ ontrialend = [values.target = text.in.currentitem]
/ branch = [trial.reset]
</trial>

<trial out>
/ pretrialpause = values.probepause
/ stimulusframes = [1=out]
/ validresponse = ("f", "j")
/ correctresponse = ("j")
/ errormessage = (errorsignal, 0)
/ correctmessage = (correctsignal, 0)
/ posttrialpause = 500
/ ontrialend = [values.target = text.out.currentitem]
/ branch = [trial.reset]
</trial>

<trial reset>
/ ontrialbegin = [clear(item.in); reset(text.digit)]
/ stimulusframes = [1=blank]
/ response = noresponse
/ recorddata = false
/ posttrialpause = 500
/ ontrialend = [values.first = ""]
/ ontrialend = [values.second = ""]
/ ontrialend = [values.third = ""]
/ ontrialend = [values.fourth = ""]
/ ontrialend = [values.fifth = ""]
/ ontrialend = [values.sixth = ""]
/ ontrialend = [values.seventh = ""]
</trial>

<block memorytest>
/ bgstim = (inreminder, outreminder)
/ trials = [1, 3, 5, 7, 9, 11, 13, 15, 17, 19, 21, 23, 25, 27, 29 = first; 2, 4, 6, 8, 10, 12, 14, 16, 18, 20, 22, 24, 26, 28, 30 = noreplace(in, out)]
</block>

<block instruction>
/ trials = [1=instruction]
</block>

<trial instruction>
/ stimulusframes = [1=instructions]
/ validresponse = (" ")
/ recorddata = false
</trial>

<text instructions>
/ items = ("This sample demonstrates the Sternberg memory task.

On the following trials, you will be see a sequence of digits presented one at a time printed in white. Immediately following each sequence, you will see a final digit printed in yellow. You task is to decide whether or not the the yellow digit appeared in the preceding sequence.

If the yellow digit appeared in the sequence, press the ~"F~" key. If the yellow digit was NOT in the sequence, press the ~"J~" key. If you are correct, you a green O will appear. If you are incorrect, a red X will appear.

Press the space bar to begin.")
/ size = (75%, 75%)
/ hjustify = left
</text>

<expt sternberg>
/ blocks = [1=instruction; 2=memorytest]
</expt>
