12 set positions for images from a pool to appear at


Author
Message
carmen0101
carmen0101
Associate Member (252 reputation)Associate Member (252 reputation)Associate Member (252 reputation)Associate Member (252 reputation)Associate Member (252 reputation)Associate Member (252 reputation)Associate Member (252 reputation)Associate Member (252 reputation)Associate Member (252 reputation)
Group: Forum Members
Posts: 20, Visits: 96
Is it possible to set 12 image locations on a trial screen and then for the images to be randomly drawn from a pool of 50 images (e.g. my items WF_001 below).

I would also like the mean of the images randomly drawn out to be between 10-40 (e.g. image items: 5,2,5,40,41,9,11,45,50,7,26,25 = mean of 22.17)

I am hoping to achieve something visually ike this:


<item WF_001>
/1="morphs\WF_001_01.bmp"
/2="morphs\WF_001_02.bmp"
/3="morphs\WF_001_03.bmp"
/4="morphs\WF_001_04.bmp"
/5="morphs\WF_001_05.bmp"
/6="morphs\WF_001_06.bmp"
/7="morphs\WF_001_07.bmp"
/8="morphs\WF_001_08.bmp"
/9="morphs\WF_001_09.bmp"
/10="morphs\WF_001_10.bmp"
/11="morphs\WF_001_11.bmp"
/12="morphs\WF_001_12.bmp"
/13="morphs\WF_001_13.bmp"
/14="morphs\WF_001_14.bmp"
/15="morphs\WF_001_15.bmp"
/16="morphs\WF_001_16.bmp"
/17="morphs\WF_001_17.bmp"
/18="morphs\WF_001_18.bmp"
/19="morphs\WF_001_19.bmp"
/20="morphs\WF_001_20.bmp"
/21="morphs\WF_001_21.bmp"
/22="morphs\WF_001_22.bmp"
/23="morphs\WF_001_23.bmp"
/24="morphs\WF_001_24.bmp"
/25="morphs\WF_001_25.bmp"
/26="morphs\WF_001_26.bmp"
/27="morphs\WF_001_27.bmp"
/28="morphs\WF_001_28.bmp"
/29="morphs\WF_001_29.bmp"
/30="morphs\WF_001_30.bmp"
/31="morphs\WF_001_31.bmp"
/32="morphs\WF_001_32.bmp"
/33="morphs\WF_001_33.bmp"
/34="morphs\WF_001_34.bmp"
/35="morphs\WF_001_35.bmp"
/36="morphs\WF_001_36.bmp"
/37="morphs\WF_001_37.bmp"
/38="morphs\WF_001_38.bmp"
/39="morphs\WF_001_39.bmp"
/40="morphs\WF_001_40.bmp"
/41="morphs\WF_001_41.bmp"
/42="morphs\WF_001_42.bmp"
/43="morphs\WF_001_43.bmp"
/44="morphs\WF_001_44.bmp"
/45="morphs\WF_001_45.bmp"
/46="morphs\WF_001_46.bmp"
/47="morphs\WF_001_47.bmp"
/48="morphs\WF_001_48.bmp"
/49="morphs\WF_001_49.bmp"
/50="morphs\WF_001_50.bmp"
</item>

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: 105K
carmen0101 - 4/9/2020
Is it possible to set 12 image locations on a trial screen and then for the images to be randomly drawn from a pool of 50 images (e.g. my items WF_001 below).

I would also like the mean of the images randomly drawn out to be between 10-40 (e.g. image items: 5,2,5,40,41,9,11,45,50,7,26,25 = mean of 22.17)

I am hoping to achieve something visually ike this:


<item WF_001>
/1="morphs\WF_001_01.bmp"
/2="morphs\WF_001_02.bmp"
/3="morphs\WF_001_03.bmp"
/4="morphs\WF_001_04.bmp"
/5="morphs\WF_001_05.bmp"
/6="morphs\WF_001_06.bmp"
/7="morphs\WF_001_07.bmp"
/8="morphs\WF_001_08.bmp"
/9="morphs\WF_001_09.bmp"
/10="morphs\WF_001_10.bmp"
/11="morphs\WF_001_11.bmp"
/12="morphs\WF_001_12.bmp"
/13="morphs\WF_001_13.bmp"
/14="morphs\WF_001_14.bmp"
/15="morphs\WF_001_15.bmp"
/16="morphs\WF_001_16.bmp"
/17="morphs\WF_001_17.bmp"
/18="morphs\WF_001_18.bmp"
/19="morphs\WF_001_19.bmp"
/20="morphs\WF_001_20.bmp"
/21="morphs\WF_001_21.bmp"
/22="morphs\WF_001_22.bmp"
/23="morphs\WF_001_23.bmp"
/24="morphs\WF_001_24.bmp"
/25="morphs\WF_001_25.bmp"
/26="morphs\WF_001_26.bmp"
/27="morphs\WF_001_27.bmp"
/28="morphs\WF_001_28.bmp"
/29="morphs\WF_001_29.bmp"
/30="morphs\WF_001_30.bmp"
/31="morphs\WF_001_31.bmp"
/32="morphs\WF_001_32.bmp"
/33="morphs\WF_001_33.bmp"
/34="morphs\WF_001_34.bmp"
/35="morphs\WF_001_35.bmp"
/36="morphs\WF_001_36.bmp"
/37="morphs\WF_001_37.bmp"
/38="morphs\WF_001_38.bmp"
/39="morphs\WF_001_39.bmp"
/40="morphs\WF_001_40.bmp"
/41="morphs\WF_001_41.bmp"
/42="morphs\WF_001_42.bmp"
/43="morphs\WF_001_43.bmp"
/44="morphs\WF_001_44.bmp"
/45="morphs\WF_001_45.bmp"
/46="morphs\WF_001_46.bmp"
/47="morphs\WF_001_47.bmp"
/48="morphs\WF_001_48.bmp"
/49="morphs\WF_001_49.bmp"
/50="morphs\WF_001_50.bmp"
</item>

> Is it possible to set 12 image locations on a trial screen and then for the images to be randomly drawn from a pool of 50 images.

Yes, this is certainly possible. What about this is unclear to you?

> I would also like the mean of the images randomly drawn out to be between 10-40.

Put all item numbers in a <list>, /ontrialbegin, sample 12 items numbers from that list a put it in another list. Check that list's mean property. If the mean is not in the desired range, repeat the process.

<list allitems>
/ poolsize = 50
/ selectionrate = always
</list>

<list 12selecteditems>
/ selectionrate = always
</list>

<values>
/ success = false
</values>

<block example>
/ trials = [1-4 = select]
</block>

<trial select>
/ ontrialbegin = [
    values.success = false;
    list.allitems.reset();
    list.12selecteditems.reset();
    list.12selecteditems.appenditem(list.allitems.nextindex);
    list.12selecteditems.appenditem(list.allitems.nextindex);
    list.12selecteditems.appenditem(list.allitems.nextindex);
    list.12selecteditems.appenditem(list.allitems.nextindex);
    list.12selecteditems.appenditem(list.allitems.nextindex);
    list.12selecteditems.appenditem(list.allitems.nextindex);
    list.12selecteditems.appenditem(list.allitems.nextindex);
    list.12selecteditems.appenditem(list.allitems.nextindex);
    list.12selecteditems.appenditem(list.allitems.nextindex);
    list.12selecteditems.appenditem(list.allitems.nextindex);
    list.12selecteditems.appenditem(list.allitems.nextindex);
    list.12selecteditems.appenditem(list.allitems.nextindex);
    if (list.12selecteditems.mean >= 10 && list.12selecteditems.mean <= 40) {
        values.success = true;
    };
]
/ branch = [
    if (values.success) {
        return trial.showselection;
    } else return trial.select;
]
/ trialduration = 0
/ recorddata = false
</trial>

<trial showselection>
/ stimulusframes = [1=selection]
/ validresponse = (57)
</trial>

<text selection>
/ items = ("Selected item numbers:
<%list.12selecteditems.item(1)%>, <%list.12selecteditems.item(2)%>, <%list.12selecteditems.item(3)%>, <%list.12selecteditems.item(4)%>,
<%list.12selecteditems.item(5)%>, <%list.12selecteditems.item(6)%>, <%list.12selecteditems.item(7)%>, <%list.12selecteditems.item(8)%>,
<%list.12selecteditems.item(9)%>, <%list.12selecteditems.item(10)%>, <%list.12selecteditems.item(11)%>, <%list.12selecteditems.item(12)%>
Mean: <%list.12selecteditems.mean%>")
/ size = (80%, 50%)
</text>



carmen0101
carmen0101
Associate Member (252 reputation)Associate Member (252 reputation)Associate Member (252 reputation)Associate Member (252 reputation)Associate Member (252 reputation)Associate Member (252 reputation)Associate Member (252 reputation)Associate Member (252 reputation)Associate Member (252 reputation)
Group: Forum Members
Posts: 20, Visits: 96
Hi Dave, thank you for your advice. It gave me great start. 

I have fiddled with your suggestions and coding and I am struggling to get the <list 12selecteditems> to randomly pull from my picture pool of 50. How do I link it?

<item practice_WM>
/1="morphs\practice_WM\practice_WM_01.bmp"
/2="morphs\practice_WM\practice_WM_02.bmp"
/3="morphs\practice_WM\practice_WM_03.bmp"
/4="morphs\practice_WM\practice_WM_04.bmp"
/5="morphs\practice_WM\practice_WM_05.bmp"
/6="morphs\practice_WM\practice_WM_06.bmp"
/7="morphs\practice_WM\practice_WM_07.bmp"
/8="morphs\practice_WM\practice_WM_08.bmp"
/9="morphs\practice_WM\practice_WM_09.bmp"
/10="morphs\practice_WM\practice_WM_10.bmp"
/11="morphs\practice_WM\practice_WM_11.bmp"
/12="morphs\practice_WM\practice_WM_12.bmp"
/13="morphs\practice_WM\practice_WM_13.bmp"
/14="morphs\practice_WM\practice_WM_14.bmp"
/15="morphs\practice_WM\practice_WM_15.bmp"
/16="morphs\practice_WM\practice_WM_16.bmp"
/17="morphs\practice_WM\practice_WM_17.bmp"
/18="morphs\practice_WM\practice_WM_18.bmp"
/19="morphs\practice_WM\practice_WM_19.bmp"
/20="morphs\practice_WM\practice_WM_20.bmp"
/21="morphs\practice_WM\practice_WM_21.bmp"
/22="morphs\practice_WM\practice_WM_22.bmp"
/23="morphs\practice_WM\practice_WM_23.bmp"
/24="morphs\practice_WM\practice_WM_24.bmp"
/25="morphs\practice_WM\practice_WM_25.bmp"
/26="morphs\practice_WM\practice_WM_26.bmp"
/27="morphs\practice_WM\practice_WM_27.bmp"
/28="morphs\practice_WM\practice_WM_28.bmp"
/29="morphs\practice_WM\practice_WM_29.bmp"
/30="morphs\practice_WM\practice_WM_30.bmp"
/31="morphs\practice_WM\practice_WM_31.bmp"
/32="morphs\practice_WM\practice_WM_32.bmp"
/33="morphs\practice_WM\practice_WM_33.bmp"
/34="morphs\practice_WM\practice_WM_34.bmp"
/35="morphs\practice_WM\practice_WM_35.bmp"
/36="morphs\practice_WM\practice_WM_36.bmp"
/37="morphs\practice_WM\practice_WM_37.bmp"
/38="morphs\practice_WM\practice_WM_38.bmp"
/39="morphs\practice_WM\practice_WM_39.bmp"
/40="morphs\practice_WM\practice_WM_40.bmp"
/41="morphs\practice_WM\practice_WM_41.bmp"
/42="morphs\practice_WM\practice_WM_42.bmp"
/43="morphs\practice_WM\practice_WM_43.bmp"
/44="morphs\practice_WM\practice_WM_44.bmp"
/45="morphs\practice_WM\practice_WM_45.bmp"
/46="morphs\practice_WM\practice_WM_46.bmp"
/47="morphs\practice_WM\practice_WM_47.bmp"
/48="morphs\practice_WM\practice_WM_48.bmp"
/49="morphs\practice_WM\practice_WM_49.bmp"
/50="morphs\practice_WM\practice_WM_50.bmp"
</item>

<list allitems>
/ items = (item.practice_WM)
/ poolsize = 50
/ selectionrate = always
</list>

<list 12selecteditems>
/ selectionrate = always
</list>

<values>
/ success = false
/crowd_actual_mean =0
</values>

<picture practice_WM>
/items = practice_WM
/select =replace
/size = (80%, 80%)
</picture>

<counter counterpractice_WM>
/ select = replace (1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50)
/ selectionrate = always
</counter>

<picture crowdpractice_WM_1>
/ items = practice_WM
/ position = (20%, 65%)
/ select = counter.counterpractice_WM
/size = (20%, 20%)
</picture>

<picture crowdpractice_WM_2>
/ items = practice_WM
/ position = (20%, 35%)
/ select = counter.counterpractice_WM
/size = (20%, 20%)
</picture>

<picture crowdpractice_WM_3>
/ items = practice_WM
/ position = (35%, 80%)
/ select = counter.counterpractice_WM
/size = (20%, 20%)
</picture>

<picture crowdpractice_WM_4>
/ items = practice_WM
/ position = (35%, 50%)
/ select = counter.counterpractice_WM
/size = (20%, 20%)
</picture>

<picture crowdpractice_WM_5>
/ items = practice_WM
/ position = (35%, 20%)
/ select = counter.counterpractice_WM
/size = (20%, 20%)
</picture>

<picture crowdpractice_WM_6>
/ items = practice_WM
/ position = (50%, 65%)
/ select = counter.counterpractice_WM
/size = (20%, 20%)
</picture>

<picture crowdpractice_WM_7>
/ items = practice_WM
/ position = (50%, 35%)
/ select = counter.counterpractice_WM
/size = (20%, 20%)
</picture>

<picture crowdpractice_WM_8>
/ items = practice_WM
/ position = (65%, 80%)
/ select = counter.counterpractice_WM
/size = (20%, 20%)
</picture>

<picture crowdpractice_WM_9>
/ items = practice_WM
/ position = (65%, 50%)
/ select = counter.counterpractice_WM
/size = (20%, 20%)
</picture>

<picture crowdpractice_WM_10>
/ items = practice_WM
/ position = (65%, 20%)
/ select = counter.counterpractice_WM
/size = (20%, 20%)
</picture>

<picture crowdpractice_WM_11>
/ items = practice_WM
/ position = (80%, 65%)
/ select = counter.counterpractice_WM
/size = (20%, 20%)
</picture>

<picture crowdpractice_WM_12>
/ items = practice_WM
/ position = (80%, 35%)
/ select = counter.counterpractice_WM
/size = (20%, 20%)
</picture>


<trial crowd_practiceWM>
/ stimulusframes = [1=crowdpractice_WM_1, crowdpractice_WM_2, crowdpractice_WM_3, crowdpractice_WM_4, crowdpractice_WM_5, crowdpractice_WM_6,
crowdpractice_WM_7, crowdpractice_WM_8, crowdpractice_WM_9, crowdpractice_WM_10, crowdpractice_WM_11, crowdpractice_WM_12]
/ ontrialbegin = [
  values.success = false;
  list.allitems.reset();
  list.12selecteditems.reset();
  list.12selecteditems.appenditem(list.allitems.nextindex);
  list.12selecteditems.appenditem(list.allitems.nextindex);
  list.12selecteditems.appenditem(list.allitems.nextindex);
  list.12selecteditems.appenditem(list.allitems.nextindex);
  list.12selecteditems.appenditem(list.allitems.nextindex);
  list.12selecteditems.appenditem(list.allitems.nextindex);
  list.12selecteditems.appenditem(list.allitems.nextindex);
  list.12selecteditems.appenditem(list.allitems.nextindex);
  list.12selecteditems.appenditem(list.allitems.nextindex);
  list.12selecteditems.appenditem(list.allitems.nextindex);
  list.12selecteditems.appenditem(list.allitems.nextindex);
  list.12selecteditems.appenditem(list.allitems.nextindex);
  if (list.12selecteditems.mean >= 10 && list.12selecteditems.mean <= 40) {
   values.success = true;
  }; values.crowd_actual_mean=list.12selecteditems.mean
]
/ timeout = 5000
</trial>

<trial showselection>
/ stimulusframes = [1=selection]
/ validresponse = (57)
</trial>

<text selection>
/ items = ("Selected item numbers:
<%list.12selecteditems.item(1)%>, <%list.12selecteditems.item(2)%>, <%list.12selecteditems.item(3)%>, <%list.12selecteditems.item(4)%>,
<%list.12selecteditems.item(5)%>, <%list.12selecteditems.item(6)%>, <%list.12selecteditems.item(7)%>, <%list.12selecteditems.item(8)%>,
<%list.12selecteditems.item(9)%>, <%list.12selecteditems.item(10)%>, <%list.12selecteditems.item(11)%>, <%list.12selecteditems.item(12)%>
Mean: <%list.12selecteditems.mean%>")
/ size = (80%, 50%)
</text>

<data>
/ columns = (build, computer.platform, date, time, subject, group, script.sessionid, blockcode, blocknum,
trialcode, values.crowd_actual_mean,stimulusitem, stimulusnumber, stimulusitem, stimulusnumber, stimulusitem, stimulusnumber, stimulusitem, stimulusnumber, stimulusitem, stimulusnumber,
stimulusitem, stimulusnumber, stimulusitem, stimulusnumber, stimulusitem, stimulusnumber, stimulusitem, stimulusnumber,
stimulusitem, stimulusnumber, stimulusitem, stimulusnumber, stimulusitem, stimulusnumber)
</data>
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: 105K
carmen0101 - 4/15/2020
Hi Dave, thank you for your advice. It gave me great start. 

I have fiddled with your suggestions and coding and I am struggling to get the <list 12selecteditems> to randomly pull from my picture pool of 50. How do I link it?

<item practice_WM>
/1="morphs\practice_WM\practice_WM_01.bmp"
/2="morphs\practice_WM\practice_WM_02.bmp"
/3="morphs\practice_WM\practice_WM_03.bmp"
/4="morphs\practice_WM\practice_WM_04.bmp"
/5="morphs\practice_WM\practice_WM_05.bmp"
/6="morphs\practice_WM\practice_WM_06.bmp"
/7="morphs\practice_WM\practice_WM_07.bmp"
/8="morphs\practice_WM\practice_WM_08.bmp"
/9="morphs\practice_WM\practice_WM_09.bmp"
/10="morphs\practice_WM\practice_WM_10.bmp"
/11="morphs\practice_WM\practice_WM_11.bmp"
/12="morphs\practice_WM\practice_WM_12.bmp"
/13="morphs\practice_WM\practice_WM_13.bmp"
/14="morphs\practice_WM\practice_WM_14.bmp"
/15="morphs\practice_WM\practice_WM_15.bmp"
/16="morphs\practice_WM\practice_WM_16.bmp"
/17="morphs\practice_WM\practice_WM_17.bmp"
/18="morphs\practice_WM\practice_WM_18.bmp"
/19="morphs\practice_WM\practice_WM_19.bmp"
/20="morphs\practice_WM\practice_WM_20.bmp"
/21="morphs\practice_WM\practice_WM_21.bmp"
/22="morphs\practice_WM\practice_WM_22.bmp"
/23="morphs\practice_WM\practice_WM_23.bmp"
/24="morphs\practice_WM\practice_WM_24.bmp"
/25="morphs\practice_WM\practice_WM_25.bmp"
/26="morphs\practice_WM\practice_WM_26.bmp"
/27="morphs\practice_WM\practice_WM_27.bmp"
/28="morphs\practice_WM\practice_WM_28.bmp"
/29="morphs\practice_WM\practice_WM_29.bmp"
/30="morphs\practice_WM\practice_WM_30.bmp"
/31="morphs\practice_WM\practice_WM_31.bmp"
/32="morphs\practice_WM\practice_WM_32.bmp"
/33="morphs\practice_WM\practice_WM_33.bmp"
/34="morphs\practice_WM\practice_WM_34.bmp"
/35="morphs\practice_WM\practice_WM_35.bmp"
/36="morphs\practice_WM\practice_WM_36.bmp"
/37="morphs\practice_WM\practice_WM_37.bmp"
/38="morphs\practice_WM\practice_WM_38.bmp"
/39="morphs\practice_WM\practice_WM_39.bmp"
/40="morphs\practice_WM\practice_WM_40.bmp"
/41="morphs\practice_WM\practice_WM_41.bmp"
/42="morphs\practice_WM\practice_WM_42.bmp"
/43="morphs\practice_WM\practice_WM_43.bmp"
/44="morphs\practice_WM\practice_WM_44.bmp"
/45="morphs\practice_WM\practice_WM_45.bmp"
/46="morphs\practice_WM\practice_WM_46.bmp"
/47="morphs\practice_WM\practice_WM_47.bmp"
/48="morphs\practice_WM\practice_WM_48.bmp"
/49="morphs\practice_WM\practice_WM_49.bmp"
/50="morphs\practice_WM\practice_WM_50.bmp"
</item>

<list allitems>
/ items = (item.practice_WM)
/ poolsize = 50
/ selectionrate = always
</list>

<list 12selecteditems>
/ selectionrate = always
</list>

<values>
/ success = false
/crowd_actual_mean =0
</values>

<picture practice_WM>
/items = practice_WM
/select =replace
/size = (80%, 80%)
</picture>

<counter counterpractice_WM>
/ select = replace (1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50)
/ selectionrate = always
</counter>

<picture crowdpractice_WM_1>
/ items = practice_WM
/ position = (20%, 65%)
/ select = counter.counterpractice_WM
/size = (20%, 20%)
</picture>

<picture crowdpractice_WM_2>
/ items = practice_WM
/ position = (20%, 35%)
/ select = counter.counterpractice_WM
/size = (20%, 20%)
</picture>

<picture crowdpractice_WM_3>
/ items = practice_WM
/ position = (35%, 80%)
/ select = counter.counterpractice_WM
/size = (20%, 20%)
</picture>

<picture crowdpractice_WM_4>
/ items = practice_WM
/ position = (35%, 50%)
/ select = counter.counterpractice_WM
/size = (20%, 20%)
</picture>

<picture crowdpractice_WM_5>
/ items = practice_WM
/ position = (35%, 20%)
/ select = counter.counterpractice_WM
/size = (20%, 20%)
</picture>

<picture crowdpractice_WM_6>
/ items = practice_WM
/ position = (50%, 65%)
/ select = counter.counterpractice_WM
/size = (20%, 20%)
</picture>

<picture crowdpractice_WM_7>
/ items = practice_WM
/ position = (50%, 35%)
/ select = counter.counterpractice_WM
/size = (20%, 20%)
</picture>

<picture crowdpractice_WM_8>
/ items = practice_WM
/ position = (65%, 80%)
/ select = counter.counterpractice_WM
/size = (20%, 20%)
</picture>

<picture crowdpractice_WM_9>
/ items = practice_WM
/ position = (65%, 50%)
/ select = counter.counterpractice_WM
/size = (20%, 20%)
</picture>

<picture crowdpractice_WM_10>
/ items = practice_WM
/ position = (65%, 20%)
/ select = counter.counterpractice_WM
/size = (20%, 20%)
</picture>

<picture crowdpractice_WM_11>
/ items = practice_WM
/ position = (80%, 65%)
/ select = counter.counterpractice_WM
/size = (20%, 20%)
</picture>

<picture crowdpractice_WM_12>
/ items = practice_WM
/ position = (80%, 35%)
/ select = counter.counterpractice_WM
/size = (20%, 20%)
</picture>


<trial crowd_practiceWM>
/ stimulusframes = [1=crowdpractice_WM_1, crowdpractice_WM_2, crowdpractice_WM_3, crowdpractice_WM_4, crowdpractice_WM_5, crowdpractice_WM_6,
crowdpractice_WM_7, crowdpractice_WM_8, crowdpractice_WM_9, crowdpractice_WM_10, crowdpractice_WM_11, crowdpractice_WM_12]
/ ontrialbegin = [
  values.success = false;
  list.allitems.reset();
  list.12selecteditems.reset();
  list.12selecteditems.appenditem(list.allitems.nextindex);
  list.12selecteditems.appenditem(list.allitems.nextindex);
  list.12selecteditems.appenditem(list.allitems.nextindex);
  list.12selecteditems.appenditem(list.allitems.nextindex);
  list.12selecteditems.appenditem(list.allitems.nextindex);
  list.12selecteditems.appenditem(list.allitems.nextindex);
  list.12selecteditems.appenditem(list.allitems.nextindex);
  list.12selecteditems.appenditem(list.allitems.nextindex);
  list.12selecteditems.appenditem(list.allitems.nextindex);
  list.12selecteditems.appenditem(list.allitems.nextindex);
  list.12selecteditems.appenditem(list.allitems.nextindex);
  list.12selecteditems.appenditem(list.allitems.nextindex);
  if (list.12selecteditems.mean >= 10 && list.12selecteditems.mean <= 40) {
   values.success = true;
  }; values.crowd_actual_mean=list.12selecteditems.mean
]
/ timeout = 5000
</trial>

<trial showselection>
/ stimulusframes = [1=selection]
/ validresponse = (57)
</trial>

<text selection>
/ items = ("Selected item numbers:
<%list.12selecteditems.item(1)%>, <%list.12selecteditems.item(2)%>, <%list.12selecteditems.item(3)%>, <%list.12selecteditems.item(4)%>,
<%list.12selecteditems.item(5)%>, <%list.12selecteditems.item(6)%>, <%list.12selecteditems.item(7)%>, <%list.12selecteditems.item(8)%>,
<%list.12selecteditems.item(9)%>, <%list.12selecteditems.item(10)%>, <%list.12selecteditems.item(11)%>, <%list.12selecteditems.item(12)%>
Mean: <%list.12selecteditems.mean%>")
/ size = (80%, 50%)
</text>

<data>
/ columns = (build, computer.platform, date, time, subject, group, script.sessionid, blockcode, blocknum,
trialcode, values.crowd_actual_mean,stimulusitem, stimulusnumber, stimulusitem, stimulusnumber, stimulusitem, stimulusnumber, stimulusitem, stimulusnumber, stimulusitem, stimulusnumber,
stimulusitem, stimulusnumber, stimulusitem, stimulusnumber, stimulusitem, stimulusnumber, stimulusitem, stimulusnumber,
stimulusitem, stimulusnumber, stimulusitem, stimulusnumber, stimulusitem, stimulusnumber)
</data>

You use the list 12selecteditems in the picture elements' /select
carmen0101
carmen0101
Associate Member (252 reputation)Associate Member (252 reputation)Associate Member (252 reputation)Associate Member (252 reputation)Associate Member (252 reputation)Associate Member (252 reputation)Associate Member (252 reputation)Associate Member (252 reputation)Associate Member (252 reputation)
Group: Forum Members
Posts: 20, Visits: 96
Thanks Dave, that definitely helped! I am having trouble with the data values. I would like it so that when an alcohol images is shown, the data value to be recorded as 1 and is it if is a neutral drink to be recorded as 0. Following is the coding and right now regardless of the image randomly shown at 0ms, it is being recorded as drink =1. How do I change the if and else sectionf under the <trial>?

<data>
/ columns = (build, computer.platform, date, time, subject, group, script.sessionid, blockcode, blocknum,
trialcode, values.drink, values.actual_crowd_mean, slider.Angerscale.response, values.crowdgender
stimulusnumber, stimulusitem, stimulusnumber, stimulusitem, stimulusnumber, stimulusitem, stimulusnumber, stimulusitem, stimulusnumber,
stimulusitem, stimulusnumber, stimulusitem, stimulusnumber, stimulusitem, stimulusnumber, stimulusitem, stimulusnumber,
stimulusitem, stimulusnumber, stimulusitem, stimulusnumber, stimulusitem, stimulusnumber, stimulusitem)
</data>

<values>
/ success = false
/stimulusitems = ""
/sum_of_anger = 0
/actual_crowd_mean =0
/drink = 0
/crowdgender =0
</values>

<trial mixed1>
/stimulustimes = [0=noreplacenorepeat(picture.Neutraldrinks,picture.Alcoholdrinks); 1700=blank; 1800=mixed1_postion1, mixed1_postion2,
mixed1_postion3, mixed1_postion4, mixed1_postion5, mixed1_postion6,
mixed1_postion7, mixed1_postion8, mixed1_postion9, mixed1_postion10, mixed1_postion11,
mixed1_postion12; 3800=blank; 3900=noreplace(picture.maskmixed1)]
/ ontrialbegin = [picture.mixed1_postion1.currentitemnumber;picture.mixed1_postion2.currentitemnumber; picture.mixed1_postion3.currentitemnumber;
picture.mixed1_postion4.currentitemnumber;picture.mixed1_postion5.currentitemnumber; picture.mixed1_postion6.currentitemnumber;
picture.mixed1_postion7.currentitemnumber; picture.mixed1_postion8.currentitemnumber; picture.mixed1_postion9.currentitemnumber;
picture.mixed1_postion10.currentitemnumber; picture.mixed1_postion11.currentitemnumber; picture.mixed1_postion12.currentitemnumber;
  values.success = false;
  list.mixed1.reset();
  list.12selecteditems.reset();
      list.12selecteditems.appenditem(list.mixed1.nextindex);
  list.12selecteditems.appenditem(list.mixed1.nextindex);
  list.12selecteditems.appenditem(list.mixed1.nextindex);
  list.12selecteditems.appenditem(list.mixed1.nextindex);
  list.12selecteditems.appenditem(list.mixed1.nextindex);
  list.12selecteditems.appenditem(list.mixed1.nextindex);
  list.12selecteditems.appenditem(list.mixed1.nextindex);
  list.12selecteditems.appenditem(list.mixed1.nextindex);
  list.12selecteditems.appenditem(list.mixed1.nextindex);
  list.12selecteditems.appenditem(list.mixed1.nextindex);
  list.12selecteditems.appenditem(list.mixed1.nextindex);
  list.12selecteditems.appenditem(list.mixed1.nextindex);
  if (list.12selecteditems.mean >= 10 && list.12selecteditems.mean <= 40) {
   values.success = true;
  } values.actual_crowd_mean=list.12selecteditems.mean;
    if (picture.Neutraldrinks){values.drink=0};
    if (picture.Alcoholdrinks){values.drink=1};

    values.crowdgender=3]
/ timeout = 5000
/ recorddata = true
</trial>
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: 105K
carmen0101 - 4/27/2020
Thanks Dave, that definitely helped! I am having trouble with the data values. I would like it so that when an alcohol images is shown, the data value to be recorded as 1 and is it if is a neutral drink to be recorded as 0. Following is the coding and right now regardless of the image randomly shown at 0ms, it is being recorded as drink =1. How do I change the if and else sectionf under the <trial>?

<data>
/ columns = (build, computer.platform, date, time, subject, group, script.sessionid, blockcode, blocknum,
trialcode, values.drink, values.actual_crowd_mean, slider.Angerscale.response, values.crowdgender
stimulusnumber, stimulusitem, stimulusnumber, stimulusitem, stimulusnumber, stimulusitem, stimulusnumber, stimulusitem, stimulusnumber,
stimulusitem, stimulusnumber, stimulusitem, stimulusnumber, stimulusitem, stimulusnumber, stimulusitem, stimulusnumber,
stimulusitem, stimulusnumber, stimulusitem, stimulusnumber, stimulusitem, stimulusnumber, stimulusitem)
</data>

<values>
/ success = false
/stimulusitems = ""
/sum_of_anger = 0
/actual_crowd_mean =0
/drink = 0
/crowdgender =0
</values>

<trial mixed1>
/stimulustimes = [0=noreplacenorepeat(picture.Neutraldrinks,picture.Alcoholdrinks); 1700=blank; 1800=mixed1_postion1, mixed1_postion2,
mixed1_postion3, mixed1_postion4, mixed1_postion5, mixed1_postion6,
mixed1_postion7, mixed1_postion8, mixed1_postion9, mixed1_postion10, mixed1_postion11,
mixed1_postion12; 3800=blank; 3900=noreplace(picture.maskmixed1)]
/ ontrialbegin = [picture.mixed1_postion1.currentitemnumber;picture.mixed1_postion2.currentitemnumber; picture.mixed1_postion3.currentitemnumber;
picture.mixed1_postion4.currentitemnumber;picture.mixed1_postion5.currentitemnumber; picture.mixed1_postion6.currentitemnumber;
picture.mixed1_postion7.currentitemnumber; picture.mixed1_postion8.currentitemnumber; picture.mixed1_postion9.currentitemnumber;
picture.mixed1_postion10.currentitemnumber; picture.mixed1_postion11.currentitemnumber; picture.mixed1_postion12.currentitemnumber;
  values.success = false;
  list.mixed1.reset();
  list.12selecteditems.reset();
      list.12selecteditems.appenditem(list.mixed1.nextindex);
  list.12selecteditems.appenditem(list.mixed1.nextindex);
  list.12selecteditems.appenditem(list.mixed1.nextindex);
  list.12selecteditems.appenditem(list.mixed1.nextindex);
  list.12selecteditems.appenditem(list.mixed1.nextindex);
  list.12selecteditems.appenditem(list.mixed1.nextindex);
  list.12selecteditems.appenditem(list.mixed1.nextindex);
  list.12selecteditems.appenditem(list.mixed1.nextindex);
  list.12selecteditems.appenditem(list.mixed1.nextindex);
  list.12selecteditems.appenditem(list.mixed1.nextindex);
  list.12selecteditems.appenditem(list.mixed1.nextindex);
  list.12selecteditems.appenditem(list.mixed1.nextindex);
  if (list.12selecteditems.mean >= 10 && list.12selecteditems.mean <= 40) {
   values.success = true;
  } values.actual_crowd_mean=list.12selecteditems.mean;
    if (picture.Neutraldrinks){values.drink=0};
    if (picture.Alcoholdrinks){values.drink=1};

    values.crowdgender=3]
/ timeout = 5000
/ recorddata = true
</trial>

The bolded part is invalid syntax. It will not do anything.



You should not use selectionmodes in /stimulustimes.

<trial mixed1>
/stimulustimes = [0=noreplacenorepeat(picture.Neutraldrinks,picture.Alcoholdrinks);...]
...
</trial>

Instead either set up separate trials for neutral and alcohol, or -- if need be -- sample the picture element from a <list> and use insertstimulustime(). You can then sent the value of interest based on the list's current index.
GO

Merge Selected

Merge into selected topic...



Merge into merge target...



Merge into a specific topic ID...




Reading This Topic

Explore
Messages
Mentions
Search