Present picture items using updated list/values


Author
Message
crhbrown
crhbrown
New Member (12 reputation)New Member (12 reputation)New Member (12 reputation)New Member (12 reputation)New Member (12 reputation)New Member (12 reputation)New Member (12 reputation)New Member (12 reputation)New Member (12 reputation)
Group: Forum Members
Posts: 4, Visits: 29
Hi Millisecond forum,

I've got a problem with trying to present randomly selected images based on conditional logic in Inquisit 6. It's a visual search task where some images need to appear in colour whilst others in plain grey. I thought the easiest way of doing this would be to set the positions as picture elements, with a list array defining the picture to be presented with each position in the list corresponding to it's matched position (see below).

<picture p1>
/ items = ("<%list.StimSet.item(1)%>")
/ position = (expressions.hp1, expressions.vp1)
/ size = (expressions.StimSize_X, expressions.StimSize_Y)
/ erase = false
</picture>

Then using conditional logic I'd update the list using the .setitem function to change the item for each corresponding position (see below).

/ ontrialbegin = [if(values.DistractorPos == "D1"){
                    list.StimSet.setitem(list.Filler_Colour.nextvalue, 1);

When I do this however it gives me an "Inquisit Error: prepare() failed, Line 214, File trial.cpp." error message when it attempts to run that trial with the picture image. I'm not sure what's going wrong, as I've managed to present text stimuli this way, and have managed a similar thing Inquisit 5 with images but updating a value element. 

I've tested what it is and when I used a fixed list of stimuli without changing it with the .setitem function it presents the stimuli fine, therefore it seems to be an issue with the updating of the list preventing it from presenting the stimuli - but not sure why this would be? I've also attempted it with updating a value element for each picture element, but get similar results.

Thanks in advance for any advice!
Chris
Dave
Dave
Supreme Being (929K reputation)Supreme Being (929K reputation)Supreme Being (929K reputation)Supreme Being (929K reputation)Supreme Being (929K reputation)Supreme Being (929K reputation)Supreme Being (929K reputation)Supreme Being (929K reputation)Supreme Being (929K reputation)
Group: Administrators
Posts: 11K, Visits: 68K
Please provide code that is sufficiently complete to run as well as the files that code requires to run.

Your question is not answerable and the mistake not diagnosable based on two isolated code snippets.

crhbrown
crhbrown
New Member (12 reputation)New Member (12 reputation)New Member (12 reputation)New Member (12 reputation)New Member (12 reputation)New Member (12 reputation)New Member (12 reputation)New Member (12 reputation)New Member (12 reputation)
Group: Forum Members
Posts: 4, Visits: 29
Sure thing - I've attached the script and all stimuli. The file is: "RewardCategory_Online_ForumVersion"

Many thanks,
Chris
Attachments
ForumQ.zip (8 views, 867.00 KB)
Dave
Dave
Supreme Being (929K reputation)Supreme Being (929K reputation)Supreme Being (929K reputation)Supreme Being (929K reputation)Supreme Being (929K reputation)Supreme Being (929K reputation)Supreme Being (929K reputation)Supreme Being (929K reputation)Supreme Being (929K reputation)
Group: Administrators
Posts: 11K, Visits: 68K
crhbrown - 4/21/2021
Sure thing - I've attached the script and all stimuli. The file is: "RewardCategory_Online_ForumVersion"

Many thanks,
Chris

You have mistakes in the construction logic for the file name that ends up in values.targetstim.

You set values.categorya and values.categoryb to "Blob_1_" and "Blob_2_" respectively. Note the trailing underscore.



You then later append "_Grey.png " to that.. Note the leading underscore and the trailing space.



That is, the file names you construct have the form "Blob_1__Grey.png ", which is not a file that actually exists.

Similar construction problems exist in other parts of the code. Fix those, and things should work.

crhbrown
crhbrown
New Member (12 reputation)New Member (12 reputation)New Member (12 reputation)New Member (12 reputation)New Member (12 reputation)New Member (12 reputation)New Member (12 reputation)New Member (12 reputation)New Member (12 reputation)
Group: Forum Members
Posts: 4, Visits: 29
Dave - 4/21/2021
crhbrown - 4/21/2021
Sure thing - I've attached the script and all stimuli. The file is: "RewardCategory_Online_ForumVersion"

Many thanks,
Chris

You have mistakes in the construction logic for the file name that ends up in values.targetstim.

You set values.categorya and values.categoryb to "Blob_1_" and "Blob_2_" respectively. Note the trailing underscore.



You then later append "_Grey.png " to that.. Note the leading underscore and the trailing space.



That is, the file names you construct have the form "Blob_1__Grey.png ", which is not a file that actually exists.

Similar construction problems exist in other parts of the code. Fix those, and things should work.

Ah - thanks for spotting that! Glad to know it was a small error on my part rather than anything else.

Many thanks,
Chris
Dave
Dave
Supreme Being (929K reputation)Supreme Being (929K reputation)Supreme Being (929K reputation)Supreme Being (929K reputation)Supreme Being (929K reputation)Supreme Being (929K reputation)Supreme Being (929K reputation)Supreme Being (929K reputation)Supreme Being (929K reputation)
Group: Administrators
Posts: 11K, Visits: 68K
crhbrown - 4/21/2021
Dave - 4/21/2021
crhbrown - 4/21/2021
Sure thing - I've attached the script and all stimuli. The file is: "RewardCategory_Online_ForumVersion"

Many thanks,
Chris

You have mistakes in the construction logic for the file name that ends up in values.targetstim.

You set values.categorya and values.categoryb to "Blob_1_" and "Blob_2_" respectively. Note the trailing underscore.



You then later append "_Grey.png " to that.. Note the leading underscore and the trailing space.



That is, the file names you construct have the form "Blob_1__Grey.png ", which is not a file that actually exists.

Similar construction problems exist in other parts of the code. Fix those, and things should work.

Ah - thanks for spotting that! Glad to know it was a small error on my part rather than anything else.

Many thanks,
Chris

For what it's worth, the attached revision should have the various file name construction issues fixed. (The set of "blue" blob image files also wasn't made known to the script. Those have to be added to the dummy picture element's items.)

Attachments
GO

Merge Selected

Merge into selected topic...



Merge into merge target...



Merge into a specific topic ID...




Reading This Topic

Explore
Messages
Mentions
Search