Millisecond Forums

Bug: responseinterrupt in combination with list

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

By Lizeroo - 3/29/2023

Hi! 
I wanted to let you know about a potential bug.
I have a trial in which the valid response options are any of a set of pictures (they look like buttons but are picture elements).

When I use the list element to store the pictures and then refer to the list in the /validresponse subcommand, I have to double-click on a picture to interrupt (end) the trial.
In contrast, when I list each picture element separately in the /validresponse subcommand, I need only click once on a picture to interrupt (end) the trial.

I don't think that it should work that way.

Also, I have a question. Is there a relatively easy way to "animate" the picture element when it is clicked on (i.e., to acknowledge the mouse click)?

Thank you!
By Dave - 3/29/2023

Liz Shulman - 3/29/2023
Hi! 
I wanted to let you know about a potential bug.
I have a trial in which the valid response options are any of a set of pictures (they look like buttons but are picture elements).

When I use the list element to store the pictures and then refer to the list in the /validresponse subcommand, I have to double-click on a picture to interrupt (end) the trial.
In contrast, when I list each picture element separately in the /validresponse subcommand, I need only click once on a picture to interrupt (end) the trial.

I don't think that it should work that way.

Also, I have a question. Is there a relatively easy way to "animate" the picture element when it is clicked on (i.e., to acknowledge the mouse click)?

Thank you!

(1) Can you provide example code illustrating the issue? Ii's not entirely clear what "[w]hen I use the list element to store the pictures and then refer to the list in the /validresponse subcommand" means, this could look a number of different ways.

(2) Regarding changing the image in some way to acknowledge the click, you'll want to look at using /responsemessage.
By Lizeroo - 3/29/2023

Dave - 3/29/2023
Liz Shulman - 3/29/2023
Hi! 
I wanted to let you know about a potential bug.
I have a trial in which the valid response options are any of a set of pictures (they look like buttons but are picture elements).

When I use the list element to store the pictures and then refer to the list in the /validresponse subcommand, I have to double-click on a picture to interrupt (end) the trial.
In contrast, when I list each picture element separately in the /validresponse subcommand, I need only click once on a picture to interrupt (end) the trial.

I don't think that it should work that way.

Also, I have a question. Is there a relatively easy way to "animate" the picture element when it is clicked on (i.e., to acknowledge the mouse click)?

Thank you!

(1) Can you provide example code illustrating the issue? Ii's not entirely clear what "[w]hen I use the list element to store the pictures and then refer to the list in the /validresponse subcommand" means, this could look a number of different ways.

(2) Regarding changing the image in some way to acknowledge the click, you'll want to look at using /responsemessage.

Here are the relevant code snippets:




********************************************
********* Single Click Works ***************


<trial LadderA>    
/ skip = [values.ageyr >17]
/ pretrialpause = 500
/ inputdevice = mouse    
/ stimulusframes = [1=ladderAfam, skip
rung01, rung02, rung03, rung04, rung05,
rung06, rung07, rung08, rung09, rung10]        
/ validresponse = (picture.skip,
picture.rung01,
picture.rung02,
picture.rung03,
picture.rung04,
picture.rung05,
picture.rung06,
picture.rung07,
picture.rung08,
picture.rung09,
picture.rung10
)
/ responseinterrupt = immediate    
/ timeout = 240000        
/ ontrialend = [
    trial.LadderSocial;
    values.ladderAresponse = trial.LadderA.response
    ]
</trial>


********* Using a list to store the validresponse pictures...
********* Display is identical***************
********* But a double-click is required to end the trial
********* I believe the data are recoded on the first click, but the response doesn't interrupt the trial until you double-click.

<list rungs>
/items = (picture.skip
picture.rung01
picture.rung02
picture.rung03
picture.rung04
picture.rung05
picture.rung06
picture.rung07
picture.rung08
picture.rung09
picture.rung10)
</list>

<trial LadderA>    
/ skip = [values.ageyr >17]
/ pretrialpause = 500
/ inputdevice = mouse    
/ stimulusframes = [1=ladderAfam, skip
rung01, rung02, rung03, rung04, rung05,
rung06, rung07, rung08, rung09, rung10]        
/ validresponse = (list.rungs)
/ responseinterrupt = immediate    
/ timeout = 240000        
/ ontrialend = [
    trial.LadderSocial;
    values.ladderAresponse = trial.LadderA.response
    ]
</trial>
By Dave - 3/29/2023

Liz Shulman - 3/29/2023
Dave - 3/29/2023
Liz Shulman - 3/29/2023
Hi! 
I wanted to let you know about a potential bug.
I have a trial in which the valid response options are any of a set of pictures (they look like buttons but are picture elements).

When I use the list element to store the pictures and then refer to the list in the /validresponse subcommand, I have to double-click on a picture to interrupt (end) the trial.
In contrast, when I list each picture element separately in the /validresponse subcommand, I need only click once on a picture to interrupt (end) the trial.

I don't think that it should work that way.

Also, I have a question. Is there a relatively easy way to "animate" the picture element when it is clicked on (i.e., to acknowledge the mouse click)?

Thank you!

(1) Can you provide example code illustrating the issue? Ii's not entirely clear what "[w]hen I use the list element to store the pictures and then refer to the list in the /validresponse subcommand" means, this could look a number of different ways.

(2) Regarding changing the image in some way to acknowledge the click, you'll want to look at using /responsemessage.

Here are the relevant code snippets:




********************************************
********* Single Click Works ***************


<trial LadderA>    
/ skip = [values.ageyr >17]
/ pretrialpause = 500
/ inputdevice = mouse    
/ stimulusframes = [1=ladderAfam, skip
rung01, rung02, rung03, rung04, rung05,
rung06, rung07, rung08, rung09, rung10]        
/ validresponse = (picture.skip,
picture.rung01,
picture.rung02,
picture.rung03,
picture.rung04,
picture.rung05,
picture.rung06,
picture.rung07,
picture.rung08,
picture.rung09,
picture.rung10
)
/ responseinterrupt = immediate    
/ timeout = 240000        
/ ontrialend = [
    trial.LadderSocial;
    values.ladderAresponse = trial.LadderA.response
    ]
</trial>


********* Using a list to store the validresponse pictures...
********* Display is identical***************
********* But a double-click is required to end the trial
********* I believe the data are recoded on the first click, but the response doesn't interrupt the trial until you double-click.

<list rungs>
/items = (picture.skip
picture.rung01
picture.rung02
picture.rung03
picture.rung04
picture.rung05
picture.rung06
picture.rung07
picture.rung08
picture.rung09
picture.rung10)
</list>

<trial LadderA>    
/ skip = [values.ageyr >17]
/ pretrialpause = 500
/ inputdevice = mouse    
/ stimulusframes = [1=ladderAfam, skip
rung01, rung02, rung03, rung04, rung05,
rung06, rung07, rung08, rung09, rung10]        
/ validresponse = (list.rungs)
/ responseinterrupt = immediate    
/ timeout = 240000        
/ ontrialend = [
    trial.LadderSocial;
    values.ladderAresponse = trial.LadderA.response
    ]
</trial>

Thank you for the example. I think there is a misconception here.

This

<trial LadderA> 
/ skip = [values.ageyr >17]
/ pretrialpause = 500
/ inputdevice = mouse 
/ stimulusframes = [1=ladderAfam, skip
rung01, rung02, rung03, rung04, rung05,
rung06, rung07, rung08, rung09, rung10]  
/ validresponse = (list.rungs)
/ responseinterrupt = immediate 
/ timeout = 240000  
/ ontrialend = [
  trial.LadderSocial;
  values.ladderAresponse = trial.LadderA.response
  ]
</trial>

is not, in fact, equivalent to

<trial LadderA> 
/ skip = [values.ageyr >17]
/ pretrialpause = 500
/ inputdevice = mouse 
/ stimulusframes = [1=ladderAfam, skip
rung01, rung02, rung03, rung04, rung05,
rung06, rung07, rung08, rung09, rung10]  
/ validresponse = (picture.skip,
picture.rung01,
picture.rung02,
picture.rung03,
picture.rung04,
picture.rung05,
picture.rung06,
picture.rung07,
picture.rung08,
picture.rung09,
picture.rung10
)

/ responseinterrupt = immediate 
/ timeout = 240000  
/ ontrialend = [
  trial.LadderSocial;
  values.ladderAresponse = trial.LadderA.response
  ]
</trial>

/ validresponse = (list.rungs) just means the list is queried when some response occurs. That does not mean the list will happen to return the object that happens to match the response at that point. In other words,

/ validresponse = (list.rungs) does not expand to /validresponse = (picture.skip, picture.rung01, picture.rung02, ..., picture.rung10)

If you wanted to do that, you would have to actually reference the specific items on the list. I.e.

<list mylist>
/ items = (text.a, text.b, text.c)
</list>

<trial mytrial>
/ posttrialpause = 500
/ stimulusframes = [1=a,b,c]
/ inputdevice = mouse
/ validresponse = (list.mylist.items.1, list.mylist.items.2, list.mylist.items.3)
</trial>

<text a>
/ items = ("A")
/ position = (45%, 50%)
</text>

<text b>
/ items = ("B")
/ position = (50%, 50%)
</text>

<text c>
/ items = ("C")
/ position = (55%, 50%)
</text>