Howdy, Stranger!

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

Supported by

attentional blink with emotional pictures

Hello again! I am trying to build an attentional blink experiment with images and used the script from the tutorial along with some other amendments but i keep getting the error : 'IOError: The picture file 'c' does not exist'. I checked if the images are in the pool and they certainly are since it shows me the path in the debugg window so what is going on? Thanks on advance.

Comments

  • Hi Maria,

    Instead of adding images to your stimulus list like that : images_list += random.choice(list), try this:
    images_list.append(random.choice(list)). I think doing it your way treats the stimuli as strings rather as a list object.

    Can you confirm that this solves the issue?

    Thanks,

    Eduard

    Buy Me A Coffee

  • edited January 2017

    It worked! But now i am having trouble to set a correct response since it is based on some conditions. I need to log the correctness of the answer in every trial so that i have the variable "correct" with it's values in every trial in the final log file, but i am getting the error "NameError: name 'correct' is not defined".
    I used that code in every inline script i am using as a trial, to set the correctness of a response:

    if target == target1:
        if self.experiment.get('response') =='z':
            self.experiment.set('correct', True)
    
        elif self.experiment.get('response') =='m':
            self.experiment.set('correct',  False)
    
    else:
        if self.experiment.get('response') =='m':
            self.experiment.set('correct', True)
    
        elif self.experiment.get('response') =='z':
            self.experiment.set('correct',False)
    
    

    and this code (also in every inline script) to log the things i need but correctness can't be logged.

    self.experiment.log('response = %s' % key)
    self.experiment.log ('lag = %s' % target_pos)
    self.experiment.log ('correct = %s' % correct)

    Any advice on that? Thanks again, I am really new to programming with python.

  • I can't tell you where your mistake is because I don't know enough about your script. However, the error that you get appears due to some of the if-else statements not being executed (I guess). For example, if the variable response is never 'z' or 'm' then the variable correct will never exist. So, what you need to do is using print statements to check which values ypur variables have and which of your if statements are actually executed. Eventually, you should find out what is going wrong.

    Does this make sense,

    Eduard

    Buy Me A Coffee

  • I figured i should give 'correct' a value after every if statement and set response_correct at the end of all the statements. It worked :)

  • Hi again! Can anyone tell me what is the analogue of duration "keypress" (e.g. in a sketchpad with a fixation dot) for a canvas of inline script? I need to insert a break between my loops and i want everything to be able to pause until a keypress is made.. Thank you!

  • edited January 2017

    Hi Maria,

    Here you go:

    # this script is written for opensesame versions < 3.0
    from openexp.keyboard import keyboard # import keyboard module
    kb = keyboard(exp) # open a connection to the keyboard
    k,t = kb.get_key(keylist = ['z','m']) # wait for response
    

    Eduard

    Buy Me A Coffee

  • Thanks! I considered using the "pause o.s." command but it seemed too drastic :D

Sign In or Register to comment.