PennController for IBEX › Forums › Support › design three page experiment with loop
- This topic has 6 replies, 2 voices, and was last updated 9 months, 1 week ago by Jeremy.
August 24, 2022 at 5:51 pm #8358
I wnated to create a experiment that consists of three images but each image of each seperate page with middle one (2nd one) having audio. then the pattern repeats itself with other set of three images again and again with two conditions Group A and group B. where on the PCIbex can I find the script. I am struggling to figure this out. I have seen scripts where you have three images on the same page but I wanted them on seprate pages.
FOr exmaple. Image 1 -> image 2 wih audio -> image 3. but then it repeats itself as a loop automatically with other images. Image 4-> image 5 with audio -> image 6. THE MIddlE IMAGE IS ALWAYS THE SAME JUST DIFFERENT AUDIO. I have csv file made. But I am lost on the script.
I am really lost.
thank you.August 25, 2022 at 10:48 am #8359
You can use
.remove()on any element that you previously
I am missing some details about your design to give you a fully worked out example script, but here is one project that is consistent with your description: https://farm.pcibex.net/r/nkHbDP/
There is a CSV file that lists pairs of images and one sound file for each trial, for two different groups. The middle image is always the same from trial to trial, but the first and last images are the ones referenced in the CSV file. The audio also changes from trial to trial, as specified in the CSV file
I also added a Text element above the images so you can tell which trial number/group you are seeing when taking the experiment
Of course this is just for illustrative purposes, as the script collect no measures at all (although by adding
.log()to the Image elements and to the Key element, you could retrieve how fast participants press Space after seeing each image, for example)
JeremyAugust 25, 2022 at 11:23 am #8360
Yes, this is what I wanted. the middle image is same with different sound. in between each set i just need a break screen. but I don,t have enough coding experience to even know where to start. i understand the log() part. I tried to use the code from the experiment about the “the game master” and the deck of cards but that just led to errors. How do I write the code for something like this? do you have example for this?
I thought about the using the example from the basic tutorial but I don#t know how to change it.
Do you have example code for the example above? or where I can start? I will make a new csv file like the one u have.
thank you.August 25, 2022 at 11:28 am #8361
also since its an eyetrackign study. I cant have next button, i think it needs to automatic. Also in between iamges in set I would need to have 400 ms gap. I understand that could be done with the code. newTimer(400).start().wait() I believe.August 25, 2022 at 12:55 pm #8362
If you haven’t done so yet, I recommend that you read and follow along the Basic tutorial, and then continue with the Advanced tutorial. They are meant to provide you with enough skills that, by the end, you should be able to recreate the project from my previous message, for example
Once you feel comfortable with that, you can read the guide on how to collect eye-tracking data to learn how to incorporate the EyeTracker element in your project
Now, regarding your specific questions:
Do you have example code for the example above?
If you mean this example, you can click on the text “Click here to edit a copy in the PCIbex Farm.” in the top bar to open a copy of the project in the PCIbex Farm, where you will be able to see and edit its code
since its an eyetrackign study. I cant have next button, i think it needs to automatic
It is possible, and even recommended, to have buttons in an eyetracking study. For example, asking participants to click on a button placed at the center of the page before starting a trial is a good way to drag their gaze to the center of the screen
I understand that could be done with the code. newTimer(400).start().wait() I believe
Yes, Timer elements take a number as a parameter that defines their duration, as documented on this page. It is also illustrated in chapter 9 of the Advanced tutorial
JeremyAugust 25, 2022 at 2:13 pm #8363
thank you so much. I will get started with the recommendation above and the script. Thank you so much.
I have actually gone through some of these pages already.
I wanted know for future references. I can’t keep asking for scripts. how does one know what to put into script to indiviualize it? is just through the documentation provided and sheer practicing skills?August 25, 2022 at 2:30 pm #8364
how does one know what to put into script to indiviualize it? is just through the documentation provided and sheer practicing skills?
That’s what the tutorial is for: it’s a detailed, step-by-step explanation of the concepts and mechanisms of the script that you can arrange to build your experimental design from scratch. Most experiments are composed of displaying some content on the page and waiting for a timeout or some interaction with the page. The tutorial explains how to display and remove text (
getText) and images (
getImage) on the page, how to play and stop audio files (
getAudio), how to wait for a given duration (
getTimer) and how to listen to keypresses (
getKey) or clicks (
getSelector). Those constitute the vast majority of the building blocks required by almost all experiments. The documentation also lists the existing element types in a dedicated section so you can learn more about how to use them, and maybe look for some that you need in a project but were not familiar with yet (eg. the DropDown element to display drop-down lists)
The How-to guides then detail how to go on about frequent, more complex aspects of designing an experiment with PCIbex
Finally, with sufficient knowledge of the script and its mechanisms, reading the code of other experiments helps you discover new ways of implementing various features, without necessarily needing any further documentation
- You must be logged in to reply to this topic.