Howdy, Stranger!

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

Supported by

[open] Error during reopenning of a fonctional experiment

edited March 2016 in OpenSesame

Hi all,

I run on the last version of OpenSesame 3.0.6 with python 2.7.11 on mac capitan.

I coded my experiment and it works well, I have a good export file and the led on the trigger device show me that triggers are operational. But after saving and closing my experiment it's imposible to reopen the file.
This happend after adding few lines of code to add trigger in my recording data. With the old version of OpenSesame the error message said "Failed to parse line .... Is there a closing quotation missing?" and with the new version it say "Missing end block for multiline variable." (And in details : item-stack:``)

To reproduce I put in the following folder:
- the version ok (without the code of trigger)
- the version ko (with the code added, that I ran correctly but that I cant reopen)
- the code added in a .doc (green part is the code which created the error)

image

Somonene already meet this error ? Is it posible to fix / get around this problem ?
I apologize i'm a beginner and my code is probably not optimised.. (but it works usually)

Many thanks for your help,

Cheers,

Nadam

Comments

  • edited 2:12AM

    Hi Nadam,

    You can always extract your script from an .osexp file, because it is either a plain-text script (if no files in the pool) or a .tar.gz archive that you can open with tools like 7zip (if files in the pool). See here:

    In any case, I extracted the script, and you can find it here:

    The script is corrupt in a funny way, and I don't know what could have caused it. The problem: One block is not indented properly:

        if condition=='cong':
        trig_value='B'
    else:
        trig_value='C'
    
    trigger.write(trig_value) # pousse le trigger sur le boitier arduino
    

    This should be:

        if condition=='cong':
            trig_value='B'
        else:
            trig_value='C'
    
        trigger.write(trig_value) # pousse le trigger sur le boitier arduino
    

    That is, in OpenSesame script everything should be tab-indented at least one level deep. (This indentation will be removed when viewing the script as Python code in OpenSesame.)

    So you can just download the script from the link, fix the indentation in a text editor, and then open the script in OpenSesame.

    However, this shouldn't happen. Do you have any idea what caused the problem? Can you reproduce it? That way we can fix it, and avoid it from happening in the future.

    Cheers,
    Sebastiaan

  • edited 2:12AM

    Thanks a lot. The problem is solved. I don't understand what happened because this indentation error was invisible and the experiment ran before closing it. But I did copy-paste of the code (from the word document add to the folder).It's probably the source of this bug. Yes it's possible to reproduce the bug with the elements in the folder by adding the green code to the ok_version of my script. I did it a lot of time before to post this S.O.S.

    Thanks again for your reactivity and your interest.

    Nadam

  • edited 2:12AM

    That's interesting. My gut feeling is that the green text has some hidden control characters (to make it green) that cause the OpenSesame script to become corrupted. I'm going to look into it, and see how we can prevent this from happening.

  • edited 2:12AM

    I put the green color after meeting the problem, just for facilitate the reproduction, so I think there is hidden formatting, but not (or not only because of the color).

    I hope it will be helpfull for you.

Sign In or Register to comment.