Controlling number of stimuli of same type presented in a row


Author
Message
Lewis99
Lewis99
Associate Member (96 reputation)Associate Member (96 reputation)Associate Member (96 reputation)Associate Member (96 reputation)Associate Member (96 reputation)Associate Member (96 reputation)Associate Member (96 reputation)Associate Member (96 reputation)Associate Member (96 reputation)
Group: Forum Members
Posts: 9, Visits: 73
Hi,
I am a bit stuck on a problem and haven't been able to get any of the similar solutions I've seen on the forum to work for me so was wondering if someone would be able to help. I have a list of 100 items (item pos), containing images (picture pos) divided "high" emotional intensity and "low" emotional intensity groups (Images prefixed with HP = high intensity, images prefixed with LP = low intensity). Each block maintains the same image throughout, however I want the blocks to present no more than two images of the same intensity in a row, but can't figure out how to do this. Any help would be appreciated. I've posted the relevant parts of my code below, trying to exclude extraneous information. Please let me know if you need any further information or code.
Best,
Lewis

<values>
/countposblocks = 0
/fixationduration = 0
/blankduration = 0
/trialimagepos = 0
/intialstrategy = 0
/strategychoice = 0
</values>

<parameters>
/nr_totalpostrialblocks = 5
</parameters>

<picture pos>
/ items = pos
/ select = values.trialimagepos
/ size = (50%, 50%)
/ position = (50%, 50%)
</picture>

<item pos> #have shortened the list to keep this post manageable.#
/1 = "HPAstronaut 1.jpg"
/2 = "HPBeach 1.jpg"
/3 = "HPBungee jumping 2.jpg"
/4 = "HPCat 5.jpg"
/5 = "HPCliff diver 1.jpg"
/6 = "LPCold 5.jpg"
/7 = "LPCollaboration 1.jpg"
/8 = "LPDancing 7.jpg"
/9 = "LPDessert 2.jpg"
/10 = "LPDessert 4.jpg"
</item>

<counter itemspos>
/ select = noreplace(1-10)
/ selectionrate = always
/ resetinterval = 0
</counter>

<block pos>
/ onblockbegin = [
  values.countposblocks += 1;
  values.trialimagepos=counter.itemspos.selectedvalue;
  ]
/ trials = [1= trial.regulationposone; 2=trial.regulationpostwo]
/ branch = [
if (values.countposblocks < parameters.nr_totalpostrialblocks){ return block.pos}
else values.countposblocks = 0]
/ onblockend = [
values.trialimagepos = 0;
]
</block>

<trial regulationposone>
/ ontrialbegin = [
  trial.regulationposone.resetstimulusframes();
  values.fixationduration = round(rand(2100, 2900));
  values.blankduration = round(rand(400, 800));
    values.intialstrategy = round(rand(1, 2));
    trial.regulationposone.insertstimulustime(clearscreen, values.fixationduration);
  trial.regulationposone.insertstimulustime(text.initialstrategy, values.fixationduration);
  trial.regulationposone.insertstimulustime(clearscreen, values.fixationduration + 2500);
    trial.regulationposone.insertstimulustime(picture.pos, values.fixationduration + 2500 + values.blankduration); #selected high or low intensity image is inserted here#
  trial.regulationposone.insertstimulustime(clearscreen, values.fixationduration + 2500 + values.blankduration + 3000);
    ]
/ stimulustimes = [0=fixation;]
/ timeout = values.fixationduration + 2500 + values.blankduration + 3000
</trial>

<trial regulationpostwo>
/ ontrialbegin = [
  trial.regulationpostwo.resetstimulusframes();
  values.blankduration = round(rand(400, 800));
  trial.regulationpostwo.insertstimulustime(text.strategychoice, +0);
  trial.regulationpostwo.insertstimulustime(clearscreen, + 2000);
    trial.regulationpostwo.insertstimulustime(picture.pos, 2000 + values.blankduration); #trial two uses the same images as trial one#
  trial.regulationpostwo.insertstimulustime(clearscreen, 2000 + values.blankduration + 3000);
]
/ stimulustimes = [0=strategychoice;]
/ timeout = 2000 + values.blankduration + 3000
</trial>



GO

Merge Selected

Merge into selected topic...



Merge into merge target...



Merge into a specific topic ID...





Reading This Topic

Explore
Messages
Mentions
Search