Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Supported by

Conditioned 'If' particular response, present particular sketchpad in Open Sesame

edited January 2020 in OpenSesame

We are trying to present a conditioned (if) sketchpad after particular response on the keyboard, something like the feedback, but in this case, there are no correct, or incorrect responses. The response will only condition which is going to be the next sketchpad to be presented.

Should it be done with an inline_script should? what kind of script should I use?

What do you suggest me to do?

Thank you!

Comments

  • Hi,

    If the response is going to be used to indicate whether a sketchpad will be called or not, you should use the run_if field of that sketchpad (you can access if you click on the sequence in the overview area. Then all the items of that sequence will be shown in the main window). Set this run if field to whatever you want the response to be. For example, [response] = 'left', if the response has to be the left arrow key.

    Good luck,

    Eduard

    Buy Me A Coffee

  • edited January 2020

    Dear Edward,

    Thank you for your help, did you mean the "show_if" field, on the sketchpad? I have tried to use that field, but no success. I am using letters instead of arrows (z;x;c;b;n;m), so what I did was [response] = 'z','x','v' (for the left side responses. and [response] = 'b','n','m' (for the right side responses). I also tried using only one letter [response] = 'z' (for left side responses) and [response] = 'm' (for right side responses). I also modified that on the trial sequence.

    I am unsure about if the problem is because after one z, x, or c has been selected (left side) then a particular sketchpad should be called, and so on. Could it be the problem that different sketchpads are being called by the same instruction? for example 'z' or 'm'?


  • Hi,


    As mentioned, using feedback items instead of sketchpads does the trick. As an example, I changed the first sketchpad (If_Left_1) to a feedback item. Once changed it does work. Attached the experiment.

    [response] = 'z','x','v'

    This is not valid Python code. If you want to do that, you have to do this:

    [response] = 'z' or [response] = 'x' or [response] = 'v'

    maybe it also works if you write it like this:

    [response] in ('z','x','v')

    Does that help?

    Eduard

    Buy Me A Coffee

  • Dear Eduard,


    Yes, it worked,

    It is excellent, thank you, the flow now properly jumps to our desired feedback_item according to the pressed key. The only problem that now looks to happen, is that there seems to be a non programed delay between stimulus presentation, does that happen when using feedback_items?

    Thank you once again.

    Gilberto

  • Well, you have first a feedback item in your sequence, followed by a sketchpad item. The first one has a duration of 5000, the second of 0. Only after that there is a response item. So, that would mean you have to wait for that amount of time before you can respond. Is that not what you want? Other than that I don't see where a delay could come from


    Eduard

    Buy Me A Coffee

  • That is correct, but when the program is running there are unexpected delays to process the response (the feedback item does not come immediately after the response on the keyboard) maybe it is a particular problem on this computer, I will make tests in different ones.

    The original topic of this forum was successfully resolved thanks to your help!

    I appreciate your kind support.

    Thank you.

  • Hi,

    Do you mean there is a delay between the screen with "Would you..." in the middle and "improve your chances" on the left and "reduce your chances" on the right and the feedback item that follows ("How would you decide if...")? If so, I am confused, for me there is no delay there. As soon as one of the response keys was pressed, the feedback is shown.


    Eduard

    Buy Me A Coffee

  • Hello again,

    Sorry for my delay, we had to stop for a while, but the problem did patiently wait for us.

    Yes, we have a delay which reason I do not understand. If I choose the left buttons (z,x,c in this experiment) the feedback indeed comes immediately. But when I choose the right ones (b,n,m) it presents a delay that is not programed on the times for the feedback.

    We tried in different computer and had the same issue.

    I would appreciate if you can help us to identify something that causes this delay.

    Thank you!

    Gilberto

  • Hi Gilberto,

    I don't know whether this causes the issue that you describe, but you have basically a nested design: If the first question is answered with left, then ask a follow up on that, if that is answered with left again, ask another follow up. At the same time, you also want to check the alternative, so what happens if participants respond with right, but as the experiment sequence is linear it will first go through all the items that occur before the "if right" parts. SOme of them you correctly only show if the response is left, but others are always shown. Which basically, causes some delays for the right response only.

    Does that make sense?

    To fix that, you should try to fully embed the follow ups inside a separate sequence, or use inline_scripts to have more control. Also, keep in mind that every response item, will overwrite the variable [response], so by the time the first follow up has been answered, the response to the first question will be lost. To bypass this issue, you can probably use something like R2_response_key or something like that. Check your logfile there all the available variables are written.

    Good luck,

    Eduard

    Buy Me A Coffee

  • Dear Eduard,


    Your suggestions had been absolutely helpful!

    I was not able to figure out the reason of that delay, indeed, it was as you said, the solution was to condition the key response as well also condition the feedback. Now it properly jumps to the desired sketchpad with no delays.

    Appreciate your time and knowledge sharing.

    All the best!

Sign In or Register to comment.