Millisecond Forums

Preventing parsing errors when using

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

By Sercan - 2/24/2018

Hi,

I'm creating a script that includes files A or B, depending on the group number. These files contain the stimuli in English and Dutch, respectively. However, I get an error when I do this. How can I approach this in a way that works?

Regards,

Sercan
By Dave - 2/26/2018

Sercan Kahveci - Sunday, February 25, 2018
Hi,

I'm creating a script that includes files A or B, depending on the group number. These files contain the stimuli in English and Dutch, respectively. However, I get an error when I do this. How can I approach this in a way that works?

Regards,

Sercan

Proper syntax to do this would look like this:

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

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

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

//odd group numbers receive English items
<include>
/ precondition = [mod(script.groupid, 2) == 1]
/ file = "englishitems.iqx"
</include>

//even group numbers receive Dutch items
<include>
/ precondition = [mod(script.groupid, 2) == 0]
/ file = "dutchitems.iqx"
</include>
---

englishitems.iqx would contain the following:
----
//English
<item myitems>
/ 1 = "eng 01"
/ 2 = "eng 02"
/ 3 = "eng 03"
/ 4 = "eng 04"
</item>
----

dutchitems.iqx would contain the following:
----
//Dutch
<item myitems>
/ 1 = "nl 01"
/ 2 = "nl 02"
/ 3 = "nl 03"
/ 4 = "nl 04"
</item>
----