Adding random mechanism

To illustrate how to draw random pictures and screen location, let’s extend the experiment to a visual search paradigm, in which the stimulus words appear within a set of distractors at random screen locations.

We first design the distractor stimuli, which will be either the digits or words 1-6:


PICTURE  1  N
PICTURE  2  N
PICTURE  3  N
PICTURE  4  N
PICTURE  5  N
PICTURE  6  N

PICTURE  One   N
PICTURE  Two   N
PICTURE  Three N
PICTURE  Four  N
PICTURE  Five  N
PICTURE  Six   N
 

These picture definitions will be put in two different sets which will represent the distractor set we can draw from


SET  Digits V
1,2,3,4,5,6
SET  Words V
One,Two,Three,Four,Five,Six
 

To display the distractors, we define a circle with 6 positions. The target item (left or right) will be placed on one of the position and the remaining 5 positions will be filled with distractors


POSItioN  Circle C 0,0 80 0 6
 

A circle layout can be directly defined by using the ‘C” position type. This circle will have a diameter of 8cm and 6 positions.

To display the target words on random positions we must mix the positions within the circle. This is achieved by the MixPosition (MP) trial command:


MP Circle
 

We will load the target word always on the position index, but since the indices are mixed this first position will always be one of the six screen locations

To fill the remaining 5 positions, we use the FillPosition (FP) command. This command loads a target word and fills all remaining positions with elements from a set


FP  ? Circle 1 0 ? 6 1
 

The two question marks are the placeholders for the picture name of the target item and the name of the set that contains the distractor items. The target will change between ‘left’ and ;right’ and the distractor set will change between ‘Digits’ and ‘Words’

The entire trial structure is as follows

 

TRIAL ShowWord
  MP  Circle          ; Mix the positions of the circle
  CS  2000          ; Clear Screen and wait for 1000 ms
  RK  ResKeys 2000          ; Activate Response Registration with MaxRt = 2000
  FP  ? Circle 1  0  ?  6  1          ; Load target and fill positions
  FB  ?          ; Compare the response against the correct key
    1:SP Wrong   FBpos 1 1000          ; Show ‘Wrong’ for 1s if response is wrong
    2:SP Correct FBpos 1 1000          ; Show ‘Correct’ for 1s if response is correct
    3:SP Correct FBpos 1 1000          ; Show ‘Late’ for 1s if response is correct
 

We have now three variable arguments. One for the target, one for the distractor set, and one for the correct key. We must therefore rewrite the block definition to introduce a 2x2 design:

 


BLOCK ChoiceRT 2 2          ; define a 2 by 2 design
1 ShowWord  Left   Digits X          ; Target is  ‘Left’, Distractor is Digits
1 ShowWord  Right  Digits M          ; Target is  ‘Right’, Distractor is Digits
1 ShowWord  Left   Words  X          ; Target is  ‘Left’, Distractor is Words
1 ShowWord  Right  Words  M          ; Target is  ‘Right’, Distractor is Words
 

We can directly define a 2x2 design for the block which will generate columns in the result file which contain the factorial coding. We must also adjust the RUNBLOCK command to run multiples of 4 to ensure that each trial is executed equally often


SesSION My First Experiment
RUNTRIAL  Instruct Title Inst1  Start          ; Execute trial ‘instruct’ and insert the pictures as instructions
RUNBLOCK   ChoiceRT  12           ; Execute block ‘ChoiceRT’ with 10 trials in random order
 

 

Below is the final script for a choice reaction time task combined with a visual search task

 


FONT  Big    Arial 10 1 bold
FONT  Std    Arial 6
FONT  Small  Arial 4


PICTURE  Title  T
Choice Reaction Time Task
PICTURE  Inst1  T
You will see the words ‘left’ or ‘right’

Press the corresponding response key

X-key for right

Y-key for left


PICTURE  Start T
Press a response key to start the task



POSITION  Top    P 0,-50
POSITION  Bottom P 0,40
POSITION  Center P 0,0


KEY ResKeys
X  M          ; Define a Key Set consisting of’ ‘X and ‘M’


PICTURE  Correct  N
PICTURE  Wrong    N
PICTURE  Late     N

POSITION FBpos P
0,30


TRIAL  Instruct 
SF  Big
SP  ?  Top
SF  Std
&SP  ?  Center
SF  Small
&SP  ?  Bottom
WK ResKeys
SF  Std



PICTURE  Left  N
PICTURE  Right N


PICTURE  1  N
PICTURE  2  N
PICTURE  3  N
PICTURE  4  N
PICTURE  5  N
PICTURE  6  N

PICTURE  One   N
PICTURE  Two   N
PICTURE  Three N
PICTURE  Four  N
PICTURE  Five  N
PICTURE  Six   N


SET  Digits V 1,2,3,4,5,6
SET  Words  V One,Two,Three,Four,Five,Six


POSItioN  Circle C 0,0 80 0 6


TRIAL ShowWord
  MP  Circle          ; Mix the positions of the circle
  CS  2000          ; Clear Screen and wait for 1000 ms
  RK  ResKeys 2000          ; Activate Response Registration with MaxRt = 2000
  FP  ? Circle 1  0  ?  6  1          ; Load target and fill positions
  FB  ?          ; Compare the response against the correct key
    1:SP Wrong   FBpos 1 1000          ; Show ‘Wrong’ for 1s if response is wrong
    2:SP Correct FBpos 1 1000          ; Show ‘Correct’ for 1s if response is correct
    3:SP Late    FBpos 1 1000          ; Show ‘Late’ for 1s if response is correct
 


BLOCK ChoiceRT 2 2          ; define a 2 by 2 design
1 ShowWord  Left   Digits X          ; Target is  ‘Left’, Distractor is Digits
1 ShowWord  Right  Digits M          ; Target is  ‘Right’, Distractor is Digits
1 ShowWord  Left   Words  X          ; Target is  ‘Left’, Distractor is Words
1 ShowWord  Right  Words  M          ; Target is  ‘Right’, Distractor is Words



SesSION My First Experiment
RUNTRIAL  Instruct Title Inst1  Start          ; Execute trial ‘instruct’ and insert the pictures as instructions
RUNBLOCK   ChoiceRT  12           ; Execute block ‘ChoiceRT’ with 10 trials in random order
 



Copyright 2021 - BeriSoft Inc.
All rights reserved