importing stim lists


Author
Message
sdubrow
sdubrow
Distinguished Member (4.8K reputation)Distinguished Member (4.8K reputation)Distinguished Member (4.8K reputation)Distinguished Member (4.8K reputation)Distinguished Member (4.8K reputation)Distinguished Member (4.8K reputation)Distinguished Member (4.8K reputation)Distinguished Member (4.8K reputation)Distinguished Member (4.8K reputation)
Group: Forum Members
Posts: 26, Visits: 143
Hello,

I was wondering if there is anyway to import a list of stimuli from a text file in some automated way to avoid manually entering each stimulus. I have over 200 stimuli with a different precise sequence for each subject. Any thoughts on how to go about automating this would be much appreciated. 

Thanks,
Sarah
Tags
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: 98K
You can import stimulus lists from text files under the condition that the lists are in proper Inquisit syntax format via <include> elements. You can even import them based on e.g. the entered subject id to administer specific item sets to different subjects using the /precondition attribute. Quick example for two subjects 1 and 2:

--- iqx script file ---
<include>
/ precondition = [script.subjectid == 1]
/ file = "s_01_items.txt"
</include>

<include>
/ precondition = [script.subjectid == 2]
/ file = "s_02_items.txt"
</include>

<block myblock>
/ trials = [1-4 = mytrial]
</block>

<trial mytrial>
/ stimulusframes = [1=mytext]
/ validresponse = (57)
</trial>

<text mytext>
/ items = myitems
/ select = sequence
</text>

--- file called s_01_items.txt with the following contents ---
<item myitems>
/1="A"
/1="B"
/1="C"
/1="D"
</item>

--- file called s_02_items.txt with the following contents ---
<item myitems>
/1="E"
/1="F"
/1="G"
/1="H"
</item>

As for getting you stimulus lists into proper Inquisit syntax to begin with, you should be able to make the application you generate(d) those lists with to output something along those lines. (Note that the numbering in the <item> element does not actually matter.)

Hope this helps.

sdubrow
sdubrow
Distinguished Member (4.8K reputation)Distinguished Member (4.8K reputation)Distinguished Member (4.8K reputation)Distinguished Member (4.8K reputation)Distinguished Member (4.8K reputation)Distinguished Member (4.8K reputation)Distinguished Member (4.8K reputation)Distinguished Member (4.8K reputation)Distinguished Member (4.8K reputation)
Group: Forum Members
Posts: 26, Visits: 143
Thank you, that's very helpful. 

One follow-up question I have is how then to specify that the trials be the length of the list that I'm importing. Specifically, I understand in the block element I should specify that the trials be in sequence. My problem is the length of the list varies by list and subject. Is there a way to specify that the number of trials should be the length of the list. I tried removing the numbers as in / trials = [sequence(all_images)] but that doesn't work. 

Thanks for your help!
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: 98K
There are a couple of options here and the "best" approach would largely depend on the code you already have. It may be easiest to also put the varying <block> specification in the to be <include>d files. Building on the example in the previous response, you'd do:

--- iqx script file ---
<include>
/ precondition = [script.subjectid == 1]
/ file = "s_01_items.txt"
</include>

<include>
/ precondition = [script.subjectid == 2]
/ file = "s_02_items.txt"
</include>

<expt myexpt>
/ blocks = [1=myblock]
</expt>

<trial mytrial>
/ stimulusframes = [1=mytext]
/ validresponse = (57)
</trial>

<text mytext>
/ items = myitems
/ select = sequence
</text>

--- file called s_01_items.txt with the following contents ---
<block myblock>
/ trials = [1-4 = mytrial]
</block>

<item myitems>
/1="A"
/1="B"
/1="C"
/1="D"
</item>

--- file called s_02_items.txt with the following contents ---
<block myblock>
/ trials = [1-8 = mytrial]
</block>

<item myitems>
/1="E"
/1="F"
/1="G"
/1="H"
/1="I"
/1="J"
/1="K"
/1="L"
</item>

which would run 4 trials for subject #1 and 8 trials for subject #2.

sdubrow
sdubrow
Distinguished Member (4.8K reputation)Distinguished Member (4.8K reputation)Distinguished Member (4.8K reputation)Distinguished Member (4.8K reputation)Distinguished Member (4.8K reputation)Distinguished Member (4.8K reputation)Distinguished Member (4.8K reputation)Distinguished Member (4.8K reputation)Distinguished Member (4.8K reputation)
Group: Forum Members
Posts: 26, Visits: 143
Ok, thanks! 
I'd like some clarification on the stimulus order aspect because as I'm doing it now, the order is changing each time I run it. If I write:
/ trials = [1-8 = mytrial]
then the order should be E, F, G, etc?
Is there something else needed to make it present the stims in the order in which they appear in the imported file?


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: 98K
No, the /trials attribute has nothing to do with how stimuli are selected. That's controlled via the respective stimulus element's (<text>, <picture>, etc.) /select attribute. In the examples I gave,

<text mytext>
/ items = myitems
/ select = sequence
</text>

is what determines stimuli to be presented in the order given in the <item> element.

sdubrow
sdubrow
Distinguished Member (4.8K reputation)Distinguished Member (4.8K reputation)Distinguished Member (4.8K reputation)Distinguished Member (4.8K reputation)Distinguished Member (4.8K reputation)Distinguished Member (4.8K reputation)Distinguished Member (4.8K reputation)Distinguished Member (4.8K reputation)Distinguished Member (4.8K reputation)
Group: Forum Members
Posts: 26, Visits: 143
Great, thanks!

Somewhat relatedly, is there a way to set the lists that are loaded using <include> to be specific to the current block? Is this something the precondition can do?

Also, can the instructions be set by block? Or is this something that should be included in the loaded files?
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: 98K
> Somewhat relatedly, is there a way to set the lists that are loaded using <include> to be specific to the current block? Is this something the
> precondition can do?

I'm not sure what that's supposed to mean. Please clarify. A concrete example based on those already posted in this thread would help.

> Also, can the instructions be set by block? Or is this something that should be included in the loaded files?                               

Here too, it's not clear what you mean in concrete terms. To clarify: All <include> does is effectively paste the contents of an external file into the script. /precondition allows you to determine *which* external file's contents are to be used based on the specified condition. Those external files can contain as many different things as necessary -- they are not constrained to containing only <block> or <item> elements; they may contain any element you need to vary according to the specified condition, including for example instruction <page> elements.



sdubrow
sdubrow
Distinguished Member (4.8K reputation)Distinguished Member (4.8K reputation)Distinguished Member (4.8K reputation)Distinguished Member (4.8K reputation)Distinguished Member (4.8K reputation)Distinguished Member (4.8K reputation)Distinguished Member (4.8K reputation)Distinguished Member (4.8K reputation)Distinguished Member (4.8K reputation)
Group: Forum Members
Posts: 26, Visits: 143
Sorry, my question is how to load external files conditional on the current block. 

So the logic I'd want is:

if block ==1
   <include>
   / precondition = [script.subjectid == 1]
   / file = "s_01_items_block1.txt"
   </include> 
elseif block ==2
 <include>
   / precondition = [script.subjectid == 1]
   / file = "s_01_items_blcok2.txt"
   </include> 

The names of the items are the same in the files (because they should be treated the same way by the script) so loading all of them creates a problem. So, I was hoping to load the files based on the block condition being met. Is something like this possible and if so would it be setting the precondition to be  / precondition = [block == 1]?
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: 98K
> [...] my question is how to load external files conditional on the current block.

That's not possible, nor do I see why you would need it. For <include> to work the condition has to be satisfiable *before* the script ever starts running, i.e., you can only use things that are known *beforehand* such as the provided subject identifier, the type of operating system Inquisit finds itself running on, etc.

Unfortunately, your example does not provide any additional clarity for me. What the difference between "block 1" and "block 2" is remains unclear. Please describe the relevant parts of your procedure in sufficient detail.


GO

Merge Selected

Merge into selected topic...



Merge into merge target...



Merge into a specific topic ID...




Reading This Topic

Explore
Messages
Mentions
Search