Customise trigger value in a loop
Hello!
I am designing an EEG experiment on OpenSesame, and I am having trouble with getting some of my triggers to send.
What I am trying to do is send a trigger after a rating scale value has been provided, and would like the value of the trigger to depend on the value that was provided in the rating scale. The issue seems to be that the rating scale value isn't saving, meaning that the trigger equation is incomplete and the trigger doesn't get sent.
This is all happening within a sequence, where music is being played, followed by the rating scale, followed by a trigger indicating that a scale had just been completed
Here is the inline script code I are using to send the trigger:
global io var.condition = self.get("condition") var.rating_Q1 = self.get("rating_Q1") trigger= var.condition + 3 + var.rating_Q1 port = 0x378 pport.Out32(port, trigger)
'condition' is a predefined variable whose value changes depending on which condition it loops through from an Excel sheet (this works fine).
The variable 'rating_Q1' doesn't appear to be saving the value provided in the rating scale, and instead appears as a NoneType. It was defined in a form base plugin as follows:
widget 0 5 6 1 rating_scale nodes="1;2;3;4;5;6" var=rating_Q1
Does anyone know why the rating variable is not saving the value? Is it because everything is happening within a loop sequence?
I hope this question makes sense. I'm happy to provide more information
I am using a Windows computer, OpenSesame version 3.3.8.
Thanks in advance!
Best,
Sarah
Comments
Hi @Sarah ,
Did you make sure that the Python inline script is put in the
Run_tab
of aninline_script
item that appears after theform_base
item?If this doesn't solve the issue, could you upload your experiment here?
Cheers,
Lotje
Did you like my answer? Feel free to
Hi @lvanderlinden ,
Thank you for your quick response.
We had already tried both of what you suggested and we still get the same issue. I can't attach the experiment because I get a 413 error, so I've emailed it to you.
You will see that we actually have 2 questions in our second loop (rating_Q1 and rating_Q2), both of which have a similar trigger equation to what I mentioned before. I should also mention that the trigger for Q1 did sometimes work and other times stopped working (we can't figure out why), but the trigger for Q2 never worked.
Thank you for your help!
Best,
Sarah