Howdy, Stranger!

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

Supported by

inline script-feedback gone bad..

Hello! I would like to replicate the classic experiment of Sternberg during which the participant is presented with a list of numbers (digits 1 to 10). The list can contain either 1,2,3,4,5 or 6 numbers and after the presentation another number is given and the participant has to reply whether this new number was in the list or not__. My major trouble is with the feedback because for some reason it always gives output 'incorrect'. Also is there a way to randomly intermix trials with different size-lists? __Thanks on advance,
friendly
Maria

Comments

  • here is the script

  • Hi Maria,

    I've checked your experiment and the issue was mostly due to the incorrect way of accessing variabels. You were using an older method of referring to variables (e.g. self.get("variable") should be var.variable). See the documentation for more info:

    Furthermore, there was an issue with your if / and statement. This version of your feedback should work now:

    In prepare:

    from openexp.canvas import canvas
    
    my_canvas = canvas(exp)
    my_canvas.text('correct! ')
    
    my_canvas1 = canvas(exp)
    my_canvas1.text('incorrect! ')
    

    In run:

    if var.numbers == var.test_numbers  and var.response == 'y':
        my_canvas.show()
        self.sleep(1000)
    elif var.numbers != var.test_numbers and var.response == 'n': 
        my_canvas.show()
        self.sleep(1000)
    else:
        my_canvas1.show()
        self.sleep(1000)
    

    Regarding your second question, yes this would possible but it will require quite some scripting. Alternatively, you could make different loop/sequences for every list size. Maybe it is best to walkthrough the advanced tutorial, with steps 9 and 10 being the most relevant for your experiment.

    Good luck!

    Laurent

  • Thank you very much it worked fine!!

Sign In or Register to comment.