Millisecond Forums

importing stim lists


https://www.millisecond.com/forums/Topic19045.aspx

By sdubrow - 5/10/2016

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
By Dave - 5/11/2016

Preface: I'm still not sure I fully understand your setup and what the perceived problem is. With that said:

> Thus, it would be useful to be able to load up a different file for each block.

As already explained, this is not possible for the reasons outlined in my previous response.

> I'd prefer not to define each as a different type of item.

If I understand you correctly, you would then end up with 16 external text files *per subject*, which hold the items pertaining to a particular block. I'm not sure how that's less tedious or more straightforward than doing something along the lines you outlined:

> I realize another way to do this is to name items of each type according to their block (e.g., <item study1> etc)

> I'm wondering if there is a way within Inquisit to set up something conditional on the current block such that I don't have to define new
> items

There is, but it's hardly less work. The fact remains that the crucial information -- which items belong to which block -- needs to be encoded *somewhere*. You can use <list> elements to determine the selection. Again, building on previous examples, you can 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-2=sequence(study, test)]
</expt>

<trial studytrial>
/ stimulusframes = [1=studytext]
/ validresponse = (57)
</trial>

<trial testrial>
/ stimulusframes = [1=testtext]
/ validresponse = (57)
</trial>

<text studytext>
/ items = studyitems
/ select = list.studylist.nextindex
</text>

<text testtext>
/ items = testitems
/ select = list.testlist.nextindex
</text>

--- file called s_01_items.txt with the following contents ---
<list studylist>
/ poolsize = 4
/ selectionmode = sequence
</list>

<list testlist>
/ poolsize = 4
/ selectionmode = sequence
</list>

<block test>
/ trials = [1-2 = testtrial]
</block>

<block study>
/ trials = [1-2 = studytrial]
</block>

<item testitems>
/1="test A"
/1="test B"

/1="test C"
/1="test D"
</item>

<item studyitems>
/1="study A"
/1="study B"

/1="study C"
/1="study D"
</item>

--- file called s_02_items.txt with the following contents ---
<list studylist>
/ poolsize = 8
/ selectionmode = sequence
</list>

<list testlist>
/ poolsize = 8
/ selectionmode = sequence
</list>

<block test>
/ trials = [1-4 = testtrial]
</block>

<block study>
/ trials = [1-4 = studytrial]
</block>

<item testitems>
/1="test E"
/1="test F"
/1="test G"
/1="test H"

/1="test I"
/1="test J"
/1="test K"
/1="test L"
</item>

<item studyitems>
/1="study E"
/1="study F"
/1="study G"
/1="study H"

/1="study I"
/1="study J"
/1="study K"
/1="study L"
</item>

Subject #1 would get the items "study A" and "study B" in the 1st study block, and the items "test A" and "test B" in the 1st test block. In the 2nd study block, the participant would see "study C" followed by "study D", and "test C" -> "test D" in the 2nd test block.

The situation for hypothetical subject #2 is analogous, only with 4 trials / items per block, administered in the specified order.