Branch attribute not working after replacing response keys with pictures for mouse/touchscreen input...


Author
Message
anmc
anmc
New Member (29 reputation)New Member (29 reputation)New Member (29 reputation)New Member (29 reputation)New Member (29 reputation)New Member (29 reputation)New Member (29 reputation)New Member (29 reputation)New Member (29 reputation)
Group: Forum Members
Posts: 4, Visits: 112
Hello! 
I am currently modifying a script to work on touchscreens that was originally made for keyboard input. Although I don't have the possibility to directly test on a touchscreen at this moment, I understand that everything that works with mouse input should translate to touchscreens. Is this correct or do I have to make any additional adjustments?

Now to my current issue: There is one trial that contains a branch attribute. Basically, if the space bar is pressed, go to the next instruction video, if enter is pressed, go to a trial that plays the previous instruction video. This is how the trial looks for keyboard input: 

<trial video_bereit>
/ stimulustimes = [0=video_bereit]
/ validresponse = (28,57)
/ branch = [if (trial.video_bereit.response== 28) trial.wiederholung]
</trial>

This works without issues. For touchscreens, I just created pictures to replace the space and enter keys. So far I did not have any problems by just replacing keys with pictures for input, but unfortunately the following branch attribute does not actually branch to trial.wiederholung. 

<trial video_bereit>
/ stimulustimes = [0=video_bereit, picture.space, picture.enter]
/ validresponse = (picture.space, picture.enter)
/ branch = [if (trial.video_bereit.response == picture.enter) trial.wiederholung]
</trial>

Although the data file shows the correct input (enter), it does not branch to trial.wiederholung, but simply continues in the same way as after clicking on picture.space.

Any ideas as to why this does not work?

Thanks in advance!
Patrick
Dave
Dave
Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)
Group: Administrators
Posts: 12K, Visits: 100K
anmc - 5/30/2024
Hello! 
I am currently modifying a script to work on touchscreens that was originally made for keyboard input. Although I don't have the possibility to directly test on a touchscreen at this moment, I understand that everything that works with mouse input should translate to touchscreens. Is this correct or do I have to make any additional adjustments?

Now to my current issue: There is one trial that contains a branch attribute. Basically, if the space bar is pressed, go to the next instruction video, if enter is pressed, go to a trial that plays the previous instruction video. This is how the trial looks for keyboard input: 

<trial video_bereit>
/ stimulustimes = [0=video_bereit]
/ validresponse = (28,57)
/ branch = [if (trial.video_bereit.response== 28) trial.wiederholung]
</trial>

This works without issues. For touchscreens, I just created pictures to replace the space and enter keys. So far I did not have any problems by just replacing keys with pictures for input, but unfortunately the following branch attribute does not actually branch to trial.wiederholung. 

<trial video_bereit>
/ stimulustimes = [0=video_bereit, picture.space, picture.enter]
/ validresponse = (picture.space, picture.enter)
/ branch = [if (trial.video_bereit.response == picture.enter) trial.wiederholung]
</trial>

Although the data file shows the correct input (enter), it does not branch to trial.wiederholung, but simply continues in the same way as after clicking on picture.space.

Any ideas as to why this does not work?

Thanks in advance!
Patrick

You'll need double-quotes, the response is a string.

/ branch = [if (trial.video_bereit.response == "enter") trial.wiederholung]

anmc
anmc
New Member (29 reputation)New Member (29 reputation)New Member (29 reputation)New Member (29 reputation)New Member (29 reputation)New Member (29 reputation)New Member (29 reputation)New Member (29 reputation)New Member (29 reputation)
Group: Forum Members
Posts: 4, Visits: 112
Thanks, it worked! 
GO

Merge Selected

Merge into selected topic...



Merge into merge target...



Merge into a specific topic ID...




Reading This Topic

Explore
Messages
Mentions
Search