Millisecond Forums

Showing feedback on highest/lowest joystick.x score

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

By knr - 5/19/2017

Hi,
I have a study where a video plays and after every second a recording is made of the joystick.x position.  This works fine, but now I'd like to add in at the end a readout to participants of their highest and lowest ratings.  However, whenever I try to do this, it only seems to report whatever the last position of the joystick is.  I'm sure that I'm missing something simple.

So far the working part looks like:


<trial 1sectrial>
/ inputdevice = joystick
/ timeout = 1000
/ validresponse = (left, right, noresponse)
/ ontrialend = [expressions.rating]
</trial>

<expressions>
/ rating = joystick.x
</expressions>

<block videoblock>
/ trials = [1-96 = 1sectrial]
/ bgstim = (video)
</block>

I've tried various uses of expressions/values but not sure what I would need to add to get the max/min out of those 96 trials.

Thanks in advance!!

By Dave - 5/19/2017

knr - Friday, May 19, 2017
Hi,
I have a study where a video plays and after every second a recording is made of the joystick.x position.  This works fine, but now I'd like to add in at the end a readout to participants of their highest and lowest ratings.  However, whenever I try to do this, it only seems to report whatever the last position of the joystick is.  I'm sure that I'm missing something simple.

So far the working part looks like:


<trial 1sectrial>
/ inputdevice = joystick
/ timeout = 1000
/ validresponse = (left, right, noresponse)
/ ontrialend = [expressions.rating]
</trial>

<expressions>
/ rating = joystick.x
</expressions>

<block videoblock>
/ trials = [1-96 = 1sectrial]
/ bgstim = (video)
</block>

I've tried various uses of expressions/values but not sure what I would need to add to get the max/min out of those 96 trials.

Thanks in advance!!


What you'll want to do is add the x position to a <list> at the end of each trial. I.e. at the end, the list will contain 96 items. You'll then have to sort  that list to find the maximum value recorded, similar to what's done to find a median value here: https://www.millisecond.com/forums/Topic14637.aspx

Under Inquisit 5 this would be easier: Here merely adding the observations to the <list> and then reading the list's maximum property would suffice: https://www.millisecond.com/forums/FindPost21609.aspx or https://www.millisecond.com/forums/FindPost20304.aspx (analogous example for the list's median property).

Hope this helps.
By knr - 5/23/2017

Dave - Friday, May 19, 2017
knr - Friday, May 19, 2017
Hi,
I have a study where a video plays and after every second a recording is made of the joystick.x position.  This works fine, but now I'd like to add in at the end a readout to participants of their highest and lowest ratings.  However, whenever I try to do this, it only seems to report whatever the last position of the joystick is.  I'm sure that I'm missing something simple.

So far the working part looks like:


<trial 1sectrial>
/ inputdevice = joystick
/ timeout = 1000
/ validresponse = (left, right, noresponse)
/ ontrialend = [expressions.rating]
</trial>

<expressions>
/ rating = joystick.x
</expressions>

<block videoblock>
/ trials = [1-96 = 1sectrial]
/ bgstim = (video)
</block>

I've tried various uses of expressions/values but not sure what I would need to add to get the max/min out of those 96 trials.

Thanks in advance!!


What you'll want to do is add the x position to a <list> at the end of each trial. I.e. at the end, the list will contain 96 items. You'll then have to sort  that list to find the maximum value recorded, similar to what's done to find a median value here: https://www.millisecond.com/forums/Topic14637.aspx

Under Inquisit 5 this would be easier: Here merely adding the observations to the <list> and then reading the list's maximum property would suffice: https://www.millisecond.com/forums/FindPost21609.aspx or https://www.millisecond.com/forums/FindPost20304.aspx (analogous example for the list's median property).

Hope this helps.

Ahhh thanks so much! I would never have gotten to this solution on my own!  Working perfectly now!