Howdy, Stranger!

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

Supported by

How do I define a "correct mouse response" for OSweb?

As you can see in the attached image I'm trying to generate a reasoning task with multiple choices. However, I couldn't manage to define correct response for mouse. Could you help me, I need to define correct response for my analysis it, thanks already.


Peace,


Metin.

Comments

  • Hi @meto ,


    Could you upload the experiment?


    Cheers,


    Lotje

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

  • Hi Metin,

    When you mean define correct responses for mouse item, you don't mean the type of click you give, but the item that you select. Is that so? In this case, I think this tutorial of Lotje will be quite useful to you:

    Eduard

    Buy Me A Coffee

  • Hi dear @eduard, no I didn't mean region of interest. I meant correct response for my analysis. My experiment has 4 multiple choices, but only one of them is correct and I have to define the correct response. Thanks you for your interest. :)


    Peace,


    Metin

  • So, you mean, you need to define which of the four images is the one participants should click at?

    I guess the way to go is to define four fixed regions on the screen, and define which of the four is supposed to be the target. This you can easily do with the loop table with a variable that codes the correct field. Then, depending on the value for the correct variable, you assign the response alternatives to the fields, making sure that the correct alternative is presented at the location that is assgined as correct response.

    I haven't checked your code in detail, but the general idea makes sense. For each field define the edge points, and check whether a click falls within the edges. You'll have for fields to check, but as you defined the correct field beforehand, you will know whether to code a response as correct or incorrect depending on which field was clicked.

    Does that make sense?

    Eduard

    Buy Me A Coffee

  • I defined four images, participants are allowed to click any option they want. However, three of them are false answers and one of them is the correct answer.


    This task consist of 8 questions and the location of the options changes in every question

    Thanks,

    Metin

  • edited March 2021

    Hi @meto ,


    Your script looks good! :)


    You can do the following:

    • Add a column to your block_loop where you define the correct response. Note that, because "correct_response" is a built-in variable, you should use a different column header (I think OpenSesame will get confused when a mouse_response item has a string as correct response)
    • Define per trial which stimulus (resim1, resim2, resim3 or resim4) is the correct answer. Now your block_loop should look something like below (note that I I just chose random images as correct ones, so you'll have to adjust that):


    • Add a bit of code to the inline_javascript items to determine whether the currently checked image ROI contains the correct image. For example, in the item called 'option1', the code becomes (see line 16-21):
    vars.start_x_resim1_roi = vars.x_resim1 - (vars.w_resim1 / 2)
    vars.start_y_resim1_roi = vars.y_resim1 - (vars.h_resim1 / 2)
    vars.end_x_resim1_roi = vars.x_resim1 + (vars.w_resim1 / 2)
    vars.end_y_resim1_roi = vars.y_resim1 + (vars.h_resim1 / 2)
    
    if (
    vars.cursor_x >= vars.start_x_resim1_roi &
    vars.cursor_x < vars.end_x_resim1_roi &
    vars.cursor_y >= vars.start_y_resim1_roi &
    vars.cursor_y < vars.end_y_resim1_roi
    ){
    
    vars.resim1_clicked = "yes"
    
    
    // IF resim1 contains the correct answer
    // AND the participant clicked on this image,
    // set correct to 1
    if (vars.correct_picture == "resim1"){
        vars.correct = 1
        }
    
    
    }
    
    else
    {
    vars.resim1_clicked = "no"
    }
    
    console.log(vars.resim1_clicked)
    


    • The variable "correct" should now get the value 1 for correct responses and 0 for errors
    • Make sure to reset the variable correct to 0 for each trial. You can do this by appending another inline_javascript item to the trial_sequence and placing the following line in its Run tab:


    // Give the correct variable a starting value
    vars.correct = 0
    


    I attached an example (but as said before, please note that I didn't check the correct responses).


    Cheers,


    Lotje


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

  • edited March 2021

    PS: I noticed that your logger was not placed at the correct place in the overview area. You should log the responses at the end of every trial sequence. Otherwise, only the information from the last trial will be logged. I changed that in the above-attached experiment.

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

  • Thanks a lot @lvanderlinden for all of your helps. I did everything you said, including the 'logger' now the task runs smoothly and I can collect correct responses, thank you :)


    Peace,


    Metin

Sign In or Register to comment.