Millisecond Forums

run stimulus sequence from external file

https://forums.millisecond.com/Topic20057.aspx

By AnjaK - 11/7/2016

Hi all, I was wondering whether it is possible in Inquisit 4 control the stimulus sequence that should be shown via an external file (e.g., .txt, .csv)?
By Dave - 11/7/2016

AnjaK - Monday, November 07, 2016
Hi all, I was wondering whether it is possible in Inquisit 4 control the stimulus sequence that should be shown via an external file (e.g., .txt, .csv)?

You can use <include> to reference an external text file in an Inquisit script. The contents of that file need to be valid Inquisit syntax. Suppose you have four items A to D, and want to show them in two different sequential orders between-subjects. Let's say those orders are A-B-C-D and the reverse D-C-B-A for the sake of example.

Your "main" script would look like:
----
<block myblock>
/ trials = [1-4 = mytrial]
</block>

<trial mytrial>
/ stimulusframes = [1=mytext]
/ trialduration = 1000
</trial>

<text mytext>
/ items = ("A", "B", "C", "D")
/ select = list.myorder.nextvalue
</text>

//odd group numbers receive 1st order
<include>
/ precondition = [mod(script.groupid, 2) == 1]
/ file = "order1.txt"

</include>

//even group numbers receive 2nd order
<include>
/ precondition = [mod(script.groupid, 2) == 0]
/ file = "order2.txt"

</include>
---

order1.txt would contain the following:
----
//order 1
<list myorder>
/ items = (1,2,3,4)
/ selectionmode = sequence
</list>
----

order2.txt would contain the 2nd (reverse) order:
----
//order 2
<list myorder>
/ items = (4,3,2,1)
/ selectionmode = sequence
</list>
----