Using the Include element to conditionally select vids based on OS


Author
Message
LibbyLu43
LibbyLu43
Expert (1.2K reputation)Expert (1.2K reputation)Expert (1.2K reputation)Expert (1.2K reputation)Expert (1.2K reputation)Expert (1.2K reputation)Expert (1.2K reputation)Expert (1.2K reputation)Expert (1.2K reputation)
Group: Forum Members
Posts: 22, Visits: 1

Hello again Dave. Hope all is well.


I'm wondering if you could offer some help on how to use the include element when I'm already running my study through a batch file. I've read the language reference, and from my conceptual understanding it seems that <include> and <batch> do basically the same thing except that one runs the files randomly, and the other sequentially (I'm sure there are other difs too). Anyways, in my study, I have videos, and want to conditionally select based on the participants' OS so that both mac and windows users can participate. I have mov and wmv video files, but am not sure where the include elements should go. Below is my batch file since my best guess would be that it would somehow go in there?


Thanks Dave!


-Libby


<batch GroupHN>
/ subjects = (1 of 5)
/ file = "Consent.iqx"
/ file = "SoundTest.iqx"
/ file = "Demographics.iqx"
/ file = "Emotions1.iqx"
/ file = "Stroop1.iqx"
/ file = "HNvideo.iqx"
/ file = "Emotions2.iqx"
/ file = "Stroop2.iqx"
/ file = "Part2.iqx"
</batch>

<batch GroupLP>
/ subjects = (2 of 5)
/ file = "Consent.iqx"
/ file = "SoundTest.iqx"
/ file = "Demographics.iqx"
/ file = "Emotions1.iqx"
/ file = "Stroop1.iqx"
/ file = "LPvideo.iqx"
/ file = "Emotions2.iqx"
/ file = "Stroop2.iqx"
/ file = "Part2.iqx"
</batch>

<batch GroupLN>
/ subjects = (3 of 5)
/ file = "Consent.iqx"
/ file = "SoundTest.iqx"
/ file = "Demographics.iqx"
/ file = "Emotions1.iqx"
/ file = "Stroop1.iqx"
/ file = "LNvideo.iqx"
/ file = "Emotions2.iqx"
/ file = "Stroop2.iqx"
/ file = "Part2.iqx"
</batch>

<batch GroupHP>
/ subjects = (4 of 5)
/ file = "Consent.iqx"
/ file = "SoundTest.iqx"
/ file = "Demographics.iqx"
/ file = "Emotions1.iqx"
/ file = "Stroop1.iqx"
/ file = "HPvideo.iqx"
/ file = "Emotions2.iqx"
/ file = "Stroop2.iqx"
/ file = "Part2.iqx"
</batch>

<batch GroupNeutral>
/ subjects = (5 of 5)
/ file = "Consent.iqx"
/ file = "SoundTest.iqx"
/ file = "Demographics.iqx"
/ file = "Emotions1.iqx"
/ file = "Stroop1.iqx"
/ file = "Neutralvideo.iqx"
/ file = "Emotions2.iqx"
/ file = "Stroop2.iqx"
/ file = "Part2.iqx"
</batch>


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: 13K, Visits: 108K

it seems that <include> and <batch> do basically the same thing except that one runs the files randomly, and the other sequentiall


No. They are entirely different beasts with different purposes and use cases.


<batch> runs separate scripts in a given sequence. <include> parses contents residing in an external file into a given script.


The <include> elements must reside in the scripts that run the videos, a syntax example covering this exact case can be found in the documentation for the <include> element:


<include>
/ precondition=[computer.platform ==
"windows"]
/
file="wmv_videos.iqx"
</include>

<include>
/
precondition=[computer.platform == "mac"]
/
file="mov_videos.iqx"
</include>


Regards,


~Dave


LibbyLu43
LibbyLu43
Expert (1.2K reputation)Expert (1.2K reputation)Expert (1.2K reputation)Expert (1.2K reputation)Expert (1.2K reputation)Expert (1.2K reputation)Expert (1.2K reputation)Expert (1.2K reputation)Expert (1.2K reputation)
Group: Forum Members
Posts: 22, Visits: 1

Right, I knew how to write the syntax, just not where it should go (i.e. in the batch script, in the video script, or in it's own separate file) - so thanks for clearing that up!


Have a good one,


Libby


LibbyLu43
LibbyLu43
Expert (1.2K reputation)Expert (1.2K reputation)Expert (1.2K reputation)Expert (1.2K reputation)Expert (1.2K reputation)Expert (1.2K reputation)Expert (1.2K reputation)Expert (1.2K reputation)Expert (1.2K reputation)
Group: Forum Members
Posts: 22, Visits: 1

Ok, I followed all the instructions for <include> i.e. the syntax, and also from this page: (http://www.millisecond.com/support/docs/v3/html/howto/multiplescripts.htm), but I'm still getting an error when I test online (and also getting a major headache lol as I'm sure you are too from all my posts). Here are examples of one set of my scripts (i.e. the batch, the include script, the script for the MOV video, and the script for the WMV video):


Batch:
<batch GroupHN>
/ subjects = (1 of 5)
/ file = "Consent.iqx"
/ file = "SoundTest.iqx"
/ file = "Demographics.iqx"
/ file = "Emotions1.iqx"
/ file = "Stroop1.iqx"
/ file = "HN.iqx"
/ file = "Emotions2.iqx"
/ file = "Stroop2.iqx"
/ file = "Part2.iqx"
</batch>



Include script:
<defaults>
/ windowsize = (90%, 90%)
</defaults>

<expt>
/ blocks = [1=HNm; 2=HNw]
</expt>

<include>
/precondition = [computer.platform == "windows"]
/file = "HNvidWMV.iqx"
</include>

<include>
/precondition = [computer.platform == "mac"]
/file = "HNvidMOV.iqx"
</include>



MOV video script:
<block HNm>
/ trials = [1=HNvidm]
</block>

<trial HNvidm>
/ stimulustimes = [0=HNvidm]
/ response = noresponse
/ timeout = 1
</trial>

<video HNvidm>
/ items = ("High Negative.mov")
/ playthrough = true
/ position = (50%, 50%)
/ size = (50%, 50%)
</video>



WMV video script
<block HNw>
/ trials = [1=HNvidw]
</block>

<trial HNvidw>
/ stimulustimes = [0=HNvidw]
/ response = noresponse
/ timeout = 1
</trial>

<video HNvidw>
/ items = ("HN.wmv")
/ playthrough = true
/ position = (50%, 50%)
/ size = (50%, 50%)
</video>


LibbyLu43
LibbyLu43
Expert (1.2K reputation)Expert (1.2K reputation)Expert (1.2K reputation)Expert (1.2K reputation)Expert (1.2K reputation)Expert (1.2K reputation)Expert (1.2K reputation)Expert (1.2K reputation)Expert (1.2K reputation)
Group: Forum Members
Posts: 22, Visits: 1

oh, and the file names for each script are


Batch:
"Batch"


Include:
"HN"


MOV video script:
"HNvidMOV"


WMV video script:
"HNvidWMV"


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: 13K, Visits: 108K

I'm still getting an error when I test online


And that error would be?


Have you made sure you've uploaded all the additional files to the server?


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: 13K, Visits: 108K


<expt>
/ blocks = [1=HNm; 2=HNw]
</expt>


Note that this does not make sense. I very much doubt you'd want the script to run *both* blocks (w for windows, m for mac). And that obviously can't work because only one file will be included, and that file will only contain one of those blocks. What you want is


Include script:
<defaults>
/ windowsize = (90%, 90%)
</defaults>

<expt>
/ blocks = [1=HN]
</expt>

<include>
/precondition = [computer.platform == "windows"]
/file = "HNvidWMV.iqx"
</include>

<include>
/precondition = [computer.platform == "mac"]
/file = "HNvidMOV.iqx"
</include>


MOV video script:
<block HN>
/ trials = [1=HNvidm]
</block>

<trial HNvidm>
/ stimulustimes = [0=HNvidm]
/ response = noresponse
/ timeout = 1
</trial>

<video HNvidm>
/ items = ("High Negative.mov")
/ playthrough = true
/ position = (50%, 50%)
/ size = (50%, 50%)
</video>


WMV video script
<block HN>
/ trials = [1=HNvidw]
</block>

<trial HNvidw>
/ stimulustimes = [0=HNvidw]
/ response = noresponse
/ timeout = 1
</trial>

<video HNvidw>
/ items = ("HN.wmv")
/ playthrough = true
/ position = (50%, 50%)
/ size = (50%, 50%)
</video>


LibbyLu43
LibbyLu43
Expert (1.2K reputation)Expert (1.2K reputation)Expert (1.2K reputation)Expert (1.2K reputation)Expert (1.2K reputation)Expert (1.2K reputation)Expert (1.2K reputation)Expert (1.2K reputation)Expert (1.2K reputation)
Group: Forum Members
Posts: 22, Visits: 1

Ok, that makes sense.


I changed the block names to what you indicated in red, but now I'm getting the below error message.



















System error QFile::5: The system cannot find the path specified.
Line 265, File Path.cpp



Could not locate element 'HN'.



block 1 is unassigned.





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: 13K, Visits: 108K

Check your scripts. The error indicates you have not renamed the elements properly, i.e., in all include files (see all the portions highlighted in red in my previous reply).


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: 13K, Visits: 108K

Alternatively, there may be something wrong with the /preconditions in your <include>s. Check what the computer.platform property returns (the documentation is unfortunately inconsistent regarding this) by displaying:


<text mytext>
/ items = ("<%computer.platform%>")
</text>


Do the same on the Mac.


It might be "win" for Windows and "mac" for MacOS, the example in the <include> language reference mentions "windows", though.


As far as I can tell, it's "win".


GO

Merge Selected

Merge into selected topic...



Merge into merge target...



Merge into a specific topic ID...




Reading This Topic

Explore
Messages
Mentions
Search