Show an image if a condition is satsfied


Author
Message
sbashyam
sbashyam
Associate Member (281 reputation)Associate Member (281 reputation)Associate Member (281 reputation)Associate Member (281 reputation)Associate Member (281 reputation)Associate Member (281 reputation)Associate Member (281 reputation)Associate Member (281 reputation)Associate Member (281 reputation)
Group: Forum Members
Posts: 18, Visits: 27
Hi,
I am in the process of creating a study on inquist, but need help with conditionally displaying an image. I want to code the study in such a way that if a certain picture is displayed (there are two out of eight such pictures that randomly display on two trials), then another picture also gets displayed along with it. 

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: 12K, Visits: 100K
sbashyam - 7/24/2023
Hi,
I am in the process of creating a study on inquist, but need help with conditionally displaying an image. I want to code the study in such a way that if a certain picture is displayed (there are two out of eight such pictures that randomly display on two trials), then another picture also gets displayed along with it. 

Thank you!

What specifically do you need help with?

Also, your description is vague and you ought to provide more details and specifics. Finally, it sounds like you already have some code written, so you should provide that as well along with comments re. what the code is supposed to do.
sbashyam
sbashyam
Associate Member (281 reputation)Associate Member (281 reputation)Associate Member (281 reputation)Associate Member (281 reputation)Associate Member (281 reputation)Associate Member (281 reputation)Associate Member (281 reputation)Associate Member (281 reputation)Associate Member (281 reputation)
Group: Forum Members
Posts: 18, Visits: 27
Thank you Dave for your response! I can add the code here below

<item stimuli>
/1 = "lunch.png"
/2 = "lemonades.png"
/3 = "math_books.png"
/4 = "oven.png"
/5 = "coloring.png"
/6 = "puzzle.png"
/7 = "cupcakes.png"
/8 = "airplanes.png"
</item>

<picture activity_group>
/items = stimuli
/ selectionrate = block
/size = (35%, 35%)
/ hposition = 50%
/ vposition = 80%
</picture>

What I need is - when the "cupckaes" or "airplane" stimuli is displayed, I want a white rectangle to be displayed on the screen along with them. I dont need this for any other stimuli. Is this possible?
Edited Last Year by Dave
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: 100K
sbashyam - 7/24/2023
Thank you Dave for your response! I can add the code here below

<item stimuli>
/1 = "lunch.png"
/2 = "lemonades.png"
/3 = "math_books.png"
/4 = "oven.png"
/5 = "coloring.png"
/6 = "puzzle.png"
/7 = "cupcakes.png"
/8 = "airplanes.png"
</item>

<picture activity_group>
/items = stimuli
/ selectionrate = block
/size = (35%, 35%)
/ hposition = 50%
/ vposition = 80%
</picture>

What I need is - when the "cupckaes" or "airplane" stimuli is displayed, I want a white rectangle to be displayed on the screen along with them. I dont need this for any other stimuli. Is this possible?

Anything's possible, but that code snippet isn't helpful. Where are the trials? What do they do? Why is the selectionrate set to block?

Again, please be precise and specific.
sbashyam
sbashyam
Associate Member (281 reputation)Associate Member (281 reputation)Associate Member (281 reputation)Associate Member (281 reputation)Associate Member (281 reputation)Associate Member (281 reputation)Associate Member (281 reputation)Associate Member (281 reputation)Associate Member (281 reputation)
Group: Forum Members
Posts: 18, Visits: 27
This is the entire experiment set up.

[code removed by Administrator]







Edited Last Year by Dave
sbashyam
sbashyam
Associate Member (281 reputation)Associate Member (281 reputation)Associate Member (281 reputation)Associate Member (281 reputation)Associate Member (281 reputation)Associate Member (281 reputation)Associate Member (281 reputation)Associate Member (281 reputation)Associate Member (281 reputation)
Group: Forum Members
Posts: 18, Visits: 27

In each trial, there are images of two boys displayed, along with one stimuli - "activity_group". What I need is, when "cupcakes" or "airplanes" are displayed, I also want a white rectangle to be displayed

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: 100K
sbashyam - 7/24/2023

In each trial, there are images of two boys displayed, along with one stimuli - "activity_group". What I need is, when "cupcakes" or "airplanes" are displayed, I also want a white rectangle to be displayed

First, please don't paste entire scripts into a post's body. That's error-prone and generally difficult to work with. Further, if your code requires external files (images, etc.) to run, please always provide any and all files needed along with it.

Put everything in a ZIP file and attach it to a post by using +Insert -> Add File.



If the file is too big to attach here, make it available via Dropbox or any similar service (e.g. https://wetransfer.com/ ) and post the link. Thank you.

sbashyam
sbashyam
Associate Member (281 reputation)Associate Member (281 reputation)Associate Member (281 reputation)Associate Member (281 reputation)Associate Member (281 reputation)Associate Member (281 reputation)Associate Member (281 reputation)Associate Member (281 reputation)Associate Member (281 reputation)
Group: Forum Members
Posts: 18, Visits: 27
Dave - 7/24/2023
sbashyam - 7/24/2023

In each trial, there are images of two boys displayed, along with one stimuli - "activity_group". What I need is, when "cupcakes" or "airplanes" are displayed, I also want a white rectangle to be displayed

First, please don't paste entire scripts into a post's body. That's error-prone and generally difficult to work with. Further, if your code requires external files (images, etc.) to run, please always provide any and all files needed along with it.

Put everything in a ZIP file and attach it to a post by using +Insert -> Add File.



If the file is too big to attach here, make it available via Dropbox or any similar service (e.g. https://wetransfer.com/ ) and post the link. Thank you.

My apologies I have attached the file below

Edited Last Year by Dave
sbashyam
sbashyam
Associate Member (281 reputation)Associate Member (281 reputation)Associate Member (281 reputation)Associate Member (281 reputation)Associate Member (281 reputation)Associate Member (281 reputation)Associate Member (281 reputation)Associate Member (281 reputation)Associate Member (281 reputation)
Group: Forum Members
Posts: 18, Visits: 27
sbashyam - 7/24/2023
Dave - 7/24/2023
sbashyam - 7/24/2023

In each trial, there are images of two boys displayed, along with one stimuli - "activity_group". What I need is, when "cupcakes" or "airplanes" are displayed, I also want a white rectangle to be displayed

First, please don't paste entire scripts into a post's body. That's error-prone and generally difficult to work with. Further, if your code requires external files (images, etc.) to run, please always provide any and all files needed along with it.

Put everything in a ZIP file and attach it to a post by using +Insert -> Add File.



If the file is too big to attach here, make it available via Dropbox or any similar service (e.g. https://wetransfer.com/ ) and post the link. Thank you.

My apologies I have attached the file below
Dave - 7/24/2023
sbashyam - 7/24/2023

In each trial, there are images of two boys displayed, along with one stimuli - "activity_group". What I need is, when "cupcakes" or "airplanes" are displayed, I also want a white rectangle to be displayed

First, please don't paste entire scripts into a post's body. That's error-prone and generally difficult to work with. Further, if your code requires external files (images, etc.) to run, please always provide any and all files needed along with it.

Put everything in a ZIP file and attach it to a post by using +Insert -> Add File.



If the file is too big to attach here, make it available via Dropbox or any similar service (e.g. https://wetransfer.com/ ) and post the link. Thank you.

Attachments
stimuli_zip.zip (107 views, 22 bytes)
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: 100K
sbashyam - 7/24/2023
sbashyam - 7/24/2023
Dave - 7/24/2023
sbashyam - 7/24/2023

In each trial, there are images of two boys displayed, along with one stimuli - "activity_group". What I need is, when "cupcakes" or "airplanes" are displayed, I also want a white rectangle to be displayed

First, please don't paste entire scripts into a post's body. That's error-prone and generally difficult to work with. Further, if your code requires external files (images, etc.) to run, please always provide any and all files needed along with it.

Put everything in a ZIP file and attach it to a post by using +Insert -> Add File.



If the file is too big to attach here, make it available via Dropbox or any similar service (e.g. https://wetransfer.com/ ) and post the link. Thank you.

My apologies I have attached the file below
Dave - 7/24/2023
sbashyam - 7/24/2023

In each trial, there are images of two boys displayed, along with one stimuli - "activity_group". What I need is, when "cupcakes" or "airplanes" are displayed, I also want a white rectangle to be displayed

First, please don't paste entire scripts into a post's body. That's error-prone and generally difficult to work with. Further, if your code requires external files (images, etc.) to run, please always provide any and all files needed along with it.

Put everything in a ZIP file and attach it to a post by using +Insert -> Add File.



If the file is too big to attach here, make it available via Dropbox or any similar service (e.g. https://wetransfer.com/ ) and post the link. Thank you.

That ZIP shows up as empty for me.
GO

Merge Selected

Merge into selected topic...



Merge into merge target...



Merge into a specific topic ID...




Reading This Topic

Explore
Messages
Mentions
Search