Horizontal position and image selection from group


Author
Message
wuaham
wuaham
Respected Member (419 reputation)Respected Member (419 reputation)Respected Member (419 reputation)Respected Member (419 reputation)Respected Member (419 reputation)Respected Member (419 reputation)Respected Member (419 reputation)Respected Member (419 reputation)Respected Member (419 reputation)
Group: Forum Members
Posts: 38, Visits: 170
I have four groups of images (e.g., A, B, C, D), each group has eight images (currently I put them as text for testing). I want to display two images side by side selected randomly, a text in-between ("Positive" or "Negative" in randomize order) and run trials of equal number of each text.
(Script below)
Questions:
1. Horizontal position:
    How to set horizontal position (/hposition)) values for leftImage and rightImage?
    (Implemented in the script but having issues, sometimes displays horizontal position at zero (as initialized))
2. How to avoid selection of same group on both sides? (e.g., if leftImage comes from group C,
rightImage should be from remaining groups A, B, D but not from group C)
(Tried to branch conditionally but not working - please help)

3. How to avoid selection of same image type on both sides? (e.g., if C5.jpg selected for leftIamge, rightImage can't be A5.jpg, B5.jpg, or D5.jpg, please note I am managing image group by alphabet and type by number)?
(Not sure how to implement)

Would appreciate your kind help.
Thanks

Here is the script in Inquisit-6:
<values>
/ lftimg = ""
/ rgtimg = ""
</values>

<text A>
/items = ("A1.jpg","A2.jpg","A3.jpg","A4.jpg","A5.jpg","A6.jpg","A7.jpg","A8.jpg")
/size = (20%,20%)
/fontstyle = ("Arial", 50pt, true)
/ vposition = 50%
/ hposition = 0%
</text>

<text B>
/items = ("B1.jpg","B2.jpg","B3.jpg","B4.jpg","B5.jpg","B6.jpg","B7.jpg","B8.jpg")
/size = (20%,20%)
/fontstyle = ("Arial", 50pt, true)
/ vposition = 50%
/ hposition = 0%
</text>

<text C>
/items = ("C1.jpg","C2.jpg","C3.jpg","C4.jpg","C5.jpg","C6.jpg","C7.jpg","C8.jpg")
/size = (20%,20%)
/fontstyle = ("Arial", 50pt, true)
/ vposition = 50%
/ hposition = 0%
</text>

<text D>
/items = ("D1.jpg","D2.jpg","D3.jpg","D4.jpg","D5.jpg","D6.jpg","D7.jpg","D8.jpg")
/size = (20%,20%)
/fontstyle = ("Arial", 50pt, true)
/ vposition = 50%
/ hposition = 0%
</text>

<text plus>
/ items = ("Positive")
/ size = (20%, 20%)
/ position = (50%, 50%)
/ fontstyle = ("Arial", 30pt, true)
</text>

<text minus>
/ items = ("Negative")
/ size = (20%, 20%)
/ position = (50%, 50%)
/ fontstyle = ("Arial", 30pt, true)
</text>

<list leftImage>
/ items = (text.A,text.B, text.C, text.D)
/ replace = true
/ selectionrate = always
</list>

<list rightImage>
/ items = (text.A,text.B, text.C, text.D)
/ replace = true
/ selectionrate = always
</list>

<trial plus>
/ ontrialbegin = [trial.plus.insertstimulusframe(list.leftImage.nextvalue, 1);
                 trial.plus.insertstimulusframe(list.rightImage.nextvalue, 1);]
/ branch = [if (substring(list.leftImage.currentvalue, 5, 1) == substring(list.rightImage.currentvalue, 5, 1)) trial.plus]
                
/ ontrialbegin = [if (substring(list.leftImage.currentvalue, 5, 1) == "A") {text.A.hposition = 30%}
                    else if (substring(list.leftImage.currentvalue, 5, 1) == "B") {text.B.hposition = 30%}
                    else if (substring(list.leftImage.currentvalue, 5, 1) == "C") {text.C.hposition = 30%}
                    else if (substring(list.leftImage.currentvalue, 5, 1) == "D") {text.D.hposition = 30%};]

/ ontrialbegin = [if (substring(list.rightImage.currentvalue, 5, 1) == "A") {text.A.hposition = 70%}
                    else if (substring(list.rightImage.currentvalue, 5, 1) == "B") {text.B.hposition = 70%}
                    else if (substring(list.rightImage.currentvalue, 5, 1) == "C") {text.C.hposition = 70%}
                    else if (substring(list.rightImage.currentvalue, 5, 1) == "D") {text.D.hposition = 70%};]

/ stimulusframes = [1=clearScreen; 2=text.plus; 3=list.leftImage, list.rightImage;]
/ validresponse = ("a", "b")
</trial>

<trial minus>
/ ontrialbegin = [trial.minus.insertstimulusframe(list.leftImage.nextvalue, 1);
                 trial.minus.insertstimulusframe(list.rightImage.nextvalue, 1);]
/ branch = [if (substring(list.leftImage.currentvalue, 5, 1) == substring(list.rightImage.currentvalue, 5, 1)) trial.minus]

/ ontrialbegin = [if (substring(list.leftImage.currentvalue, 5, 1) == "A") {text.A.hposition = 30%}
else if (substring(list.leftImage.currentvalue, 5, 1) == "B") {text.B.hposition = 30%}
else if (substring(list.leftImage.currentvalue, 5, 1) == "C") {text.C.hposition = 30%}
else if (substring(list.leftImage.currentvalue, 5, 1) == "D") {text.D.hposition = 30%};]

/ ontrialbegin = [if (substring(list.rightImage.currentvalue, 5, 1) == "A") {text.A.hposition = 70%}
else if (substring(list.rightImage.currentvalue, 5, 1) == "B") {text.B.hposition = 70%}
else if (substring(list.rightImage.currentvalue, 5, 1) == "C") {text.C.hposition = 70%}
else if (substring(list.rightImage.currentvalue, 5, 1) == "D") {text.D.hposition = 70%};]                
                
/ stimulusframes = [1=clearScreen; 2=text.minus; 3=list.leftImage, list.rightImage;]
/ validresponse = ("a", "b")
</trial>

<block tryblock>
/ trials = [1-10=noreplace(plus,minus)]
/ recorddata = true
</block>


GO

Merge Selected

Merge into selected topic...



Merge into merge target...



Merge into a specific topic ID...




Threaded View
Threaded View
wuaham - 5 Months Ago
Dave - 5 Months Ago
Dave - 5 Months Ago
wuaham - 5 Months Ago
Dave - 5 Months Ago
                         Here's the whole thing for the four plus trials. Minus trials ought to...
Dave - 5 Months Ago
                             Thank you Dave for your excellent help and that worked. Now I have...
wuaham - 5 Months Ago
                                 > Is there a way we can select right image (values.rgtimg) based on...
Dave - 5 Months Ago
                                     Thank you Dave. I have resolved the issue.
wuaham - 5 Months Ago

Reading This Topic

Explore
Messages
Mentions
Search