vlw0045
|
|
Group: Forum Members
Posts: 12,
Visits: 71
|
Hello,
Apologies for the potentially really easy question, but I can't seem to find my error in my script. I'm trying to show 8 videos, selected from a list at random, and have pp answer questions about each. I've gotten the script to run, but it just plays the same video (the first one) 8 times, instead of playing the 8 videos on time each at random. I'm sure there's a typo somewhere that's causing the computer to get confused, but I think I need to learn a little more to figure it out. I've copied and pasted a section of the code below:
q--------------------------------------------- EXPERIMENT --------------------------------------------- <expt UNTUABSTAND1> / blocks = [1=Consent; 2=ParCode; 3=PatientVideoInstructions; 4-11=myblockMac; 12=ClosingScreen] / groupassignment = random </expt>
<defaults> / fontstyle = ("Cambria") / screencolor = (209,203,199) / windowsize = (100,90) </defaults>
...
-------------------------------------------------------------------------- PAGE: VIDEOS (MAC-) ------------------------------------------------------------------------- <block myblockMac> / trials = [1=ptvideoMac; 2=RatingPageVideoMac] / screencolor = (209, 203, 199) </block>
<picture personMac> / items = ("BL.jpg", "DN.jpg", "AR.jpg", "DL.jpg", "AD.jpg", "CH.jpg", "CT.jpg", "JE.jpg") / select = noreplace / resetinterval = 0 / selectionrate = block / position = (85%, 50%) </picture>
************************************************
<block ptvideosMac> / trials = [1=ptvideoMac] / screencolor = (209,203,199) </block>
<trial ptvideoMac> / stimulusframes = [1=ptvideoMac] / validresponse = (anyresponse) / correctresponse = (noresponse) / timeout = 1000 </trial>
<video ptvideoMac> / items = ("WhiteMaleBL0925.mov", "WhiteMaleDN1003.mov", "BlackMaleAR0925.mov", "BlackMaleDL0121.mov", "WhiteFemaleAD0628.mov", "WhiteFemaleCH1206.mov", "BlackFemaleCT1213.mov", "BlackFemaleJE0103.mov") / playthrough = true / select = noreplace / resetinterval = 0 / selectionrate = block / select = picture.personMac.currentindex / position = (50%, 45%) / size = (50%, 50%) </video>
Thank you in advance for your time.
|
|
|
Dave
|
|
Group: Administrators
Posts: 13K,
Visits: 104K
|
The selection in your <video> element depends on the selection in your <picture> element:
<video ptvideoMac> / items = ("WhiteMaleBL0925.mov", "WhiteMaleDN1003.mov", "BlackMaleAR0925.mov", "BlackMaleDL0121.mov", "WhiteFemaleAD0628.mov", "WhiteFemaleCH1206.mov", "BlackFemaleCT1213.mov", "BlackFemaleJE0103.mov") / playthrough = true / select = noreplace / resetinterval = 0 / selectionrate = block / select = picture.personMac.currentindex / position = (50%, 45%) / size = (50%, 50%) </video>
I see no place in the code you posted that makes use of that <picture> element, i.e, no selection will occur for it and consequently it won't for the <video> element either.
|
|
|
vlw0045
|
|
Group: Forum Members
Posts: 12,
Visits: 71
|
Dave (4/12/2015) The selection in your <video> element depends on the selection in your <picture> element:
<video ptvideoMac> / items = ("WhiteMaleBL0925.mov", "WhiteMaleDN1003.mov", "BlackMaleAR0925.mov", "BlackMaleDL0121.mov", "WhiteFemaleAD0628.mov", "WhiteFemaleCH1206.mov", "BlackFemaleCT1213.mov", "BlackFemaleJE0103.mov") / playthrough = true / select = noreplace / resetinterval = 0 / selectionrate = block / select = picture.personMac.currentindex / position = (50%, 45%) / size = (50%, 50%) </video>
I see no place in the code you posted that makes use of that <picture> element, i.e, no selection will occur for it and consequently it won't for the <video> element either.
Hey Dave, I ended up seeing that error and fixing it, and yet it's still playing just the one video, although it's matching up the pictures and videos correctly. Even with the noreplace attribute, it's only playing the first video (BL) 8 times. <block myblockMac> / trials = [1=ptvideoMac; 2=RatingPageVideoMac] / screencolor = (209, 203, 199) </block> <picture personMac> / items = ("BL.jpg", "DN.jpg", "AR.jpg", "DL.jpg", "AD.jpg", "CH.jpg", "CT.jpg", "JE.jpg") / select = noreplacenorepeat / select = picture.personMac.currentindex / resetinterval = 0 / selectionrate = block / position = (85%, 50%) </picture> ************************************************ <trial ptvideoMac> / stimulusframes = [1=ptvideoMac] / validresponse = (anyresponse) / correctresponse = (noresponse) / timeout = 1000 </trial> <video ptvideoMac> / items = ("WhiteMaleBL0925.mov", "WhiteMaleDN1003.mov", "BlackMaleAR0925.mov", "BlackMaleDL0121.mov", "WhiteFemaleAD0628.mov", "WhiteFemaleCH1206.mov", "BlackFemaleCT1213.mov", "BlackFemaleJE0103.mov") / playthrough = true / select = noreplacenorepeat / resetinterval = 0 / selectionrate = block / select = picture.personMac.currentindex / position = (50%, 45%) / size = (50%, 50%) </video>
|
|
|
Dave
|
|
Group: Administrators
Posts: 13K,
Visits: 104K
|
#1: This is circular and doesn't make any sense:
<picture personMac> / items = ("BL.jpg", "DN.jpg", "AR.jpg", "DL.jpg", "AD.jpg", "CH.jpg", "CT.jpg", "JE.jpg") / select = noreplacenorepeat / select = picture.personMac.currentindex / resetinterval = 0 / selectionrate = block / position = (85%, 50%)
</picture>
Also, /select = noreplacenorepeat makes no sense. The items are unique. What could possibly repeat?
#2: Whatever dependencies you define, it does not matter if you don't actually *display* (and thus cause a selection for) the <picture> element. I still can't see any place in your code where you actually *use* the <picture> element *before* showing the <video>.
|
|
|
vlw0045
|
|
Group: Forum Members
Posts: 12,
Visits: 71
|
Dave (4/12/2015) #1: This is circular and doesn't make any sense:
<picture personMac> / items = ("BL.jpg", "DN.jpg", "AR.jpg", "DL.jpg", "AD.jpg", "CH.jpg", "CT.jpg", "JE.jpg") / select = noreplacenorepeat / select = picture.personMac.currentindex / resetinterval = 0 / selectionrate = block / position = (85%, 50%)
</picture>
Also, /select = noreplacenorepeat makes no sense. The items are unique. What could possibly repeat?
#2: Whatever dependencies you define, it does not matter if you don't actually *display* (and thus cause a selection for) the <picture> element. I still can't see any place in your code where you actually *use* the <picture> element *before* showing the <video>.
Hey Dave, You're right, I missed the circular code thing. Problem is, my original problem still isn't solved. I re-wrote the code to reflect your changes and now the pictures being shown do not correspond to the videos at all, and the videos are playing in an odd order, occasionally repeating. I've been staring at this all day, I'm sure it's a "if it were a snake it would've bit you" situation, but I am straight missing it. How can my videos be playing the same one repeatedly (and always the same one first) if I've defined it to be random? And why aren't the pictures and videos lining up? <block PatientVideoInstructions> / trials=[1=patientvideoinstructions] / screencolor = (209,203,199) </block> <surveypage patientvideoinstructions> / fontstyle = ("Cambria", 1.6%) /questions = [1=videoinstructionstext] / finishlabel = "Continue" / nextbuttonposition = (85,90) / showquestionnumbers = false / showpagenumbers = false / fontstyle = ("Cambria", 17, true) / responsefontstyle = ("Cambria", 16, true) </surveypage> <image videoinstructionstext> /items = ("videoinstructionstext.jpg") / position = (8%, 16%) / size = (10%, 10%) </image> -------------------------------------------------------------------------- PAGE: VIGNETTES AND VIDEOS (MAC-) ------------------------------------------------------------------------- <block myblockMac> / trials = [1=ptvideoMac; 2=RatingPageVideoMac] / screencolor = (209, 203, 199) </block> <picture personMac> / items = ("AE.jpg", "CT.jpg", "DJ.jpg", "ER.jpg", "JE.jpg", "OO.jpg", "RJ.jpg", "TC.jpg", "WB.jpg", "AR.jpg", "BW.jpg", "DL.jpg", "EH.jpg", "FJ.jpg", "MA.jpg", "PD.jpg", "EC.jpg", "SB.jpg") / select = noreplace / resetinterval = 0 / selectionrate = block / position = (85%, 50%) /size = (75%, 75%) </picture> ************************************************ <trial ptvideoMac> / stimulusframes = [1=ptvideoMac] / validresponse = (anyresponse) / correctresponse = (noresponse) / timeout = 1000 </trial> <video ptvideoMac> / items = ("AE0718.mov", "CT1213.mov", "DJ1028.mov", "ER1219.mov", "JE0103.mov", "OO1008.mov", "RJ0224.mov", "WB0704.mov", "AR0925.mov", "BW0606.mov", "DL0121.mov", "EH0120.mov", "FJ0419.mov", "MA0805.mov", "PD0428.mov", "EC0825.mov", "SB1216.mov") / playthrough = true / select = noreplace / resetinterval = 0 / selectionrate = block / select = picture.personMac.currentindex / position = (50%, 45%) / size = (50%, 50%) </video>
|
|
|
Dave
|
|
Group: Administrators
Posts: 13K,
Visits: 104K
|
I don't know how to make this any clearer.:
<video ptvideoMac> / items = ("AE0718.mov", "CT1213.mov", "DJ1028.mov", "ER1219.mov", "JE0103.mov", "OO1008.mov", "RJ0224.mov", "WB0704.mov", "AR0925.mov", "BW0606.mov", "DL0121.mov", "EH0120.mov", "FJ0419.mov", "MA0805.mov", "PD0428.mov", "EC0825.mov", "SB1216.mov") / playthrough = true / select = noreplace / resetinterval = 0 / selectionrate = block / select = picture.personMac.currentindex / position = (50%, 45%) / size = (50%, 50%) </video>
Here you first say: Select from the <video>'s items without replacement (/ select = noreplace) . You later say, no, selection should *depend on the selection in another element* (/ select = picture.personMac.currentindex).
The <picture> element that's ultimately responsible for what the item the <video> selects *is not used anywhere in your code*.
You essentially say what happens in B (the video) ought to depend on what happened in A previously (the picture). But nothing ever actually happens with A.
Either remove the dependency or actually display the picture some time prior to showing the associated video. From looking at your code it's not at all clear to me which of those two options you're actually trying to implement.
|
|
|
vlw0045
|
|
Group: Forum Members
Posts: 12,
Visits: 71
|
Your patience is greatly appreciated because you most definitely made it clear with your last post. Apologies, I really didn't understand what you were saying before.
(Coding while sick is apparently the same thing as getting hit with a stupid stick.)
Now it does *almost* what I want it to. For some reason, most of the videos are lining up with their corresponding pictures, but not all, and the ones that are problematic are scattered throughout the list. I'm currently working on trying to figure out how the currentindex property works, exactly, to see what the problem is.
For clarification, I wanted to play a video, have it play immediately through to the next page, on which 4 questions and a picture are displayed (the picture corresponding to the person in the video).
Here's what I've done with the code:
<block PatientVideoInstructions> / trials=[1=patientvideoinstructions] / screencolor = (209,203,199) </block>
<surveypage patientvideoinstructions> / fontstyle = ("Cambria", 1.6%) /questions = [1=videoinstructionstext] / finishlabel = "Continue" / nextbuttonposition = (85,90) / showquestionnumbers = false / showpagenumbers = false / fontstyle = ("Cambria", 17, true) / responsefontstyle = ("Cambria", 16, true) </surveypage>
<image videoinstructionstext> /items = ("videoinstructionstext.jpg") / position = (8%, 16%) / size = (10%, 10%) </image>
-------------------------------------------------------------------------- PAGE: VIGNETTES AND VIDEOS (MAC-) ------------------------------------------------------------------------- <block myblockMac> / trials = [1=ptvideoMac; 2=RatingPageVideoMac] / screencolor = (209, 203, 199) </block>
************************************************
<block ptvideosMac> / trials = [1=ptvideoMac] / screencolor = (209,203,199) </block>
<trial ptvideoMac> / stimulusframes = [1=ptvideoMac] / validresponse = (anyresponse) / correctresponse = (noresponse) / timeout = 1000 </trial>
<video ptvideoMac> / items = ("AE0718.mov", "CT1213.mov", "DJ1028.mov", "ER1219.mov", "JE0103.mov", "OO1008.mov", "RJ0224.mov", "WB0704.mov", "AR0925.mov", "BW0606.mov", "DL0121.mov", "EH0120.mov", "FJ0419.mov", "MA0805.mov", "PD0428.mov", "EC0825.mov", "SB1216.mov") / playthrough = true / select = noreplace / resetinterval = 0 / selectionrate = block / position = (50%, 45%) / size = (50%, 50%) </video>
-------------------------------------------------------------------------- RATING PAGE: Patient Impressions (MAC) --------------------------------------------------------------------------
<surveypage RatingPageVideoMac> / questions = [1=Pain_Mac; 2=Interference_Mac; 3=Sympathy_Mac; 4=Impression_Mac] / stimulusframes = [1=personMac] / fontstyle = ("Cambria", 17, true) / responsefontstyle = ("Cambria", 16.5, false) / finishlabel = "Continue" / nextbuttonposition = (85,90) / showquestionnumbers = false / showpagenumbers = false </surveypage>
______________________________________________________________________
<slider Pain_Mac> / caption = "How much pain do you think this person was experiencing?" / labels = ("No pain ", "Worst possible pain") / increment = 1 / range = (1, 100) / slidersize = (40%, 3%) / showtooltips = false </slider>
<slider Interference_Mac> / caption = "To what degree do you think that the pain interferes with the daily functioning of this patient?" / labels = ("No interference ", "A great deal of interference") / increment = 1 / range = (1, 100) / slidersize = (40%, 3%) / showtooltips = false </slider>
<slider Sympathy_Mac> / caption = "How much sympathy do you feel for this patient?" / labels = ("No sympathy ", "A great deal of sympathy") / increment = 1 / range = (1, 100) / slidersize = (40%, 3%) / showtooltips = false </slider>
<slider Impression_Mac> / caption = "My impression of this patient was...." / labels = ("Very negative ", "Neutral", " Very positive") / increment = 1 / range = (0, 100) / slidersize = (40%, 3%) / showtooltips = false </slider>
_____________________________________________________________________
<picture personMac> / items = ("AE.jpg", "CT.jpg", "DJ.jpg", "ER.jpg", "JE.jpg", "OO.jpg", "RJ.jpg", "TC.jpg", "WB.jpg", "AR.jpg", "BW.jpg", "DL.jpg", "EH.jpg", "FJ.jpg", "MA.jpg", "PD.jpg", "EC.jpg", "SB.jpg") / select = video.ptvideoMac.currentindex / resetinterval = 0 / selectionrate = block / position = (85%, 50%) / size = (75%, 75%) </picture>
|
|
|
Dave
|
|
Group: Administrators
Posts: 13K,
Visits: 104K
|
No need to apologize, I was just running out of ways to re-phrase the problem description. :)
> For clarification, I wanted to play a video, have it play immediately through to the next page, on which 4 questions and a > picture are displayed (the picture corresponding to the person in the video).
Then your dependency was defined exactly the wrong way around. The selection in the *<picture>* ought to depend on the selection in the <video>.
As for items being ostensibly "mismatched", note that you have 17 items in your <video> element, but 18 in your <picture>.
To finish things off, here's a simple example illustrating the use of dependencies:
<expt> / blocks = [1-4=sequence(ablock, bblock)] </expt>
<block ablock> / trials = [1=atrial] </block>
<block bblock> / trials = [1=btrial] </block>
<trial atrial> / stimulusframes = [1=atext] / validresponse = (57) </trial>
<trial btrial> / stimulusframes = [1=btext] / validresponse = (57) </trial>
<text atext> / items = ("A1", "A2", "A3", "A4") / select = noreplace / selectionrate = block / resetinterval = 0 </text>
<text btext> / items = ("B1", "B2", "B3", "B4") / select = text.atext.currentindex / selectionrate = block / resetinterval = 0 </text>
|
|
|
vlw0045
|
|
Group: Forum Members
Posts: 12,
Visits: 71
|
I hadn't noticed I was missing the video for TC- and I even checked!!!
Pretty sure that clears everything up.
I did have it backwards. I was stealing code from another study coded by someone else who organizes their code completely differently than I do, and getting all turned around.
Dave saves the day, again!
|
|
|
Dave
|
|
Group: Administrators
Posts: 13K,
Visits: 104K
|
Sounds like it should be working as intended now. Great!
More importantly, though: Get well soon!
|
|
|