Changes in the code not saved in the builder

Hello, I have designed an experiment with the Builder, structured in two types of blocks, which I did following the instrcutions on the Psychopy manual.
The experiment works, but it only saves the the block data, and not trail-by-trial data. I looked at the code and saw that there was an incorrect indentation, i.e., the thisExp.nextEntry() line outside the trial routine, so I made the appropriate change in the code (idented the line within the trial routine)
(by clicking Compile to Script). If I then start the experiment from the coder interface, the data are all saved as it should be - trial-by-trial - but if run it from the builder it looks like the changes made straight into the code are ignored, and so the trial-by-trial data are not save any more. If I close the files and open them again, the changes made to the code are all gone.
Can anybody help?
And I don’t understand why, independently on the code, in the original builder version there is that indentation error with the thisExp.nextEntry() line.

I can provide the file.

Any help really appreciated.

1 Like

One of the reasons I don’t use the coder is because it’s a one-way process. If you use Builder and then make an edit in the coder, that edit won’t be transferred back. If your Builder version isn’t saving trial by trial data then it should be possible to fix that within the Builder.

1 Like

Well the solution would be to run the experiment from the coder window all the time - and never compile from the builder - or from the cmd window. However, I want to fix this problem with the trial data not being recorded in the data file, as the experiment will be ran by 1st year students, and it would be much simpler to let them use the Builder interface.

Could you share the .psyexp file? I’d like to investigate this indentation error further. In the meantime, you can inject code using a Code Component, would this be a solution for the time being? You could add some code to save the data trial-by-trial that way

hi, thanks for you reply.
I have enclosed the file. In the code, line 330 should be within the trial for loop, right? As it is now, when I run it it does not save trial information in the file. When I ident that line, it does. I guess I have done something wrong when structuring blocks and trial in the builder.
I am not sure what you mean by “using a Code Component”. What I am doing to run the experiment is just by starting the py file from the cmd window, or run it in Psychopy from the code script view.
But this is an experiment for students and it would be much easier for them to start it from the builder interface.PosnerFirstBlocks.psyexp (11.8 KB)

Ahh, I see the problem! That should technically be inside the trials loop and the blocks loop. In Builder when you create the loop, the is trials option determines whether or not to include thisExp.nextEntry() for each repetition of the loop. You’ve got it ticked for block but not trials, when in your design it should be ticked for both. If you tick it for trials too and click compile then the line will appear in the place you intended.

Fantastic, that now works!
Thank you very much!