long delay before pictures are presented


Author
Message
Diane
Diane
Distinguished Member (4.3K reputation)Distinguished Member (4.3K reputation)Distinguished Member (4.3K reputation)Distinguished Member (4.3K reputation)Distinguished Member (4.3K reputation)Distinguished Member (4.3K reputation)Distinguished Member (4.3K reputation)Distinguished Member (4.3K reputation)Distinguished Member (4.3K reputation)
Group: Forum Members
Posts: 53, Visits: 131
Hi,

I have an experiment in which I present 6 pictures simultaneously on each trial, and each trial has different pictures. On the start of the first trial, it takes a while (sometimes more than a minute) to start the trial. This happens only when I run the online version. Is there a way to prepare picture presentation before the trial starts, for example during the instruction page?

Thanks,
Diane

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
> On the start of the first trial, it takes a while (sometimes more than a minute) to start the trial. This happens only when I run the online
> version.

This would suggest that the respective images have not already been downloaded when the first trial is supposed to start and the need to retrieve them from the server is what introduces the delay. If you set up your code correctly, that should not happen, i.e., all required files should have been downloaded *before* the respective experiment ever starts to execute. Why precisely *your* code does not do that cannot be answered without you providing the relevant sections of the code.

Diane
Diane
Distinguished Member (4.3K reputation)Distinguished Member (4.3K reputation)Distinguished Member (4.3K reputation)Distinguished Member (4.3K reputation)Distinguished Member (4.3K reputation)Distinguished Member (4.3K reputation)Distinguished Member (4.3K reputation)Distinguished Member (4.3K reputation)Distinguished Member (4.3K reputation)
Group: Forum Members
Posts: 53, Visits: 131
I've attached the experiment, the delay happens when the trial *fixation* branches to trial.show6faces.

thanks,
Diane

Attachments
StudyChakYuen.iqx (722 views, 32.00 KB)
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
Thanks for providing the code, which confirms my initial guess. Problem is this: The various <item> elements used by your <picture> elements are empty. They are only filled at runtime based on values (here:filenames) pulled from <counter> elements.

<item position1>
</item>
...
<trial fillpositionpractice>
/ontrialbegin = [item.position1.item=counter.setp.selectedvalue;
                 item.position2.item=counter.setp.selectedvalue;
                 item.position3.item=counter.setp.selectedvalue;
                 item.position4.item=counter.setp.selectedvalue;
                 item.position5.item=counter.setp.selectedvalue;
                 item.position6.item=counter.setp.selectedvalue]
/trialduration = 0
</trial>

<counter setp>
/ items = ("neg_f_p1.jpg","neg_m_p1.jpg","pos_m_p2.jpg","pos_f_p2.jpg","neu_f_p3.jpg","neu_m_p3.jpg")
/select = noreplace
/selectionrate = always
</counter>
...

As opposes to <picture> elements, <counter> elements are agnostic regarding their items, i.e., there is no way for the script to determine *up front* that there are actual *files* involved. Hence those files aren't downloaded prior to executing the experiment and have to be fetched at runtime, causing the delay you observed.

To *force* all files to be downloaded up front, add an additional <picture element to your script that lists all image files the script is going to need, i.e. all the image file names that are currently only listed in your <counter>s.

<picture mypicture>
/ items = ("neg_f_p1.jpg","neg_m_p1.jpg","pos_m_p2.jpg","pos_f_p2.jpg","neu_f_p3.jpg","neu_m_p3.jpg",
"neg_f_01.jpg","neg_m_01.jpg","pos_m_02.jpg","pos_f_02.jpg","neu_f_03.jpg","neu_m_03.jpg",
"neg_f_10.jpg","neg_m_07.jpg","pos_m_05.jpg","pos_f_14.jpg","neu_f_06.jpg","neu_m_12.jpg",
"neg_m_10.jpg","neg_f_16.jpg","pos_f_17.jpg","pos_m_14.jpg","neu_m_15.jpg","neu_f_12.jpg")
</picture>

Note that none of your <trial>s needs to actually use the above <picture> element, i.e., no further modifications are necessary. Adding it to the script simply lets Inquisit know which files it ought to download prior to executing the script. This should eliminate any delay at runtime: The required files will already be present on the machine instead of having to be fetched at runtime.

Diane
Diane
Distinguished Member (4.3K reputation)Distinguished Member (4.3K reputation)Distinguished Member (4.3K reputation)Distinguished Member (4.3K reputation)Distinguished Member (4.3K reputation)Distinguished Member (4.3K reputation)Distinguished Member (4.3K reputation)Distinguished Member (4.3K reputation)Distinguished Member (4.3K reputation)
Group: Forum Members
Posts: 53, Visits: 131
thanks!
Diane
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
You are absolutely welcome. As a piece of general advice, I would propose that working with item numbers instead of filling empty <item> elements at runtime is the better option in terms of reliability as well as performance. For the sake of example, suppose you have three on-screen elements at three different positions (pos1 to pos3) and three item sets comprised of 3 items each. You could then do something along the following lines:

<values>
/ pos1item = 1
/ pos2item = 1
/ pos3item = 1
</values>

<picture pos1>
/ items = pictureitems
/ select = values.pos1item
/ position = (25%, 50%)
</picture>

<picture pos2>
/ items = pictureitems
/ select = values.pos2item
/ position = (50%, 50%)
</picture>

<picture pos3>
/ items = pictureitems
/ select = values.pos3item
/ position = (75%, 50%)
</picture>

<item pictureitems>
/ 1 = "set1_item1.jpg"
/ 2 = "set1_item2.jpg"
/ 3 = "set1_item3.jpg"

/ 4 = "set2_item1.jpg"
/ 5 = "set2_item2.jpg"
/ 6 = "set2_item3.jpg"

/ 7 = "set3_item1.jpg"
/ 8 = "set3_item2.jpg"
/ 9 = "set3_item3.jpg"
</item>

Set 1 is comprised of items 1 to 3
<list set1itemnumbers>
/ items = (1,2,3)
/ selectionmode = random
/ selectionrate = always
</list>

Set 2 is comprised of items 4 to 6
<list set2itemnumbers>
/ items = (4,5,6)
/ selectionmode = random
/ selectionrate = always
</list>

Set 3 is comprised of items 7 to 9
<list set3itemnumbers>
/ items = (7,8,9)
/ selectionmode = random
/ selectionrate = always
</list>

<trial set1trial>
/ ontrialbegin = [values.pos1item=list.set1itemnumbers.nextvalue;
    values.pos2item=list.set1itemnumbers.nextvalue;
    values.pos3item=list.set1itemnumbers.nextvalue; ]
/ stimulusframes = [1=pos1, pos2, pos3]
/ validresponse = (57)
</trial>

<trial set2trial>
/ ontrialbegin = [values.pos1item=list.set2itemnumbers.nextvalue;
    values.pos2item=list.set2itemnumbers.nextvalue;
    values.pos3item=list.set2itemnumbers.nextvalue; ]
/ stimulusframes = [1=pos1, pos2, pos3]
/ validresponse = (57)
</trial>

<trial set3trial>
/ ontrialbegin = [values.pos1item=list.set3itemnumbers.nextvalue;
    values.pos2item=list.set3itemnumbers.nextvalue;
    values.pos3item=list.set3itemnumbers.nextvalue; ]
/ stimulusframes = [1=pos1, pos2, pos3]
/ validresponse = (57)
</trial>

<block myblock>
/ trials = [1-3 = noreplace(set1trial, set2trial, set3trial)]
</block>


GO

Merge Selected

Merge into selected topic...



Merge into merge target...



Merge into a specific topic ID...




Reading This Topic

Explore
Messages
Mentions
Search