Howdy, Stranger!

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

Supported by

cursor_roi does not exist

Hello everyone,

I am programming a memory game experiment for a tablet. I want to show three squares on a screen (one on top, two underneath). Then I want one of the bottom cards to display a visual stimulus (ie. apple), next I want the other bottom square to display another visual stimulus (ie. spoon), lastly the card on top should display either an apple or a spoon. To be clear this final sketch pad will have two identical blue squares on the bottom (as if these cards have been flipped over) and one card on top that displays a visual stimulus that matches one of the previously presented images (ie. apple or spoon). The participant should click on either the right or the left blue square based on what has previously been presented. I have this basic part running well in open sesame. I have named the two blue squares and open sesame logs which stimuli were displayed and which square was clicked on. The trouble is when I try to define the correct variable it tells me "cursor_roi" does not exist. Does anyone have any idea how to help me? Thank you so much in advance


Comments

  • Hi Mollie,

    It's difficult to tell without actually seeing the experiment script, but two possibilities come to mind:

    • You're running an older version of OpenSesame (≤ 3.1), in which this functionality wasn't yet available.
    • You're trying to set the correct variable before the user has actually given a response, and hence the cursor_roi variable hasn't yet been defined. For example, are you trying to do this in the Prepare rather than Run phase of an inline_script?

    Cheers!
    Sebastiaan

    There's much bigger issues in the world, I know. But I first have to take care of the world I know.
    cogsci.nl/smathot

  • Hi Sebastian!

    Thank you so much! I am trying to do it in prepare so that is probably the issue!! Thank you so much for your quick response.

    Best,
    Mollie

  • Hi Sebastian!

    Thanks so much again for your previous help! The experiment is working great and I have it running on the tablet too! I have a quick question. I would like to make sure that the correct answer (or the match) does not end up on the same side more than twice in a row. I have attached a picture of my table and how I have defined correct.

    Also, on the linked sketchpad which is the picture of the two bottom "cards" turned over and the top card revealed I have named the two cards "target_l" (meaning the square on the left) and 'target_r' (meaning the square on the right). Any insight you might have for me regarding this would be greatly appreciated. Thanks so much!

  • My experiment is similar and I was having a similar problem. I tried your fix, but all I get is a syntax error. I have a target picture and then 4 pictures along the bottom (emotion1, emotion2, emotion3, emotion4) which is selected by mouse response. I need it to run as a series of "if" statements such that if [emotion1] matches the target emotion and is selected by the
    participant, then it is marked correct, or if [emotion2] matches the target emotion and is selected by the participant, then it is marked correct, etc. But I can't figure out how to get this to work. I've tried


    if var.emotion1=='angry' and var.cursor_roi=='emotion1' or var.emotion2=='angry' and var.cursor_roi=='emotion2' or var.emotion3=='angry' and var.cursor_roi=='emotion3' or var.emotion4=='angry' and var.cursor_roi=='emotion4'
    var.correct=1
    else
    var.correct=0

    I've also tried
    if var.emotion1==var.target and var.cursor_roi=='emotion1' or var.emotion2==var.target and var.cursor_roi=='emotion2' or var.emotion3==[target] and var.cursor_roi=='emotion3' or var.emotion4==[target]' and var.cursor_roi=='emotion4'
    var.correct=1
    else
    var.correct=0

    The error I get is:
    item-stack: experiment[run].practice_loop[run].practice_sequence[prepare].anger_script_1[prepare]
    exception type: SyntaxError
    exception message: Failed to compile inline script
    item: anger_script_1
    code: if var.emotion1==var.target and var.cursor_roi=='emotion1' or var.emotion2==var.target and var.cursor_roi=='emotion2' or var.emotion3==[target] and var.cursor_roi=='emotion3' or var.emotion4==[target]' and var.cursor_roi=='emotion4'
    time: Thu Jan 24 18:02:29 2019
    phase: run
    line: 1

    I've also tried some other variations based on documents on open sesame. This one will mark emotion 1 as correct, but I can't get it to run with "or" statements between them.

    if self.get('emotion1') == 'angry':
    exp.set('correct_response', 1)
    if self.get('emotion2') == 'angry':
    exp.set('correct_response', 1)
    if self.get('emotion3') == 'angry':
    exp.set('correct_response', 1)
    if self.get('emotion4') == 'angry':
    exp.set('correct_response', 1)
    else:
    exp.set('correct_response', 0)

    Any ideas? I'm really struggling on this and programming is not one of my strengths!

  • Hi! I got my code to run exactly how I wanted it to using this code here:
    if var.left==var.target and var.cursor_roi=='target_l'or var.right==var.target and var.cursor_roi=='target_r':
    var.correct=1
    else:
    var.correct=0
    In your script I see a quotation mark after target that I don't think should be there. You are getting a syntax error so maybe that's it?

    **[target]' **and var.cursor_roi=='emotion4'

    Let me know! I'm a newbie programmer as well... I just happened to notice that!

Sign In or Register to comment.