Millisecond Forums

visual search touch scrren task with visual feedback

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

By tecnika - 4/25/2016

Hello,
I am trying to do a visual search task with a touch screen where after touching a couple of stimuli a tick mark with transparent background (e.g. ) will appear on the stimulus touched as a feedback.
The image is made of 128 couple of stimuli, as you can see below:




The participant should touch the couple that appeared made with identical stimuli, with an allowed time of 3 minutes. I would like to record the time and the position of the stimuli couple touched (or the correspondent couple of stimuli, e.g. couple 3).
Is it possible doing that with Inquisit? How can I make appear in the same screen subsequent tick marks maintaining the image with the stimuli in the background? Will it be more convenient to cut the couples? I have identified the position in pixels of the screen but with the 0,0 coordinates in the centre of the screen (initially the idea was that one to use another software), is it possible to to move that? I know that in Inquisit 0,0 is in the top left corner.

Many thanks for any help you can provide.

Elena



By Dave - 4/25/2016

For the layout and general mechanics, you'll want to look at scripts like the Columbia Card Task available in the library.

> Will it be more convenient to cut the couples?

That's what I would recommend. Things get easier if every on-screen item is a distinct object.

> I have identified the position in pixels of the screen but with the 0,0 coordinates in the centre of the screen (initially the idea was that one
> to use another software), is it possible to to move that?

You can potentially write an expression to convert/remap the coordinates as needed. I would recommend against that, though. In addition, if you indeed "cut the couples", this should not be necessary at all.

Touchscreen input under Inquisit 4 essentially works just like mouse input.

Here's a somewhat simplified, scaled-down example to illustrate some of the most important basic ideas re. how one could go about implementing something like this:

<values>
/ couple = ""
/ first = ""
/ second = ""
/ match = 0
/ matchcount = 0
</values>

<block myblock>
/ stop = [values.matchcount == 4]
/ trials = [1=select_1st]
/ timeout = 30000
</block>

<trial select_1st>
/ inputdevice = mouse
/ stimulusframes = [1=a_1,a_2,b_1,b_2,c_1,c_2,d_1,d_2]
/ validresponse = (a_1,a_2,b_1,b_2,c_1,c_2,d_1,d_2)
/ ontrialend = [values.first = trial.select_1st.response; values.couple = substring(values.first,0,2)]
/ branch = [trial.select_2nd]
</trial>

<trial select_2nd>
/ inputdevice = mouse
/ stimulusframes = [1=a_1,a_2,b_1,b_2,c_1,c_2,d_1,d_2]
/ validresponse = (a_1,a_2,b_1,b_2,c_1,c_2,d_1,d_2)
/ ontrialend = [values.second = trial.select_2nd.response]
/ ontrialend = [if(substring(values.first,0,2) == substring(values.second,0,2)) values.match = true else values.match = false]
/ ontrialend = [if (values.match && values.couple == "a_") {text.a_1.item.1 = "√"; text.a_2.item.1 = "√"}
    else if (values.match && values.couple == "b_") {text.b_1.item.1 = "√"; text.b_2.item.1 = "√"}
    else if (values.match && values.couple == "c_") {text.c_1.item.1 = "√"; text.c_2.item.1 = "√"}
    else if (values.match && values.couple == "d_") {text.d_1.item.1 = "√"; text.d_2.item.1 = "√"};]
/ branch = [trial.select_1st]
</trial>

<text a_1>
/ items = ("A")
/ position = (40%, 45%)
/ erase = false
</text>

<text a_2>
/ items = ("A")
/ position = (80%, 55%)
/ erase = false
</text>

<text b_1>
/ items = ("B")
/ position = (60%, 45%)
/ erase = false
</text>

<text b_2>
/ items = ("B")
/ position = (80%, 45%)
/ erase = false
</text>

<text c_1>
/ items = ("C")
/ position = (20%, 45%)
/ erase = false
</text>

<text c_2>
/ items = ("C")
/ position = (20%, 55%)
/ erase = false
</text>

<text d_1>
/ items = ("D")
/ position = (40%, 55%)
/ erase = false
</text>

<text d_2>
/ items = ("D")
/ position = (60%, 55%)
/ erase = false
</text>


By tecnika - 4/25/2016

Hello!
Thank you for your reply!
I have tried to upload an image (D1,jpeg) as follow:

<values>
/ couple = ""
/ first = ""
/ second = ""
/ match = 0
/ matchcount = 0
</values>

<block myblock>
/ stop = [values.matchcount == 4]
/ trials = [1=select_1st]
/ timeout = 30000
</block>

<trial select_1st>
/ inputdevice = mouse
/ stimulusframes = [1=a_1,a_2,b_1,b_2,c_1,c_2,d_1,d_2]
/ validresponse = (a_1,a_2,b_1,b_2,c_1,c_2,d_1,d_2)
/ ontrialend = [values.first = trial.select_1st.response; values.couple = substring(values.first,0,2)]
/ branch = [trial.select_2nd]
</trial>

<trial select_2nd>
/ inputdevice = mouse
/ stimulusframes = [1=a_1,a_2,b_1,b_2,c_1,c_2,d_1,d_2]
/ validresponse = (a_1,a_2,b_1,b_2,c_1,c_2,d_1,d_2)
/ ontrialend = [values.second = trial.select_2nd.response]
/ ontrialend = [if(substring(values.first,0,2) == substring(values.second,0,2)) values.match = true else values.match = false]
/ ontrialend = [if (values.match && values.couple == "a_") {picture.a_1.item.1 = "√"; text.a_2.item.1 = "√"}
  else if (values.match && values.couple == "b_") {text.b_1.item.1 = "√"; text.b_2.item.1 = "√"}
  else if (values.match && values.couple == "c_") {text.c_1.item.1 = "√"; text.c_2.item.1 = "√"}
  else if (values.match && values.couple == "d_") {text.d_1.item.1 = "√"; text.d_2.item.1 = "√"};]
/ branch = [trial.select_1st]
</trial>

<picture a_1>
/ items = ("D1.jpg")
/ position = (40%, 45%)
/ erase = false
</picture>

<text a_2>
/ items = ("A")
/ position = (80%, 55%)
/ erase = false
</text>

<text b_1>
/ items = ("B")
/ position = (60%, 45%)
/ erase = false
</text>

<text b_2>
/ items = ("B")
/ position = (80%, 45%)
/ erase = false
</text>

<text c_1>
/ items = ("C")
/ position = (20%, 45%)
/ erase = false
</text>

<text c_2>
/ items = ("C")
/ position = (20%, 55%)
/ erase = false
</text>

<text d_1>
/ items = ("D")
/ position = (40%, 55%)
/ erase = false
</text>

<text d_2>
/ items = ("D")
/ position = (60%, 55%)
/ erase = false
</text>
______________________________________________________________________________

and I visualize the following error:
Unable to initialize <picture a_1> item number 1. Verify the item exists and is correctly defined.

The image is here below.
http://www.millisecond.com/forums/uploads/images/1a19af77-21a2-44d7-a266-fe77.jpg
Many thanks,

Elena


By Dave - 4/25/2016

The image needs to be called "D1.jpg" and located in the location as the script file. The result then is
https://www.millisecond.com/forums/uploads/images/43e39ce4-67ea-4196-96f3-827d.png

as it should be. You need to make other modifications to the script to have it work with images, however.

/ ontrialend = [if (values.match && values.couple == "a_") {picture.a_1.item.1 = "√"; text.a_2.item.1 = "√"}

obviously will not work with a <picture>. ""√" is not an image. Again, see scripts like the CCT in the library as examples. I'd also recommend working through the tutorials in the Inquisit documentation if you haven't done so already.

In short:

<values>
/ couple = ""
/ first = ""
/ second = ""
/ match = 0
/ matchcount = 0
</values>

<block myblock>
/ stop = [values.matchcount == 4]
/ trials = [1=select_1st]
/ timeout = 30000
</block>

<trial select_1st>
/ inputdevice = mouse
/ stimulusframes = [1=a_1,a_2,b_1,b_2,c_1,c_2,d_1,d_2]
/ validresponse = (a_1,a_2,b_1,b_2,c_1,c_2,d_1,d_2)
/ ontrialend = [values.first = trial.select_1st.response; values.couple = substring(values.first,0,2)]
/ branch = [trial.select_2nd]
</trial>

<trial select_2nd>
/ inputdevice = mouse
/ stimulusframes = [1=a_1,a_2,b_1,b_2,c_1,c_2,d_1,d_2]
/ validresponse = (a_1,a_2,b_1,b_2,c_1,c_2,d_1,d_2)
/ ontrialend = [values.second = trial.select_2nd.response]
/ ontrialend = [if(substring(values.first,0,2) == substring(values.second,0,2)) values.match = true else values.match = false]
/ ontrialend = [if (values.match && values.couple == "a_") {picture.a_1.item.1 = picture.checkmark.item.1; text.a_2.item.1 = "√"}
  else if (values.match && values.couple == "b_") {text.b_1.item.1 = "√"; text.b_2.item.1 = "√"}
  else if (values.match && values.couple == "c_") {text.c_1.item.1 = "√"; text.c_2.item.1 = "√"}
  else if (values.match && values.couple == "d_") {text.d_1.item.1 = "√"; text.d_2.item.1 = "√"};]
/ branch = [trial.select_1st]
</trial>

<picture a_1>
/ items = ("D1.jpg")
/ position = (40%, 45%)
/ size = (10%,10%)
/ erase = false
</picture>

<text a_2>
/ items = ("A")
/ position = (80%, 55%)
/ erase = false
</text>

<text b_1>
/ items = ("B")
/ position = (60%, 45%)
/ erase = false
</text>

<text b_2>
/ items = ("B")
/ position = (80%, 45%)
/ erase = false
</text>

<text c_1>
/ items = ("C")
/ position = (20%, 45%)
/ erase = false
</text>

<text c_2>
/ items = ("C")
/ position = (20%, 55%)
/ erase = false
</text>

<text d_1>
/ items = ("D")
/ position = (40%, 55%)
/ erase = false
</text>

<text d_2>
/ items = ("D")
/ position = (60%, 55%)
/ erase = false
</text>

<picture checkmark>
/ items = ("checkmark.png")
</picture>