Problem with ending repetition of practice block


Author
Message
Dave
Dave
Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)
Group: Administrators
Posts: 13K, Visits: 108K

How do I tell inquisit to go directly to the test block after if I press Enter at the end of the first practice block (i.e. when the explain the expt. is shown)?


You'll want to add an appropriate /skip condition to <block RepeatPractice2back>.


KarlaHolmboe
KarlaHolmboe
Esteemed Member (2.1K reputation)Esteemed Member (2.1K reputation)Esteemed Member (2.1K reputation)Esteemed Member (2.1K reputation)Esteemed Member (2.1K reputation)Esteemed Member (2.1K reputation)Esteemed Member (2.1K reputation)Esteemed Member (2.1K reputation)Esteemed Member (2.1K reputation)
Group: Forum Members
Posts: 12, Visits: 1

Hi there


I have a nearly finished version of a 2-back task. I just have one small problem left and I was wondering whether anybody could help?


In the script I use a repeat block to re-run the practice block up to 3 times. At the end of each practice block I have a screen asking the participant to explain what they did in the task. If they are correct, I press Enter, if incorrect I press x to repeat the practice. After the third practice block I want to still show the screen asking the participant to explain the task, however, I only want to allow pressing Enter so that the experiment will always continue to the test block after 3 x practice. 


As the experiment is now, it sort of works, but for some reason I have to press Enter 3 times in order to continue to the test block if the participant can explain the task after the first practice block. How do I tell inquisit to go directly to the test block after if I press Enter at the end of the first practice block (i.e. when the explain the expt. is shown)?


Thanks!


This is the script (there are lots of script that I don't use, I only use the 2-back parts of the script):



************************************************************************************************************************************************************************


************************************************************************************************************************************************************************


         SINGLE N-BACK TASK NON-ADAPTIVE (1-KEY VERSION)
                 LETTERS


************************************************************************************************************************************************************************


************************************************************************************************************************************************************************
                               SCRIPT INFO


Author: Katja Borchert, Ph.D. for Millisecond Software LLC
Date: March, 2012
Modified by Karla Holmboe, April 2013



last updated: 13/05/2013. Some of the descriptive text is not up to date because I have been focusing on getting the script right, KH.
************************************************************************************************************************************************************************


************************************************************************************************************************************************************************
               BACKGROUND INFO


The current script is based on the SingleTaskNBack.exp script which implements the single-task version of the N-Back procedure as
described in the following publication:


Jaeggi, Susanne M.; Studer-Luethi, Barbara; Buschkuehl, Martin; Su, Yi-Fen; Jonides, John; Perrig, Walter J. (2010). The
relationship between n-back performance and matrix reasoning - implications for training and transfer. Intelligence, 38, 625-635.


The current script is adapted to implement the procedure of the Single N-back task using letters as described in:
Ragland, J.D., Turetsky, B.I., Gur, R.C, Gunning-Dixon, F., Turner, T, Schroeder, L., Chan, R., & Gur, R.E. (2002).Working Memory
for Complex Figures: An fMRI Comparison of Letter and Fractal n-Back Tasks. Neuropsychology, 16, 370-379.


This Inquisit script provides trials and instructions for single n-back tasks with 20 upper case consonants for 4 levels of N
(N = 0, N = 1, N = 2, N = 3).
                   
                    Single n-back tasks:
In the 1-key single n-back task, participants are shown a sequence of stimuli (here: a sequence of white letters
on a black background) and are asked to indicate whether the currently presented stimulus fulfills the following criteria:


for N=0 trials*:
- is the letter the same as the first letter presented in the sequence? If so (it's a target), and press "A". If not, don't respond.


for N=1 trials:
- is the letter the same as the one that preceded it? If so (it's a target), and press "A". If not, don't respond.


for N=2 trials:
- is the letter the same as the one presented two trials before? If so (it's a target), and press "A". If not, don't respond.


for N=3 trials:
- is the letter the same as the one presented three trials before? If so (it's a target), and press "A". If not, don't respond.



              Specific Procedural Information
(1) Single n-back letter EXPERIMENT  information:
- After instructions, participants receive 9 trials of practice per level N tested (here: N = 0 to N = 3) ,
(-> can be changed to eliminate N = 3 as was done by Ragland et al (2002))
- once practice is done, participants get the option to repeat practice
- After practice, participants receive 3 blocks per level of N tested. Which particular level a participant works on is
pseudo-randomly determined (see Ragland et al, 2002).
- the instructions are self-paced as a default, to change them to a timed format (default = 9s, see Ragland et al, 2002),
 follow instructions under values.instruction_duration


(2) Single n-back BLOCK information:
- Each single n-task block consists of 15+ trials (Ragland et al, 2002) using 20 different consonants.
=> + trials are the N trials that cannot display target shapes yet (=start trials). Their numbers vary depending on N.
  The data collected during these  start trials are NOT included in performance counts for Correct Rejections/False Alarms.
=> Of the actual  15 experimental trials, 5 present a target and 10 do not (1:2 ratio as in Ragland et al, 2002).
- The computer selects randomly
a) whether it is a target trial or not and
b) what letter to show if it is not a target trial


(3) Single n-back TRIAL information:
- Each trial presents the letter for 500ms and waits another 2000ms before presenting the next letter in the sequence
(see Ragland et al. for InterstimulusInterval = 2500ms). The trialduration can be edited by experimenter.
- Participants have the entire 2500ms to respond by pressing "A" if they detect a target.


*Note: The implementation for 0-nback tasks in this script differs from the procedure used by Jaeggi and collegues in her research.
Jaeggi and collegues used a pre-defined shape. In this script, the target shape is defined at runtime for each participant during the first trial.
Participants are instructed to pay close attention to this first presentation and are warned that presentation time is short.
Furthermore in this script, the experimenter can set how long the target letter should be presented to participants in 0 nback trials, as well
as how much time before starting the actual task (after the target has disappeared)
************************************************************************************************************************************************************************


************************************************************************************************************************************************************************
           INFORMATION FOR CODE-CHANGES (e.g. Adding/Removing levels of N)


Instructions for changing code for different levels of Ns are provided with this script. Please check the following sections for the relevant info:
1. Values
2. Lists
3. Instructions: (a) Instruction Slides (b) Instruction Blocks
4. Trials
5. Blocks
************************************************************************************************************************************************************************


************************************************************************************************************************************************************************
                DEFAULTS


requires Inquisit 4.0.0.0 or greater


<defaults>
/minimumversion = "4.0.0.0"


/ screencolor = black
</defaults>
/canvasaspectratio = (4,3)


************************************************************************************************************************************************************************


************************************************************************************************************************************************************************
                CUSTOM VALUES


******************
editable by experimenter: (changes need to be made under values below)
******************
trialduration:       Interstimulusinterval for regular n-back trials, default = 2500ms,
posttrialpause_aftertarget0:   the posttrialpause after the target in 0nback tasks disappears from sight and the actual 0 nback testing starts
            (default = 2000ms, to make it comparable to the remaining trials)
showtarget0:       the amount of time the target for N = 0 trials should be presented; default = 3000. KH note: I've set it to 5000 to give the children more time to memorise the letter.
instruction_duration:     the time the instructions for each experimental block are shown, default = 9000ms
          only applies if instructions for experimental blocks are NOT self-paced
            (see INSTRUCTIONS -> INSTRUCTION TRIALS -> trial.expinstructiontrial for further info)
          the default for this script are self-paced instructions
highestN:        default N = 3
lowestN:        default N = 0
debugmode = 0       debugmode = 1: targetalerts are shown on screen,
          debugmode = 0, no targetalerts are shown (default)



(in general: if levels of N are changed, adjustments need to be made to
instructions and list.Nlevel)


<values >
/trialduration = 2500
/posttrialpause_aftertarget0 = 2000
/instruction_duration = 9000
/highestN = 2
/lowestN = 0
/showtarget0 = 5000
/debugmode = 0
</values>


KH note: In this script I have set highestN = 2. N3 would be too difficult for children.


******************
updated automatically during runtime:
******************


minus1:       contains the stimulusitemnumber of the stimulus in the trial preceding the current one
minus2:       contains the stimulusitemnumber of the stimulus shown 2 trials before the current one
minus3:       contains the stimulusitemnumber of the stimulus shown 3 trials before the current one
minus4:       contains the stimulusitemnumber of the stimulus shown 4 trials before the current one
stim:        contains the current stimulusitem
stimnumber:      contains the current stimulusitemnumber
N:         the lag between a target and the stimulus it repeats
currenttarget:     contains the stimulusnumber of the current target
         (a target in N = 0 trials is a stimulus with the same stimulus number as stored in target0)
Hits:        codes the number of correctly identifiying a target
FalseA:       codes the number of times a participant identifies a non-target as a target
Misses:       codes the number of times a participant misses to identify a target
CorrReject:      codes the number of times a participant correctly identifies a non-target (and does nothing)
values.TotalHits:    the number of total hits across all experimental blocks
values.TotalFA:     the number of total false alarms across all experimental blocks
values.TotalBlocks:    the total number of experimental blocks run
values.DV:      dependent variable (DV) in Jaeggi et al (2010): the proportion of (TotalHits - TotalFA)/number of total blocks
starttrialcounter:    keeps track of how many start trials have been run
trialduration_starttrial:  the trialduration time for the starttrials, depends on level of N (starttrial for N = 0 trials differs)
starttrialposttrialpause:  the posttrialpause of starttrials (can be set for N = 0 trials, for all others it's 0)



<values>
/minus1 = 0
/minus2 = 0
/minus3 = 0
/minus4 = 0
/N = 0
/currenttarget = 0
/Hits = 0
/FalseA = 0
/Misses = 0
/CorrReject = 0
/TotalHits = 0
/TotalFA = 0
/DV = 0
/TotalBlocks = 0
/starttrialcounter = 0
/trialduration_starttrial = 0
/starttrialposttrialpause = 0
</values>


**************************ADDITIONAL N-LEVELS*************************************
* if additional N-levels are needed, create and add further "minusN" values and set them to 0,
Example: N = 5
/minus5 = 0
************************************************************************************************************************************************************************


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


expressions.selectinstruct helps to select the adequate instructions for adaptive n-back testing


<expressions>
/selectinstruct = values.N + 1
</expressions>
************************************************************************************************************************************************************************


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



*list.Nlevel  pseudorandomly selects the next N level (the experiment runs as many blocks as there are
items in this list)
! if you do NOT run level N = 3, remove all 3s from the item list of this list
! if you want to run a level more or fewer times adjust the number of the digits in the item list accordingly
! if you want to run the levels in sequence, set /select = sequence


IN GENERAL: if you run different levels of N or change the number of repetitions, you need to adjust the item list of
list.nlevel
<list Nlevel>
/items = (0,1,2)
/selectionmode = sequence
</list>



****list Variables to select notargetvalue


*list.notargetvalue selects any of the 8 numbers but the one selected for targetvalue
<list notargetvalue>
/items = (1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19)
/ not = (values.currenttarget)
/ replace = true
</list>
************************************************************************************************************************************************************************


************************************************************************************************************************************************************************
                DATA COLLECTION


this implementation suggests to collect the following information:
date:       Date of Experiment
time:       Time of Day
subject:      Subjectnumber
values.N:      the type of N-back trial 
blockcode:      the name of the current block
values.TotalBlocks:    the total number of experimental blocks run
trialcode:      the name of the current trial
stimulusitem:     the file of the stimulus shown during a trial
values.currenttarget:   the item number of the current target
response:      the response of the participant
correct:      the correctness of the response
latency:      how fast a participant responded within the given timeframe, if at all
values.Hits:     the sum of Hits in a block
values.FalseA:     the sum of False Alarms in a block
values. Misses:     the sum of Misses in a block
values.CorrReject:    the sum of Correct Rejections in a block
values.TotalHits:    the sum of total hits across all experimental blocks
values.TotalFA:     the number of total false alarms across all experimental blocks
values.DV:      the proportion of (TotalHits - TotalFA)/number of experimental blocks



*********************
raw data
*********************
<data>
/file = "SingleTaskNBack_letters_rawdata.iqdat"
/columns = [date, time, elapsedtime, subject, values.N, blockcode, values.TotalBlocks, trialcode, trialnum, stimulusitem,
    values.currenttarget, response, correct, latency,
    values.Hits, values.FalseA, values.Misses, values.CorrReject,
    values.TotalHits, values.TotalFA, values.DV]
/ separatefiles = true
</data>


*********************
summary data
*********************
<summarydata >
/file = "SingleTaskNBack_letters_summary.iqdat"
/columns = [script.startdate, script.starttime, script.elapsedtime, script.subjectid, script.groupid, values.TotalHits, values.TotalFA, values.DV]
</summarydata>


************************************************************************************************************************************************************************


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


***********INSTRUCTION SLIDES*****************************
Note: these instruction slides are adapted from the original instructions kindly provided to Millisecond Software by Jaeggi et al .
Thank you!


*********************************************************
NOTE:
If you only run N = 0 to N = 2, remove/exchange the instructionslides that reference N = 3
**********************************************************


<item 0back_startinstructions>
/1 = "SingleNbackInstructions_letters_N0_instruct.gif"
/2 = "SingleNbackInstructions_letters_letspractice.gif"
</item>


<item 0back_startinstructions2>
/1 = "SingleNbackInstructions_letters_N0_instruct2.gif"
</item>


<item 1back_startinstructions>
/1 = "SingleNbackInstructions_letters_N1_instruct.gif"
/2 = "SingleNbackInstructions_letters_letspractice.gif"
</item>


<item 1back_startinstructions2>
/1 = "SingleNbackInstructions_letters_N1_instruct2.gif"
</item>


<item 2back_startinstructions>
/1 = "SingleNbackInstructions_letters_2BackOnly_instruct.gif"
/2 = "SingleNbackInstructions_letters_letspractice.gif"
</item>


<item 2back_startinstructions2>
/1 = "SingleNbackInstructions_letters_N2_instruct2.gif"
</item>


<item nback_takeabreak>
/1 = "SingleNbackInstructions_letters_takeabreak.gif"
</item>


<item nback_takeabreak_N0>
/1 = "SingleNbackInstructions_letters_takeabreak_0back.gif"
</item>


<item practiceend>
/1 =  "SingleNbackInstructions_letters_practiceend0123.gif"
</item>



*slides to start experimental trials/end experiment
<item startendslides>
/1 = "SingleNbackInstructions_letters_start.gif"
/2 = "ThankYouSlide.gif"
</item>
 
*Instructions for individual experimental N-levels (not original)
<item expinstructions>
/1 = "SingleNbackInstructionsN0_letters_exp.gif"
/2 = "SingleNbackInstructionsN1_letters_exp.gif"
/3 = "SingleNbackInstructionsN2_letters_exp.gif"
/4 = "SingleNbackInstructionsN3_letters_exp.gif"
</item>


*******CODE CHANGES:
If you would like to run different levels of N in practice/experimental trials, change/add the necessary instruction slides
under the appropriate item categories above, as well as pay attention to the changes necessary under "Instruction Blocks"



***********INSTRUCTION IMAGE SELECTION******************************************
<picture Single0backinstructions_start>
/ items = 0back_startinstructions
/ select = sequence
/ size = (100%, 100%)
</picture>


<picture Single0backinstructions_start2>
/ items = 0back_startinstructions2
/ select = sequence
/ size = (100%, 100%)
</picture>


<picture Single1backinstructions_start>
/ items = 1back_startinstructions
/ select = sequence
/ size = (100%, 100%)
</picture>


<picture Single1backinstructions_start2>
/ items = 1back_startinstructions2
/ select = sequence
/ size = (100%, 100%)
</picture>


<picture Single2backinstructions_start>
/ items = 2back_startinstructions
/ select = sequence
/ size = (100%, 100%)
</picture>


<picture Single2backinstructions_start2>
/ items = 2back_startinstructions2
/ select = sequence
/ size = (100%, 100%)
</picture>


<picture pic_nback_takeabreak>
/ items = nback_takeabreak
/ select = sequence
/ size = (100%, 100%)
</picture>


<picture pic_nback_takeabreak_N0>
/ items = nback_takeabreak_N0
/ select = sequence
/ size = (100%, 100%)
</picture>


<picture Practice_end>
/ items = practiceend
/select = 1
/ size = (100%, 100%)
</picture>


<picture StartExp_slide>
/ items = startendslides
/ select = 1
/ size = (100%, 100%)
</picture>


<picture EndExp_slide>
/ items = startendslides
/select = 2
/ size = (100%, 100%)
</picture>


*instructions for individual experimental trials are selected depending on level of N
<picture expinstructionslide>
/items = expinstructions
/select = expressions.selectinstruct
/size = (100%, 100%)
</picture>


<picture repeatpractice_page>
/items =  ("SingleNbackInstructions_letters_postpractice.gif")
/size = (100%, 100%)
</picture>


***********INSTRUCTION TRIALS*******************************************


****************************************************************************************
Note:
* instructions for each level of N are self-paced.
* If they should be shown for  a predetermined time (e.g. 9s, see Ragland et al, 2002)
use the following code instead in trial.expinstructiontrial:
/ stimulusframes = [1 = expinstructionslide, eraserrec, wait]
/ validresponse = (noresponse)
/ timeout = (values.instruction_duration)
****************************************************************************************
<trial expinstructiontrial>
/ stimulusframes = [1 = expinstructionslide]
/ validresponse = (57)
/ recorddata = false
</trial>


<trial StartNbackTrial>
/ stimulusframes = [1 = StartExp_slide]
/ validresponse = (57)
/ recorddata = false
</trial>


<trial EndNbackTrial>
/ stimulusframes = [1 = EndExp_slide]
/ validresponse = (57)
/ recorddata = false
</trial>


<trial 0backinstruct_starttrial>
/ stimulusframes = [1 = Single0backinstructions_start]
/ validresponse = (57)
/ recorddata = false
</trial>


<trial 0backinstruct_starttrial2>
/ stimulusframes = [1 = Single0backinstructions_start2]
/ validresponse = (57)
/ recorddata = false
</trial>


<trial 1backinstruct_starttrial>
/ stimulusframes = [1 = Single1backinstructions_start]
/ validresponse = (57)
/ recorddata = false
</trial>


<trial 1backinstruct_starttrial2>
/ stimulusframes = [1 = Single1backinstructions_start2]
/ validresponse = (57)
/ recorddata = false
</trial>


<trial 2backinstruct_starttrial>
/ stimulusframes = [1 = Single2backinstructions_start]
/ validresponse = (57)
/ recorddata = false
</trial>


<trial 2backinstruct_starttrial2>
/ stimulusframes = [1 = Single2backinstructions_start2]
/ validresponse = (57)
/ recorddata = false
</trial>


<trial trial_nback_takeabreak>
/ stimulusframes = [1 = pic_nback_takeabreak]
/ validresponse = (57)
/ recorddata = false
</trial>


<trial trial_nback_takeabreak_N0>
/ stimulusframes = [1 = pic_nback_takeabreak_N0]
/ validresponse = (57)
/ recorddata = false
</trial>


<trial Practice_endtrial>
/ stimulusframes = [1 = Practice_end]
/ validresponse = (57)
/ recorddata = false
</trial>


<trial StartExp_trial>
/ stimulusframes = [1 = StartExp_slide]
/ validresponse = (57)
/ recorddata = false
</trial>


<trial repeatpractice>
/ stimulusframes = [1 = repeatpractice_page]
/ validresponse = (28, 45)
/ recorddata = false
</trial>


<trial endrepeatpractice>
/ stimulusframes = [1 = repeatpractice_page]
/ validresponse = (28)
/ recorddata = false
</trial>


<trial EndExp_trial>
/ stimulusframes = [1 = EndExp_slide]
/ validresponse = (57)
/ recorddata = false
</trial>


*************INSTRUCTION BLOCKS*************************************************************************************


ATTENTION: PRACTICE BLOCKS
(1) This block sets the beginning N value for practice trials to the lowest level of N run in the experiment
(2) runs instructions 1-3, for N=0-2, if more/fewer than three N levels are run adjust /trials = [1-X.....]
Example: N=0 to N = 2: / trials = [1-5 = Nbackinstruct_starttrial]



<block  StartNback>
/ trials = [1 = StartNbackTrial]
/ recorddata = false
</block>


<block  EndNback>
/ trials = [1 = EndNbackTrial]
/ recorddata = false
</block>


<block  0backinstruct_start>
/ trials = [1-2 = 0backinstruct_starttrial]
/ recorddata = false
</block>


<block  0backinstruct_start2>
/ trials = [1 = 0backinstruct_starttrial2]
/ recorddata = false
/ branch = [if (trial.repeatpractice.response == 45)block.practice_s_0task]
</block>


<block  1backinstruct_start>
/ trials = [1-2 = 1backinstruct_starttrial]
/ recorddata = false
</block>


<block  1backinstruct_start2>
/ trials = [1 = 1backinstruct_starttrial2]
/ recorddata = false
/ branch = [if (trial.repeatpractice.response == 45)block.practice_s_1task]
</block>


<block  2backinstruct_start>
/ trials = [1-2 = 2backinstruct_starttrial]
/ recorddata = false
</block>


<block  2backinstruct_start2>
/ trials = [1 = 2backinstruct_starttrial2]
/ recorddata = false
/ branch = [if (trial.repeatpractice.response == 45)block.practice_s_2task]
</block>


<block  2backinstruct_start3>
/ trials = [1 = 2backinstruct_starttrial2]
/ recorddata = false
</block>


<block  nbackinstruct_takeabreak>
/ trials = [1 = trial_nback_takeabreak]
/ recorddata = false
</block>


<block  nbackinstruct_takeabreak_N0>
/ trials = [1 = trial_nback_takeabreak_N0]
/ recorddata = false
</block>


Repeat practice by pressing X, to continue, press ENTER:


<block RepeatPractice0back>
/trials = [1 = repeatpractice]
/ recorddata = false
/ branch = [if (trial.repeatpractice.response == 45)block.0backinstruct_start2]
/ screencolor = (0,0,0)
</block>


Repeat practice by pressing X, to continue, press ENTER:


<block RepeatPractice1back>
/trials = [1 = repeatpractice]
/ recorddata = false
/ branch = [if (trial.repeatpractice.response == 45)block.1backinstruct_start2]
/ screencolor = (0,0,0)
</block>


Repeat practice by pressing X, to continue, press ENTER:


<block RepeatPractice2back>
/trials = [1 = repeatpractice]
/ recorddata = false
/ branch = [if (trial.repeatpractice.response == 45)block.2backinstruct_start2]
/ screencolor = (0,0,0)
</block>


<block EndRepeatPractice2back>
/trials = [1 = endrepeatpractice]
/ recorddata = false
/ screencolor = (0,0,0)
</block>


<block Practiceblock_end>
/ trials = [1 = Practice_endtrial]
/ recorddata = false
</block>


EXPERIMENTAL BLOCKS
<block StartExp>
/ trials = [1 = StartExp_trial]
/ recorddata = false
/ onblockbegin = [
      values.TotalHits = 0;
      values.TotalFA = 0;
      values.TotalBlocks = 0;
      values.DV = 0
      ]
</block>



<block EndExp>
/ trials = [1 = EndExp_trial]
</block>



************************************************************************************************************************************************************************


************************************************************************************************************************************************************************
                 SUMMARY PAGES


*A feedback page that is presented at the end of each practice  block


<instruct >
/ fontstyle = ("Arial", 2.67%, false, false, false, false, 5, 0)
/ txcolor = (255, 255, 255)
/ screencolor = (0, 0, 0)
/ windowsize = (70%, 60%)
</instruct>



<page BlockSummary>
^^                                           FEEDBACK
^^
^^CORRECT:  <% ((values.Hits + values.CorrReject) /(trial.target.trialcount + trial.nontarget.trialcount) ) * 100 %>%  of the times
</page>


<page BlockSummary_practice>
^^                                           FEEDBACK
^^
^^CORRECT:  <% ((values.Hits + values.CorrReject) / (trial.target.trialcount + trial.nontarget.trialcount) )* 100 %>%  of the times
</page>
************************************************************************************************************************************************************************


************************************************************************************************************************************************************************
                  LETTER ITEMS


* 20 consonants
<item letters>
/1 = "B"
/2 = "C"
/3 = "D"
/4 = "F"
/5 = "G"
/6 = "H"
/7 = "J"
/8 = "K"
/9 = "L"
/10 = "M"
/11 = "N"
/12 = "P"
/13 = "Q"
/14 = "R"
/15 = "S"
/16 = "T"
/17 = "V"
/18 = "X"
/19 = "Z"
</item>


***randomly selects one of the letters
<text startletter>
/ items = letters
/select = replace
/ position = (50%, 50%)
/ txcolor = (white)
/ txbgcolor = (black)
/ fontstyle = ("Arial", 20%, false, false, false, false, 5, 0)
</text>


***selects any letter that cannot be a target
<text nontargetletter>
/ items = letters
/select = notargetvalue
/ position = (50%, 50%)
/ txcolor = (white)
/ txbgcolor = (black)
/ fontstyle = ("Arial", 20%, false, false, false, false, 5, 0)
</text>


***selects the item with the same item number as the established target
<text targetletter>
/ items = letters
/select = values.currenttarget
/ position = (50%, 50%)
/ txcolor = (white)
/ txbgcolor = (black)
/ fontstyle = ("Arial", 20%, false, false, false, false, 5, 0)
</text>



************************************************************************************************************************************************************************


************************************************************************************************************************************************************************
              FEEDBACK MESSAGES FOR PRACTICE TRIALS ONLY
                    (default: they are NOT used)
<text ErrorFeedback>
/ items = ("ERROR")
/ fontstyle = ("Arial", 5.00%, true, false, false, false, 5, 0)
/ txcolor = (255, 0, 0)
/ txbgcolor = (0, 0, 0)
/ position = (50%, 70%)
</text>


<text CorrectFeedback>
/ items = ("CORRECT")
/ fontstyle = ("Arial", 5.00%, true, false, false, false, 5, 0)
/ txcolor = (0, 255, 0)
/ txbgcolor = (0, 0, 0)
/ position = (50%, 70%)
</text>


************************************************************************************************************************************************************************


************************************************************************************************************************************************************************
                ASSISTANT STIMULI


*****acts as an eraser after showing the key stimuli for 500ms, staying on for the remainder of the trial
<shape eraser>
/ shape = rectangle
/ size = (100%, 100%)
/ color = (0, 0, 0)
</shape>


*****reminder that the letter participants see during the first trial in N = 0 nback trials is the target
<text targetreminder>
/ items = ("Look for this letter")
/ position = (50%, 25%)
/ txbgcolor = (black)
/ txcolor = (black)
/ fontstyle = ("Arial", 3.00%, false, false, false, false, 5, 0)
</text>


*****For timed instructions, this shape covers up the original instructions (on slides)
that instruct participants to use the Spacebar to continue
<shape eraserrec>
/shape = rectangle
/color = (black)
/ position = (50%, 95%)
/ size = (100%, 8%)
</shape>


*****For timed instructions this text alerts participants that the task starts in the
predetermined amount of time (default: 9s)
<text wait>
/ items = ("the task will start automatically in <%values.instruction_duration/1000%> s")
/ position = (50%, 95%)
/ txbgcolor = (black)
/ txcolor = (white)
/ fontstyle = ("Arial", 2.08%, false, false, false, false, 5, 0)
</text>


*****Debug Code:
<text targetalert>
/items = ("target")
/position = (50%, 80%)
/txcolor = (black)
/txbgcolor = (black)
/ fontstyle = ("Arial", 3%, true, false, false, false, 5, 1)
</text>
************************************************************************************************************************************************************************


************************************************************************************************************************************************************************
                   TRIALS
*there are 3 types of trials
 1. start:     presented at beginning of block when number of trials too small for Target trials; they can present
        any of the stimuli (N = 0,  start trial presents the target shape)
 2. nontarget:   trials that present stimuli that do not repeat the stimulus of n-trials before
 3. target:    trials that present Target stimuli



**********************************
Starttrial
**********************************
NOTE:
for N = 0 trials:
- the first trial shows the target for a set amount of time (editable), together with a text stimulus that
reminds participants that this letter is the target.
- There is a pause (length is editable) before the next trial starts


*start trial runs N-times (unless N = 0, then it runs N = 1 time)
<trial start>
/ ontrialbegin = [if (values.N == 0)
      {text.targetreminder.textcolor = red;
      shape.eraser.color = transparent;
      values.trialduration_starttrial = values.showtarget0;
      values.starttrialposttrialpause = values.posttrialpause_aftertarget0}
      else
      {values.trialduration_starttrial = values.trialduration;
      values.starttrialposttrialpause = 0}]


/ stimulustimes = [0 = startletter, targetreminder; 500 = eraser]
/ validresponse = (noresponse, 57)
/ correctresponse = (noresponse)
/ responsetime = 0
/ ontrialbegin = [
      {if (values.N == 1) values.currenttarget = values.minus1};
      {if (values.N == 2) values.currenttarget = values.minus2};
      {if (values.N == 3) values.currenttarget = values.minus3};
      {if (values.N == 4) values.currenttarget = values.minus4};
      values.starttrialcounter += 1;
     ]
/ ontrialend = [ 
      {if (values.N == 0) values.currenttarget = text.startletter.currentitemnumber};
      values.minus4 = values.minus3;
      values.minus3 = values.minus2;
      values.minus2 = values.minus1;
      values.minus1 = text.startletter.currentitemnumber
     ]


/ ontrialend = [text.targetreminder.textcolor = black; shape.eraser.color = black]
/trialduration = values.trialduration_starttrial
/ posttrialpause = (values.starttrialposttrialpause)
/branch = [if (values.starttrialcounter < values.N) trial.start]
</trial>


**********************************
Nontarget Trials
**********************************
<trial nontarget>
/ stimulustimes = [0 = nontargetletter; 500 = eraser]
/validresponse = (noresponse, 57)
/ correctresponse = (noresponse)
/ ontrialbegin = [
      {if (values.N == 1) values.currenttarget = values.minus1};
      {if (values.N == 2) values.currenttarget = values.minus2};
      {if (values.N == 3) values.currenttarget = values.minus3};
      {if (values.N == 4) values.currenttarget = values.minus4};
     
     ]


/ ontrialend = [ 
      values.minus4 = values.minus3;
      values.minus3 = values.minus2;
      values.minus2 = values.minus1;
      values.minus1 = text.nontargetletter.currentitemnumber;
      values.CorrReject = values.CorrReject + trial.nontarget.correct;
      values.FalseA = values.FalseA + trial.nontarget.error;
      values.TotalFA = values.TotalFA + trial.nontarget.error;
      values.DV = (values.TotalHits - values.TotalFA)/values.TotalBlocks;


     ]
/ responsetime = 0
/ trialduration = values.trialduration
</trial>


**********************************
Target Trials
**********************************
**if target, press the letter "up key" (code: 8)
<trial target>
/ stimulustimes = [0 = targetletter, targetalert; 500 = eraser]
/validresponse = (noresponse, 57)
/ correctresponse = (57)
/ ontrialbegin = [
      {if (values.N == 1) values.currenttarget = values.minus1};
      {if (values.N == 2) values.currenttarget = values.minus2};
      {if (values.N == 3) values.currenttarget = values.minus3};
      {if (values.N == 4) values.currenttarget = values.minus4};
     ]


/ ontrialend = [
     values.minus4 = values.minus3;
     values.minus3 = values.minus2;
     values.minus2 = values.minus1;
     values.minus1 = text.targetletter.currentitemnumber;
     values.Hits = values.Hits+ trial.target.correct;
     values.Misses = values.Misses + trial.target.error;
     values.TotalHits = values.TotalHits + trial.target.correct;
     values.DV = (values.TotalHits - values.TotalFA)/values.TotalBlocks;
     ]
/ responsetime = 0
/ trialduration = values.trialduration
</trial>


********************************ADDITIONAL N-LEVELS*****************************************************


For each trial type:
(1) add {if (values.N == X) values.currenttarget = values.minusX};, e.g. N = 5
/ ontrialbegin = [
      .....
      {if (values.N == 1) values.currenttarget = values.minus1};
      {if (values.N == 2) values.currenttarget = values.minus2};
      {if (values.N == 3) values.currenttarget = values.minus3};
      {if (values.N == 4) values.currenttarget = values.minus4};
  =>    {if (values.N == 5) values.currenttarget = values.minus5};
     ]
(2) add  values.minusX = values.minus(X-1)  e.g. N = 5 - largest N goes on top of the list
/ ontrialend = [
  =>    values.minus5 = values.minus4;
      values.minus4 = values.minus3;
      values.minus3 = values.minus2;
      values.minus2 = values.minus1;
      values.minus1 = picture.targetshape.currentitemnumber;
      ....
     ]


************************************************************************************************************************************************************************


************************************************************************************************************************************************************************
                  PRACTICE-BLOCKS


* Practice Blocks give feedback
* Block starts with
(a) Instructiontrial
(b) N start-trials that cannot present Targets yet, if N = 0, the first trial presents the target letter
(c) 9 practice trials: ratio targets : nontargets = 1 : 2
* stops after lever N = highestN (set by experimenter)
(d) runs from the lowest N to the highest N



<block practice_s_0task>
/ onblockbegin = [
      values.currenttarget = 0; values.minus1 = 0; values.minus2 = 0; values.minus3 = 0;
      values.TotalBlocks += 1;
      values.starttrialcounter = 0;
      values.Hits = 0; values.FalseA = 0; values.Misses = 0; values.CorrReject = 0;
      values.n = 0;]
/ trials = [1 = start; 2-10 = noreplace(nontarget, nontarget, target);]
/ onblockend = [values.TotalHits = 0; values.TotalFA = 0; values.DV = 0]
/ screencolor  = (0, 0, 0)
/ postinstructions = (BlockSummary_practice)
</block>



<block practice_s_1task>
/ onblockbegin = [
      values.currenttarget = 0; values.minus1 = 0; values.minus2 = 0; values.minus3 = 0;
      values.TotalBlocks += 1;
      values.starttrialcounter = 0;
      values.Hits = 0; values.FalseA = 0; values.Misses = 0; values.CorrReject = 0;
      values.n = 1]
/ trials = [1 = start; 2-10 = noreplace(nontarget, nontarget, target)]
/ onblockend = [values.TotalHits = 0; values.TotalFA = 0; values.DV = 0]
/ screencolor  = (0, 0, 0)
/ postinstructions = (BlockSummary_practice)
</block>


<block practice_s_2task>
/ onblockbegin = [
      values.currenttarget = 0; values.minus1 = 0; values.minus2 = 0; values.minus3 = 0;
      values.TotalBlocks += 1;
      values.starttrialcounter = 0;
      values.Hits = 0; values.FalseA = 0; values.Misses = 0; values.CorrReject = 0;
      values.n = 2]
/ trials = [1 = start; 2-10 = noreplace(nontarget, nontarget, target)]
/ onblockend = [values.TotalHits = 0; values.TotalFA = 0; values.DV = 0]
/ screencolor  = (0, 0, 0)
/ postinstructions = (BlockSummary_practice)
</block>


if trial feedback is desired:
/ errormessage = true(ErrorFeedback, 500)
/ correctmessage = true(CorrectFeedback, 500)


************************************************************************************************************************************************************************


************************************************************************************************************************************************************************
                  EXPERIMENTAL-BLOCKS NONADAPTIVE



* Block starts with
(a) Instructiontrial
(b) N start-trials that cannot present Targets yet
(c) 15 Experimental trials
* Experimental trials: ratio targets : nontargets = 1 : 2
* N level is pseudo-randomly selected by list.Nlevel
* Block runs as many times as there are items in list.Nlevel


<block s_0task>
/ onblockbegin = [values.N = 0]
/ onblockbegin = [
      values.currenttarget = 0; values.minus1 = 0; values.minus2 = 0; values.minus3 = 0; values.minus4 = 0;
      values.Hits = 0; values.FalseA = 0; values.Misses = 0; values.CorrReject = 0;
      values.TotalBlocks += 1;
      values.starttrialcounter = 0;
      ]
/ trials = [1 = expinstructiontrial; 2 = start; 3 - 20 = noreplace(nontarget, nontarget, target)]
/ screencolor  = (0, 0, 0)
/ postinstructions = (BlockSummary)
</block>



<block s_0task2>
/ onblockbegin = [values.N = 0]
/ onblockbegin = [
      values.currenttarget = 0; values.minus1 = 0; values.minus2 = 0; values.minus3 = 0; values.minus4 = 0;
      values.Hits = 0; values.FalseA = 0; values.Misses = 0; values.CorrReject = 0;
      values.TotalBlocks += 1;
      values.starttrialcounter = 0;
      ]
/ trials = [1 = start; 2 - 19 = noreplace(nontarget, nontarget, target)]
/ screencolor  = (0, 0, 0)
/ postinstructions = (BlockSummary)
</block>


<block s_1task>
/ onblockbegin = [values.N = 1]
/ onblockbegin = [
      values.currenttarget = 0; values.minus1 = 0; values.minus2 = 0; values.minus3 = 0; values.minus4 = 0;
      values.Hits = 0; values.FalseA = 0; values.Misses = 0; values.CorrReject = 0;
      values.TotalBlocks += 1;
      values.starttrialcounter = 0;
      ]
/ trials = [1 = expinstructiontrial; 2 = start; 3 - 20 = noreplace(nontarget, nontarget, target)]
/ screencolor  = (0, 0, 0)
/ postinstructions = (BlockSummary)
</block>


<block s_1task2>
/ onblockbegin = [values.N = 1]
/ onblockbegin = [
      values.currenttarget = 0; values.minus1 = 0; values.minus2 = 0; values.minus3 = 0; values.minus4 = 0;
      values.Hits = 0; values.FalseA = 0; values.Misses = 0; values.CorrReject = 0;
      values.TotalBlocks += 1;
      values.starttrialcounter = 0;
      ]
/ trials = [1 = start; 2 - 19 = noreplace(nontarget, nontarget, target)]
/ screencolor  = (0, 0, 0)
/ postinstructions = (BlockSummary)
</block>


<block s_2task>
/ onblockbegin = [values.N = 2]
/ onblockbegin = [
      values.currenttarget = 0; values.minus1 = 0; values.minus2 = 0; values.minus3 = 0; values.minus4 = 0;
      values.Hits = 0; values.FalseA = 0; values.Misses = 0; values.CorrReject = 0;
      values.TotalBlocks += 1;
      values.starttrialcounter = 0;
      ]
/ trials = [1 = expinstructiontrial; 2 = start; 3 - 47 = noreplace(nontarget, nontarget, target);]
/ screencolor  = (0, 0, 0)
/ postinstructions = (BlockSummary)
</block>


<block s_2task2>
/ onblockbegin = [values.N = 2]
/ onblockbegin = [
      values.currenttarget = 0; values.minus1 = 0; values.minus2 = 0; values.minus3 = 0; values.minus4 = 0;
      values.Hits = 0; values.FalseA = 0; values.Misses = 0; values.CorrReject = 0;
      values.TotalBlocks += 1;
      values.starttrialcounter = 0;
      ]
/ trials = [1 = start; 2 - 19 = noreplace(nontarget, nontarget, target);]
/ screencolor  = (0, 0, 0)
/ postinstructions = (BlockSummary)
</block>


***********************************************ADDITIONAL N-LEVELS********************************************************
(1) add values.minusX = 0 to
/ onblockbegin = [
      values.currenttarget = 0; values.minus1 = 0; values.minus2 = 0; values.minus3 = 0; values.minus4 = 0;
      .....
      ]


Example: N = 5
/ onblockbegin = [
      values.currenttarget = 0; values.minus1 = 0; values.minus2 = 0; values.minus3 = 0; values.minus4 = 0;
      values.minus5 = 0;
      .....
      ]


************************************************************************************************************************************************************************


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


                 
*After running the initial instructions, participants work through practice blocks for N = lowestN  to N = highestN
* After practice, participants work through 3 blocks for each of the  level of N (levels are pseudorandomly determined)


<expt>
/onexptbegin = [if (values.debugmode == 1) text.targetalert.textcolor = (red)]
/ blocks = [


    1 = 2backinstruct_start;
    2 = practice_s_2task;
    3 = RepeatPractice2back;
    4 = RepeatPractice2back;
    5 = EndRepeatPractice2back;
    6 = s_2task;
    7 = EndNBack;
   ]
</expt>
************************************************************************************************************************************************************************
End of Script
************************************************************************************************************************************************************************



GO

Merge Selected

Merge into selected topic...



Merge into merge target...



Merge into a specific topic ID...




Reading This Topic

Explore
Messages
Mentions
Search