Seeking Advice for Random Image Presentation Script


Author
Message
TBParis
TBParis
New Member (21 reputation)New Member (21 reputation)New Member (21 reputation)New Member (21 reputation)New Member (21 reputation)New Member (21 reputation)New Member (21 reputation)New Member (21 reputation)New Member (21 reputation)
Group: Forum Members
Posts: 2, Visits: 8
Hello everyone, I don't really know how to start my script, so I am asking for your advice. I would like to present 10 images to participants only once for 1000 ms, with an interval of 1000 ms between each image as well. I would like these images to be presented in a random order.

But the real sticking point for me is that I want one image out of the 10 to be randomly selected and presented 5 times instead of just once, but still randomly among the others.
This makes a total of 14 presentations, with one image being repeated 5 times.

Does anyone have an idea of where to start?
Thank you :)
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
TBParis - 6/15/2024
Hello everyone, I don't really know how to start my script, so I am asking for your advice. I would like to present 10 images to participants only once for 1000 ms, with an interval of 1000 ms between each image as well. I would like these images to be presented in a random order.

But the real sticking point for me is that I want one image out of the 10 to be randomly selected and presented 5 times instead of just once, but still randomly among the others.
This makes a total of 14 presentations, with one image being repeated 5 times.

Does anyone have an idea of where to start?
Thank you :)

<item picitems>
/ 1 = "image01.jpg"
/ 2 = "image02.jpg"
/ 3 = "image03.jpg"
/ 4 = "image04.jpg"
/ 5 = "image05.jpg"
/ 6 = "image06.jpg"
/ 7 = "image07.jpg"
/ 8 = "image08.jpg"
/ 9 = "image09.jpg"
/ 10 = "image10.jpg"
</item>

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

<list picitemnumbers>
// maxrunsize = 1 // if you want to avoid consecutive presentations of the repeated item (if possible), set maxsrunsize to 1
</list>

<text pic>
/ items = picitems
/ select = values.picitemnumber
</text>

<trial pictrial>
/ ontrialbegin = [
    values.picitemnumber = list.picitemnumbers.nextvalue;
]

/ stimulustimes = [0=pic]
/ trialduration = 2000
/ posttrialpause = 1000
</trial>

<block picblock>
/ onblockbegin = [
    values.repeatpicitemnumber = list.allitems.nextindex; // pick one item number to be repeated
    var i = 0;
    // and add it to the item numbers list 5 times
    while (i < 5) {
        list.picitemnumbers.appenditem(values.repeatpicitemnumber);
        i += 1;
    };
    // then just add the remaining 9 item numbers to the list
    i = 0;
    while (i < 9) {
        list.picitemnumbers.appenditem(list.allitems.nextindex);
        i += 1;
    };
]
/ trials = [1-14 = trial.pictrial]
</block>

<values>
/ repeatpicitemnumber = 0
/ picitemnumber = 0
</values>

TBParis
TBParis
New Member (21 reputation)New Member (21 reputation)New Member (21 reputation)New Member (21 reputation)New Member (21 reputation)New Member (21 reputation)New Member (21 reputation)New Member (21 reputation)New Member (21 reputation)
Group: Forum Members
Posts: 2, Visits: 8
Hello Dave,

Thank you for your help ! It works very well :)
Have a nice day,

GO

Merge Selected

Merge into selected topic...



Merge into merge target...



Merge into a specific topic ID...




Reading This Topic

Explore
Messages
Mentions
Search