Displaying multiple images in one trial


Author
Message
kam23
kam23
Associate Member (61 reputation)Associate Member (61 reputation)Associate Member (61 reputation)Associate Member (61 reputation)Associate Member (61 reputation)Associate Member (61 reputation)Associate Member (61 reputation)Associate Member (61 reputation)Associate Member (61 reputation)
Group: Forum Members
Posts: 5, Visits: 42
For my script, I want to run through a set of images in each trial, with each image presented one by one for about 500ms each. As the images are displaying, the participant can press the spacebar at anytime, in which the remaining stimuli yet to be displayed will be terminated and a textbox will appear for them to enter their answer to the question I provide. After they submit their response, we start a brand new trial with a brand new set of images (so the leftover images of set1 are never displayed). I have provided what I have so far down below, and right now, when I run the trial, it just displays the first image in a set and just stays there. once the participant presses spacebar, the text box appears immediately, and that part works fine. So my main trouble right now, is getting multiple images to display, one by one within a singular trial. Can anyone help? I would greatly appreciate it!

**************************************************************************************************************
Lists of items
**************************************************************************************************************
<item ImageSet1> // store all images in order
/1 = "set1-1.jpg"
/2 = "set1-2.jpg"
/3 = "set1-3.jpg
/4 = "set1-4.jpg"
/5 = "set1-5.jpg"
</item>

<item ImageSet2>
/1 = "set2-1.jpg"
/2 = "set2-2.jpg"
/3 = "set2-3.jpg"
/4 = "set2-4.jpg"
/5 = "set2-5.jpg"
</item>
**************************************************************************************************************
picture
**************************************************************************************************************
<picture set1 > // so the pictures will get displayed in order
/ items = ImageSet1
/ select = values.selectframe
/ size = (50%, 50%)
</picture>

<picture set2 >
/ items = ImageSet2
/ select = sequence
/ size = (50%, 50%)
</picture>
****************************************
list
****************************************
<list selectframe>. // so photos are displayed in order
/items = (1, 2, 3, 4, 5)
/ replace = false
</list>

<list duration>
/ items = (500)
</list>
**************************************************************************************************************
trial
**************************************************************************************************************
<trial Trial1>
/ ontrialbegin = [
    values.starttrialtime = script.elapsedtime; //stores the start of the trial
    
    if (values.count_frames != 0) { // if not first iteration, then update value
        values.selectframe = list.selectframe.nextvalue;
    }
    else {
        values.selectframe = list.selectframe;  // else select first item
    }
    values.count_frames += 1;      
]

/ responseinterrupt = immediate
/ validresponse = (" ")
/ beginresponsetime = values.frameduration
/ isvalidresponse = [
    if (trial.Trial1.responsetext == " "){.  //check if the spacebar was pressed
        values.responsetime = script.elapsedtime; //store the recorded responsetime in script.elapsedtime        
    };
    return (trial.Trial1.responsetext == " ");    
]
/ branch = [
    if (values.count_frames < values.numofframes){. // if there are more frames to be displayed, run through trial again
        return (trial.Trial1);
        };
]

/ ontrialend = [
    values.endtrialtime = script.elapsedtime; //to record participant time
    values.selectframe = 0;  
]

</trial>
****************************************
block
****************************************
<block block1>
/onblockbegin = [
    values.numofframes = 0;
]
/trials = [
    1 = getReady;
    2 = Trial1;
    3 = userResponse;
]
</block>
****************************************
* Once I get the trial working, I then planned on duplicating it for each set of images. 
GO

Merge Selected

Merge into selected topic...



Merge into merge target...



Merge into a specific topic ID...





Reading This Topic

Explore
Messages
Mentions
Search