Randomly assing to /items property of pictures


Author
Message
Chris-AT
Chris-AT
Respected Member (490 reputation)Respected Member (490 reputation)Respected Member (490 reputation)Respected Member (490 reputation)Respected Member (490 reputation)Respected Member (490 reputation)Respected Member (490 reputation)Respected Member (490 reputation)Respected Member (490 reputation)
Group: Forum Members
Posts: 2, Visits: 7
Dear Users,

I am trying to assign randomly an <item> element 
I defined to the pictures /items elemend. The idea is that there are 4 different picture sets (PicsTwentyFour_1 etc.) and those sets should be presented randomly (noreplace) in each of the 4 trials. I thought about creating an <item> element and define the <item> pictures in there (see <item sets>), but I get the error:
"missing double quotes". Is there any way to randomly assign an <item> element to the /items property of the pictures?

The full code is below

<values>
/ current_trial = 0
/ answer_filename = ""
/ condition = 0
/ current_set = 0
</values>

<data>
/ columns = (script.subjectid, script.groupid, values.condition, values.answer_filename, values.current_trial, trial.TrialSix.latency, trial.TrialTwentyFour.latency)
</data>

<expt assignment>
/ subjects = (1 of 1)
/ blocks = [1=assignment]
</expt>

<instruct>
/ windowsize = (70%,70%)
/ prevlabel = (" ")
/ nextkey = (" ")
/ lastlabel = "Klicken Sie hier, um fortzufahren"
/ nextlabel = "Klicken Sie hier, um fortzufahren"
/ fontstyle = ("Arial", 2.5%, false, false, false, false, 5, 0)
/ inputdevice = mouse
</instruct>

<block assignment>
/ preinstructions = (page.pre_page)
/ branch = [
    if (script.groupid == 1) block.BlSix
]

/ branch = [
    if (script.groupid == 2) block.BlTwentyFour
]
</block>


<block BlSix>
/ onblockbegin = [
    values.condition = 1;
]
/ trials = [1 = trial.TrClick; 2 = trial.TrialSix;
 3 = trial.TrClick; 4 = trial.TrialSix; 5 = trial.TrClick; 6 = trial.TrialSix; 7 = trial.TrClick; 8 = trial.TrialSix]
</block>

<block BlTwentyFour>
/ onblockbegin = [
    values.condition = 2;
]
/ trials = [1 = trial.TrClick; 2 = trial.TrialTwentyFour; 3 = trial.TrClick; 4 = trial.TrialTwentyFour; 5 = trial.TrClick; 6 = trial.TrialTwentyFour; 7 = trial.TrClick; 8 = trial.TrialTwentyFour]
</block>

<trial TrialSix>
/ stimulusframes = [1 = picture.PSix_1, picture.PSix_2, picture.PSix_3, picture.PSix_4, picture.PSix_5, picture.PSix_6]
/ validresponse = (picture.PSix_1, picture.PSix_2, picture.PSix_3, picture.PSix_4, picture.PSix_5, picture.PSix_6)
/ inputdevice = mouse
/ ontrialend = [
   
    if(trial.TrialSix.response == "PSix_1") {
        values.answer_filename = picture.PSix_1.currentitem;
    }
    else if(trial.TrialSix.response == "PSix_2") {
        values.answer_filename = picture.PSix_2.currentitem;
    }
    else if(trial.TrialSix.response == "PSix_3") {
        values.answer_filename = picture.PSix_3.currentitem;
    }
    else if(trial.TrialSix.response == "PSix_4") {
        values.answer_filename = picture.PSix_4.currentitem;
    }
    else if(trial.TrialSix.response == "PSix_5") {
        values.answer_filename = picture.PSix_5.currentitem;
    }
    else if(trial.TrialSix.response == "PSix_6") {
        values.answer_filename = picture.PSix_6.currentitem;
    }
]
</trial>

<trial TrialTwentyFour>
/ stimulusframes = [1 =
picture.PTwentyFour_1,
picture.PTwentyFour_2,
picture.PTwentyFour_3,
picture.PTwentyFour_4,
picture.PTwentyFour_5,
picture.PTwentyFour_6,
picture.PTwentyFour_7,
picture.PTwentyFour_8,
picture.PTwentyFour_9,
picture.PTwentyFour_10,
picture.PTwentyFour_11,
picture.PTwentyFour_12,
picture.PTwentyFour_13,
picture.PTwentyFour_14,
picture.PTwentyFour_15,
picture.PTwentyFour_16,
picture.PTwentyFour_17,
picture.PTwentyFour_18,
picture.PTwentyFour_19,
picture.PTwentyFour_20,
picture.PTwentyFour_21,
picture.PTwentyFour_22,
picture.PTwentyFour_23,
picture.PTwentyFour_24]
/ validresponse = (
picture.PTwentyFour_1,
picture.PTwentyFour_2,
picture.PTwentyFour_3,
picture.PTwentyFour_4,
picture.PTwentyFour_5,
picture.PTwentyFour_6,
picture.PTwentyFour_7,
picture.PTwentyFour_8,
picture.PTwentyFour_9,
picture.PTwentyFour_10,
picture.PTwentyFour_11,
picture.PTwentyFour_12,
picture.PTwentyFour_13,
picture.PTwentyFour_14,
picture.PTwentyFour_15,
picture.PTwentyFour_16,
picture.PTwentyFour_17,
picture.PTwentyFour_18,
picture.PTwentyFour_19,
picture.PTwentyFour_20,
picture.PTwentyFour_21,
picture.PTwentyFour_22,
picture.PTwentyFour_23,
picture.PTwentyFour_24)
/ inputdevice = mouse
/ ontrialend = [
   
    if(trial.TrialTwentyFour.response == "PTwentyFour_1") {
        values.answer_filename = picture.PTwentyFour_1.currentitem;
    }
    else if(trial.TrialTwentyFour.response == "PTwentyFour_2") {
        values.answer_filename = picture.PTwentyFour_2.currentitem;
    }
    else if(trial.TrialTwentyFour.response == "PTwentyFour_3") {
        values.answer_filename = picture.PTwentyFour_3.currentitem;
    }
    else if(trial.TrialTwentyFour.response == "PTwentyFour_4") {
        values.answer_filename = picture.PTwentyFour_4.currentitem;
    }
    else if(trial.TrialTwentyFour.response == "PTwentyFour_5") {
        values.answer_filename = picture.PTwentyFour_5.currentitem;
    }
    else if(trial.TrialTwentyFour.response == "PTwentyFour_6") {
        values.answer_filename = picture.PTwentyFour_6.currentitem;
    }
    else if(trial.TrialTwentyFour.response == "PTwentyFour_7") {
        values.answer_filename = picture.PTwentyFour_7.currentitem;
    }
    else if(trial.TrialTwentyFour.response == "PTwentyFour_8") {
        values.answer_filename = picture.PTwentyFour_8.currentitem;
    }
    else if(trial.TrialTwentyFour.response == "PTwentyFour_9") {
        values.answer_filename = picture.PTwentyFour_9.currentitem;
    }
    else if(trial.TrialTwentyFour.response == "PTwentyFour_10") {
        values.answer_filename = picture.PTwentyFour_10.currentitem;
    }
    else if(trial.TrialTwentyFour.response == "PTwentyFour_11") {
        values.answer_filename = picture.PTwentyFour_11.currentitem;
    }
    else if(trial.TrialTwentyFour.response == "PTwentyFour_12") {
        values.answer_filename = picture.PTwentyFour_12.currentitem;
    }
    else if(trial.TrialTwentyFour.response == "PTwentyFour_13") {
        values.answer_filename = picture.PTwentyFour_13.currentitem;
    }
    else if(trial.TrialTwentyFour.response == "PTwentyFour_14") {
        values.answer_filename = picture.PTwentyFour_14.currentitem;
    }
    else if(trial.TrialTwentyFour.response == "PTwentyFour_15") {
        values.answer_filename = picture.PTwentyFour_15.currentitem;
    }
    else if(trial.TrialTwentyFour.response == "PTwentyFour_16") {
        values.answer_filename = picture.PTwentyFour_16.currentitem;
    }
    else if(trial.TrialTwentyFour.response == "PTwentyFour_17") {
        values.answer_filename = picture.PTwentyFour_17.currentitem;
    }
    else if(trial.TrialTwentyFour.response == "PTwentyFour_18") {
        values.answer_filename = picture.PTwentyFour_18.currentitem;
    }
    else if(trial.TrialTwentyFour.response == "PTwentyFour_19") {
        values.answer_filename = picture.PTwentyFour_19.currentitem;
    }
    else if(trial.TrialTwentyFour.response == "PTwentyFour_20") {
        values.answer_filename = picture.PTwentyFour_20.currentitem;
    }
    else if(trial.TrialTwentyFour.response == "PTwentyFour_21") {
        values.answer_filename = picture.PTwentyFour_21.currentitem;
    }
    else if(trial.TrialTwentyFour.response == "PTwentyFour_22") {
        values.answer_filename = picture.PTwentyFour_22.currentitem;
    }
    else if(trial.TrialTwentyFour.response == "PTwentyFour_23") {
        values.answer_filename = picture.PTwentyFour_23.currentitem;
    }
    else if(trial.TrialTwentyFour.response == "PTwentyFour_24") {
        values.answer_filename = picture.PTwentyFour_24.currentitem;
    }
]
</trial>

<trial TrClick>
/ stimulusframes = [1 = shape.ShClick, text.TeClickOnShape]
/ validresponse = (shape.ShClick)
/ inputdevice = mouse
/ ontrialbegin = [
        values.current_trial += 1;
        values.answer_filename = "";
]
</trial>


###########################################
Picture Sets for Condition with 6 Pictures
###########################################
<picture PSix_1>
/ items = item.PicsSix
/ select = counter.PicSelectorSix.selectedvalue
/ position = (20%,25%)
</picture>

<picture PSix_2>
/ items = item.PicsSix
/ select = counter.PicSelectorSix.selectedvalue
/ position = (40%,25%)
</picture>

<picture PSix_3>
/ items = item.PicsSix
/ select = counter.PicSelectorSix.selectedvalue
/ position = (60%,25%)
</picture>

<picture PSix_4>
/ items = item.PicsSix
/ select = counter.PicSelectorSix.selectedvalue
/ position = (20%,50%)
</picture>

<picture PSix_5>
/ items = item.PicsSix
/ select = counter.PicSelectorSix.selectedvalue
/ position = (40%,50%)
</picture>

<picture PSix_6>
/ items = item.PicsSix
/ select = counter.PicSelectorSix.selectedvalue
/ position = (60%,50%)
</picture>


###########################################
Picture Sets for Condition with 24 Pictures
###########################################

<picture PTwentyFour_1>
/ items = counter.selectSet.selectedvalue
/ select = counter.PicSelectorTwentyFour.selectedvalue
/ position = (10%,10%)
/ height = 20%
/ width = 20%
</picture>

<picture PTwentyFour_2>
/ items = item.PicsTwentyFour_2
/ select = counter.PicSelectorTwentyFour.selectedvalue
/ position = (25%,10%)
/ height = 20%
/ width = 20%
</picture>

<picture PTwentyFour_3>
/ items = item.PicsTwentyFour_3
/ select = counter.PicSelectorTwentyFour.selectedvalue
/ position = (40%,10%)
/ height = 20%
/ width = 20%
</picture>

<picture PTwentyFour_4>
/ items = item.PicsTwentyFour_1
/ select = counter.PicSelectorTwentyFour.selectedvalue
/ position = (55%,10%)
/ height = 20%
/ width = 20%
</picture>

<picture PTwentyFour_5>
/ items = item.PicsTwentyFour_1
/ select = counter.PicSelectorTwentyFour.selectedvalue
/ position = (70%,10%)
/ height = 20%
/ width = 20%
</picture>

<picture PTwentyFour_6>
/ items = item.PicsTwentyFour_4
/ select = counter.PicSelectorTwentyFour.selectedvalue
/ position = (85%,10%)
/ height = 20%
/ width = 20%
</picture>

<picture PTwentyFour_7>
/ items = item.PicsTwentyFour_1
/ select = counter.PicSelectorTwentyFour.selectedvalue
/ position = (10%,30%)
/ height = 20%
/ width = 20%
</picture>

<picture PTwentyFour_8>
/ items = item.PicsTwentyFour_3
/ select = counter.PicSelectorTwentyFour.selectedvalue
/ position = (25%,30%)
/ height = 20%
/ width = 20%
</picture>

<picture PTwentyFour_9>
/ items = item.PicsTwentyFour_2
/ select = counter.PicSelectorTwentyFour.selectedvalue
/ position = (40%,30%)
/ height = 20%
/ width = 20%
</picture>

<picture PTwentyFour_10>
/ items = item.PicsTwentyFour_1
/ select = counter.PicSelectorTwentyFour.selectedvalue
/ position = (55%,30%)
/ height = 20%
/ width = 20%
</picture>

<picture PTwentyFour_11>
/ items = item.PicsTwentyFour_1
/ select = counter.PicSelectorTwentyFour.selectedvalue
/ position = (70%,30%)
/ height = 20%
/ width = 20%
</picture>

<picture PTwentyFour_12>
/ items = item.PicsTwentyFour_1
/ select = counter.PicSelectorTwentyFour.selectedvalue
/ position = (85%,30%)
/ height = 20%
/ width = 20%
</picture>

<picture PTwentyFour_13>
/ items = item.PicsTwentyFour_1
/ select = counter.PicSelectorTwentyFour.selectedvalue
/ position = (10%,50%)
/ height = 20%
/ width = 20%
</picture>

<picture PTwentyFour_14>
/ items = item.PicsTwentyFour_1
/ select = counter.PicSelectorTwentyFour.selectedvalue
/ position = (25%,50%)
/ height = 20%
/ width = 20%
</picture>

<picture PTwentyFour_15>
/ items = item.PicsTwentyFour_1
/ select = counter.PicSelectorTwentyFour.selectedvalue
/ position = (40%,50%)
/ height = 20%
/ width = 20%
</picture>

<picture PTwentyFour_16>
/ items = item.PicsTwentyFour_1
/ select = counter.PicSelectorTwentyFour.selectedvalue
/ position = (55%,50%)
/ height = 20%
/ width = 20%
</picture>

<picture PTwentyFour_17>
/ items = item.PicsTwentyFour_1
/ select = counter.PicSelectorTwentyFour.selectedvalue
/ position = (70%,50%)
/ height = 20%
/ width = 20%
</picture>

<picture PTwentyFour_18>
/ items = item.PicsTwentyFour_1
/ select = counter.PicSelectorTwentyFour.selectedvalue
/ position = (85%,50%)
/ height = 20%
/ width = 20%
</picture>

<picture PTwentyFour_19>
/ items = item.PicsTwentyFour_1
/ select = counter.PicSelectorTwentyFour.selectedvalue
/ position = (10%,70%)
/ height = 20%
/ width = 20%
</picture>

<picture PTwentyFour_20>
/ items = item.PicsTwentyFour_1
/ select = counter.PicSelectorTwentyFour.selectedvalue
/ position = (25%,70%)
/ height = 20%
/ width = 20%
</picture>

<picture PTwentyFour_21>
/ items = item.PicsTwentyFour_1
/ select = counter.PicSelectorTwentyFour.selectedvalue
/ position = (40%,70%)
/ height = 20%
/ width = 20%
</picture>

<picture PTwentyFour_22>
/ items = item.PicsTwentyFour_1
/ select = counter.PicSelectorTwentyFour.selectedvalue
/ position = (55%,70%)
/ height = 20%
/ width = 20%
</picture>

<picture PTwentyFour_23>
/ items = item.PicsTwentyFour_1
/ select = counter.PicSelectorTwentyFour.selectedvalue
/ position = (70%,70%)
/ height = 20%
/ width = 20%
</picture>

<picture PTwentyFour_24>
/ items = item.PicsTwentyFour_1
/ select = counter.PicSelectorTwentyFour.selectedvalue
/ position = (85%,70%)
/ height = 20%
/ width = 20%
</picture>

<counter selectSet>
/ select = noreplace
/ items = item.sets
/ selectionrate = always
</counter>



<counter PicSelectorSix>
/ select = noreplace
/ items = (1,2,3,4,5,6)
/ selectionrate = always
</counter>

<counter PicSelectorTwentyFour>
/ select = noreplace
/ items = (1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24)
/ selectionrate = always
</counter>


<item PicsSix>
/ 1 = "1.png"
/ 2 = "2.png"
/ 3 = "3.png"
/ 4 = "4.png"
/ 5 = "5.png"
/ 6 = "6.png"
</item>

<item PicsTwentyFour_1>
/ 1 = "Schokolade/Set_1/3bit_1.jpg"
/ 2 = "Schokolade/Set_1/bananko_2.jpg"
/ 3 = "Schokolade/Set_1/bobby-caramel.jpg"
/ 4 = "Schokolade/Set_1/crunchie_1.jpg"
/ 5 = "Schokolade/Set_1/flake_1.jpg"
/ 6 = "Schokolade/Set_1/gematogen.jpg"
/ 7 = "Schokolade/Set_1/gofret.jpg"
/ 8 = "Schokolade/Set_1/huesitos.jpg"
/ 9 = "Schokolade/Set_1/ion_1.jpg"
/ 10 = "Schokolade/Set_1/japp_1.jpg"
/ 11 = "Schokolade/Set_1/kiss_1.jpg"
/ 12 = "Schokolade/Set_1/lotto_1.jpg"
/ 13 = "Schokolade/Set_1/margot_1.jpg"
/ 14 = "Schokolade/Set_1/milk-duds.jpg"
/ 15 = "Schokolade/Set_1/mrgoodbar.jpg"
/ 16 = "Schokolade/Set_1/munchies_1.jpg"
/ 17 = "Schokolade/Set_1/prince-polo_1.jpg"
/ 18 = "Schokolade/Set_1/reeses.jpg"
/ 19 = "Schokolade/Set_1/space_1.jpg"
/ 20 = "Schokolade/Set_1/sport.jpg"
/ 21 = "Schokolade/Set_1/szamba.jpg"
/ 22 = "Schokolade/Set_1/vegan.jpg"
/ 23 = "Schokolade/Set_1/whatchamacallit.jpg"
/ 24 = "Schokolade/Set_1/yorkie_2.jpg"
</item>

<item PicsTwentyFour_2>
/ 1 = "Schokolade/Set_2/babyruth_1.jpg"
/ 2 = "Schokolade/Set_2/boost.jpg"
/ 3 = "Schokolade/Set_2/broderick-belgy_1.jpg"
/ 4 = "Schokolade/Set_2/caramellokoala.jpg"
/ 5 = "Schokolade/Set_2/chocolatefish.jpg"
/ 6 = "Schokolade/Set_2/choc-ovo.jpg"
/ 7 = "Schokolade/Set_2/cookiesandcream_1.jpg"
/ 8 = "Schokolade/Set_2/curly-wurly_2.jpg"
/ 9 = "Schokolade/Set_2/dairy-milk_1.jpg"
/ 10 = "Schokolade/Set_2/derby_1.jpg"
/ 11 = "Schokolade/Set_2/moro-gold.jpg"
/ 12 = "Schokolade/Set_2/nutrageous_1.jpg"
/ 13 = "Schokolade/Set_2/palle.jpg"
/ 14 = "Schokolade/Set_2/pawelek-toffi.jpg"
/ 15 = "Schokolade/Set_2/peppy-chews.jpg"
/ 16 = "Schokolade/Set_2/pinapple-lumps.jpg"
/ 17 = "Schokolade/Set_2/primola-cremita_1.jpg"
/ 18 = "Schokolade/Set_2/princessa-kokos.jpg"
/ 19 = "Schokolade/Set_2/sweet-marie_1.jpg"
/ 20 = "Schokolade/Set_2/tupla_1.jpg"
/ 21 = "Schokolade/Set_2/vegan.jpg"
/ 22 = "Schokolade/Set_2/white-knight_1.jpg"
/ 23 = "Schokolade/Set_2/wispa_1.jpg"
/ 24 = "Schokolade/Set_2/zero_1.jpg"
</item>

<item PicsTwentyFour_3>
/ 1 = "Schokolade/Set_3/100grand.jpg"
/ 2 = "Schokolade/Set_3/charleston-chew-mini.jpg"
/ 3 = "Schokolade/Set_3/cherry-ripe_1.jpg"
/ 4 = "Schokolade/Set_3/dairy-milk-caramel.jpg"
/ 5 = "Schokolade/Set_3/galaxy.jpg"
/ 6 = "Schokolade/Set_3/insidestory.jpg"
/ 7 = "Schokolade/Set_3/karl-fazer-yoghurt.jpg"
/ 8 = "Schokolade/Set_3/kesten-dessert.jpg"
/ 9 = "Schokolade/Set_3/lunch-bar.jpg"
/ 10 = "Schokolade/Set_3/mrtom.jpg"
/ 11 = "Schokolade/Set_3/nougatti.jpg"
/ 12 = "Schokolade/Set_3/perky-nana.jpg"
/ 13 = "Schokolade/Set_3/princessa-hasselnuss.jpg"
/ 14 = "Schokolade/Set_3/reeses-big-cup.jpg"
/ 15 = "Schokolade/Set_3/sugar-babies.jpg"
/ 16 = "Schokolade/Set_3/take-five.jpg"
/ 17 = "Schokolade/Set_3/tempo.jpg"
/ 18 = "Schokolade/Set_3/tex.jpg"
/ 19 = "Schokolade/Set_3/tim-tam-chewy-caramel.jpg"
/ 20 = "Schokolade/Set_3/tokke.jpg"
/ 21 = "Schokolade/Set_3/tootsie-roll.jpg"
/ 22 = "Schokolade/Set_3/tv-bar-white.jpg"
/ 23 = "Schokolade/Set_3/vegan_.jpg"
/ 24 = "Schokolade/Set_3/yankie.jpg"
</item>
Im Ordner ist ein Bild zu viel, auf Email von Christina warten!
<item PicsTwentyFour_4>
/ 1 = "Schokolade/Set_4/corny-big-schoko.jpg"
/ 2 = "Schokolade/Set_4/debron-lifestyle-candy-milk-chocolate.jpg"
/ 3 = "Schokolade/Set_4/duplo-big-pack.jpg"
/ 4 = "Schokolade/Set_4/lindt-edel-nougat-pur.jpg"
/ 5 = "Schokolade/Set_4/lindt-hello-caramel-brownie-stick.jpg"
/ 6 = "Schokolade/Set_4/lindt-hello-sundae-choco.jpg"
/ 7 = "Schokolade/Set_4/magnum-chocolate-almond.jpg"
/ 8 = "Schokolade/Set_4/maltesers-teasers.jpg"
/ 9 = "Schokolade/Set_4/mars-2er.jpg"
/ 10 = "Schokolade/Set_4/merci-finest-selection-400g.jpg"
/ 11 = "Schokolade/Set_4/milka-milketten-haselnuss.jpg"
/ 12 = "Schokolade/Set_4/milky-way-multipack.jpg"
/ 13 = "Schokolade/Set_4/nestl--crunch-white(1).jpg"
/ 14 = "Schokolade/Set_4/nippon-haeppchen-200g.jpg"
/ 15 = "Schokolade/Set_4/pick-up--black--amp--white-5er.jpg"
/ 16 = "Schokolade/Set_4/Raw-Bite_Protein-500x500.jpg"
/ 17 = "Schokolade/Set_4/ritter-sport-voll-nuss.jpg"
/ 18 = "Schokolade/Set_4/ROOBAR-Protein-Chia-und-Chocolate-30g.jpg"
/ 19 = "Schokolade/Set_4/schogetten-alpenvollmilch.jpg"
/ 20 = "Schokolade/Set_4/schwartau-clever-snack-maracuja.jpg"
/ 21 = "Schokolade/Set_4/shokomonk-wei-e-schokolade-cookies.jpg"
/ 22 = "Schokolade/Set_4/Toblerone-100g.jpg"
/ 23 = "Schokolade/Set_4/viba-schicht-nougat-riegel-40g.jpg"
/ 24 = "Schokolade/Set_4/yogurette-300g.jpg"
</item>

<item sets>
/ 1 = item.PicsTwentyFour_1
/ 2 = item.PicsTwentyFour_2
/ 3 = item.PicsTwentyFour_3
/ 4 = item.PicsTwentyFour_4
</item>


<text TeClickOnShape>
/ items = ("Bitte auf das schwarze Viereck klicken.")
/ select = replace
/ position = (50%,20%)
</text>

<shape ShClick>
/ color = black
/ size = (10px,10px)
/ position = (50%,90%)
</shape>

<page pre_page>
Danke für Ihre Teilnahme an unserer Studie...
</page>

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: 12K, Visits: 98K
No, you cannot assing <item> elements randomly to <picture> elements. What you need to do is work with *item numbers*.

All your items should be in a *single* <item> element. The respective item *numbers* are what make up a set as in

<item PicsTwentyFour>
/ 1 = "Schokolade/Set_1/3bit_1.jpg"
...
/ 24 = "Schokolade/Set_1/yorkie_2.jpg"

/ 25 = "Schokolade/Set_2/babyruth_1.jpg"
...
/ 48 = "Schokolade/Set_2/zero_1.jpg"

/ 49 = "Schokolade/Set_3/100grand.jpg"
...
/ 72 = "Schokolade/Set_3/yankie.jpg"

/ 73 = "Schokolade/Set_4/corny-big-schoko.jpg"
...
/ 96 = "Schokolade/Set_4/yogurette-300g.jpg"
</item>

<list PicSelectorTwentyFour_1>
/ items = (1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24)
/ selectionrate = always
</list>

<list PicSelectorTwentyFour_2>
/ items = (25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48)
/ selectionrate = always
</list>

<list PicSelectorTwentyFour_3>
/ items = (49,...,72)
/ selectionrate = always
</list>

<list PicSelectorTwentyFour_4>
/ items = (73,...,96)
/ selectionrate = always
</list>

You can then draw the applicable item numbers from the respective set according to the set chosen:

<picture PTwentyFour_1>
/ items = PicsTwentyFour
/ select = list.chosenset.nextvalue

/ position = (10%,10%)
/ height = 20%
/ width = 20%
</picture>

...

with

<list chosenset>
/ items = (list.PicSelectorTwentyFour_1.nextvalue, list.PicSelectorTwentyFour_2.nextvalue, list.PicSelectorTwentyFour_3.nextvalue, list.PicSelectorTwentyFour_4.nextvalue)
...
</list>


Here's a minimal example to illustrate:

<block myblock>
/ trials = [1-2 = mytrial]
</block>

<values>
/ setnumber = 0
</values>

<trial mytrial>
/ ontrialbegin = [values.setnumber = list.setnumber.nextvalue; ]
/ stimulusframes = [1=s1,s2,s3,s4]
/ validresponse = (57)
</trial>

<text s1>
/ items = allitems
/ select = list.chosenset.nextvalue
/ position = (20%, 50%)
</text>

<text s2>
/ items = allitems
/ select = list.chosenset.nextvalue
/ position = (40%, 50%)
</text>

<text s3>
/ items = allitems
/ select = list.chosenset.nextvalue
/ position = (60%, 50%)
</text>

<text s4>
/ items = allitems
/ select = list.chosenset.nextvalue
/ position = (80%, 50%)
</text>

<item allitems>
/ 1 = "A1"
/ 2 = "A2"
/ 3 = "A3"
/ 4 = "A4"

/ 5 = "B1"
/ 6 = "B2"
/ 7 = "B3"
/ 8 = "B4"
</item>

<list set1>
/ items = (1,2,3,4)
/ selectionrate = always
</list>

<list set2>
/ items = (5,6,7,8)
/ selectionrate = always
</list>

<list setnumber>
/ items = (1,2)
</list>

<list chosenset>
/ items = (list.set1.nextvalue, list.set2.nextvalue)
/ selectionrate = always
/ selectionmode = values.setnumber
</list>

Chris-AT
Chris-AT
Respected Member (490 reputation)Respected Member (490 reputation)Respected Member (490 reputation)Respected Member (490 reputation)Respected Member (490 reputation)Respected Member (490 reputation)Respected Member (490 reputation)Respected Member (490 reputation)Respected Member (490 reputation)
Group: Forum Members
Posts: 2, Visits: 7
Thank you so much, Dave. It didn't occur to me that selectionmode can also evaluate in an integer to be chosen.

Thanks again,
Chris

GO

Merge Selected

Merge into selected topic...



Merge into merge target...



Merge into a specific topic ID...




Reading This Topic

Explore
Messages
Mentions
Search