Millisecond Forums

How write the stimulus filename to the result file

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

By jens - 1/10/2018

Hello

I am using the following code to switch between two different stimulus files based on the subject.id:
<include>
/precondition = [mod(script.subjectid,2) == 0]
/file = "Stimuli1.iqx"
</include>

<include>
/precondition = [mod(script.subjectid,2) > 0]
/file = "Stimuli2.iqx"
</include>

How do I store the stimulus-filename in the result? Adding the include property include.file to the columns-specification of the data element did not work. All suggestions are welcome.

Best wishes Jens

By Dave - 1/11/2018

jens - Thursday, January 11, 2018
Hello

I am using the following code to switch between two different stimulus files based on the subject.id:
<include>
/precondition = [mod(script.subjectid,2) == 0]
/file = "Stimuli1.iqx"
</include>

<include>
/precondition = [mod(script.subjectid,2) > 0]
/file = "Stimuli2.iqx"
</include>

How do I store the stimulus-filename in the result? Adding the include property include.file to the columns-specification of the data element did not work. All suggestions are welcome.

Best wishes Jens


You can use the same logic as in your /precondition attributes /onexptbegin to write the information to a <values> entry. Then log that value to the data file.

<values>
/ stimulusfile = ""
</values>

<expt>
/ onexptbegin = [if (mod(script.subjectid,2) == 0) values.stimulusfile = "Stimuli1.iqx" else values.stimulusfile = "Stimuli2.iqx"]
...
</expt>

...
<data>
/ columns = [..., values.stimulusfile, ...]
...
</data>
By jens - 1/11/2018

Dave - Thursday, January 11, 2018
jens - Thursday, January 11, 2018
Hello

I am using the following code to switch between two different stimulus files based on the subject.id:
<include>
/precondition = [mod(script.subjectid,2) == 0]
/file = "Stimuli1.iqx"
</include>

<include>
/precondition = [mod(script.subjectid,2) > 0]
/file = "Stimuli2.iqx"
</include>

How do I store the stimulus-filename in the result? Adding the include property include.file to the columns-specification of the data element did not work. All suggestions are welcome.

Best wishes Jens


You can use the same logic as in your /precondition attributes /onexptbegin to write the information to a <values> entry. Then log that value to the data file.

<values>
/ stimulusfile = ""
</values>

<expt>
/ onexptbegin = [if (mod(script.subjectid,2) == 0) values.stimulusfile = "Stimuli1.iqx" else values.stimulusfile = "Stimuli2.iqx"]
...
</expt>

...
<data>
/ columns = [..., values.stimulusfile, ...]
...
</data>

Thanks.

Best wishes Jens