Howdy, Stranger!

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

Supported by

Register response with continuous trial

For a study I am compiling a CCPT task. However, it is not possible to register a response while the trial continues. Can anyone help with this?

Comments

  • edited March 2021

    Hi @guusG ,


    I ran your script and don't encounter any problems. If participants press the space bar, the variable 'response' gets the value "space". If participants withdraw from responding, the 'response' gets the value 'None'. (Note the capital, in your block_loop you wrote "none" instead of "None".)


    What issue are you referring to exactly?


    Cheers,


    Lotje

    Did you like my answer? Feel free to Buy Me A Coffee :)

  • edited March 2021

    Hi lvanderlinden , Lotje,

    I want stimuli with an interstimulus interval and in that fixed interstimulus interval it must be possible to register a response without disturbing the response length of the interval. In other words: How can I register a response without the trial actually stopping and the interval therefore remaining long?


    Note that it concerns an online study where inline coding cannot be used.


    Hopefully you can help me further!


    Thanks in advance.

  • Hi Guus,

    the solution would be to have following construction:

    • sketchpad 1
    • response_collection (mouse or keyboarD)
    • sketchpad 2

    Importantly, sketchpad 2 and sketchpad 1 should be identical visually. Then what you want to do is:

    • measure the time before stimulus presentation in sketchpad1
    • wait for a response, and measure the time again
    • compare response time to desired ISI, and set a new variable (e.g. post_response_interval)
    • use this variable as duration for the second sketchpad

    Does that make sense? Let us know if you need help implementing this.

    Eduard

    Buy Me A Coffee

  • edited March 2021

    Hi @eduard ,

    Thank you for taking the time to help me!

    I still can't manage it .. I have made your changes (see file). Would you like to see where I'm going wrong?

    Are you sure it is possible to make this adjustment for the OSweb version / online use?

    Kind regards, Guus



    P.S. I have little experience with the program so it may well be that I overlooked something simple... ;)

  • edited March 2021

    Hi @guusG ,


    With a little bit of JavaScript inline code you can calculate the duration of the second sketchpad:

    • Append an inline_javascript item after your keyboard_response item
    • Place the following code in its Run tab
    vars.duration_sketchpad2 = vars.ISI - vars.response_time
    
    • Use the square-bracket syntax to use the new duration for the second display
    • Use a feedback item (instead of a normal sketchpad) for the second display, because feedback items allow using variables that are defined only in the Run phase (instead of the Prepare phase) of your experiment, as is the case for response variables such as response time

    After doing so, your experimental overview should look something like this:



    I attached the modified experiment.


    For more information about using JavaScript in OSWeb, see:

    For more information about the difference between sketchpad and feedback items, see:


    Hope this helps!


    Cheers,


    Lotje


    Did you like my answer? Feel free to Buy Me A Coffee :)

  • Hi @lvanderlinden ,

    This really helps!

    Most times it works well, however he sometimes interrupts the task with the message "values should not be negative". How can I fix this? (It often occurs when I run the whole 'experimental cycle')

    Thanks in advance!

  • Hi,

    That's just because the response time is larger than the ISI. So either prevent that from happening (set a timeout for the keyboard response to the ISI, or accept that situation, but adapt the duration of the second sketchpad to be 0.

    vars.duration_sketchpad2 = vars.ISI - vars.response_time 
    if (vars.duration_sketchpad2 < 0){
        vars.duration_sketchpad2 = 0
    }
    
    

    Eduard

    Buy Me A Coffee

  • Hi @eduard ,


    Awesome thanks! It works in the OpenSesame environment now. On OSWeb I only get to see the text displays. Not the rest of the experiment. Any idea how I can fix this? Then everything would be resolved! :)

  • Hi @guusG ,


    I can't reproduce this issue with the version of your experiment that was posted here most recently. Could you upload the most recent version?


    Cheers,


    Lotje

    Did you like my answer? Feel free to Buy Me A Coffee :)

  • Hi Lotje,

    This is the latest version:


    Thanks!

  • Hi @guusG ,


    For me the experiment works fine, both when I do a test run in the browser and when I import it on JATOS. What do you mean exactly when you say


    On OSWeb I only get to see the text displays


    What displays do you see exactly, and which ones are skipped? There used to be an issue with an older version of OpenSesame where all loops with only one iteration were skipped. Could you make sure you are running OSWeb 1.3.13?


    Cheers,


    Lotje

    Did you like my answer? Feel free to Buy Me A Coffee :)

  • edited April 2021

    Hi @lvanderlinden ,

    Thank you very much for this tip! Looks like it works now. The version was not up to date.


    Thanks!

  • Great! Thanks for reporting back! :)

    Did you like my answer? Feel free to Buy Me A Coffee :)

Sign In or Register to comment.