IndentationError:
Hi! Im very new in OpenSesame and Python, so please, be patient with me.
Im traying to follow the steps in the video that talks about Counterbalancing but Im stuck with IndetationError.
Can someone helping to undeerstand what is happening¿?
Thanks!


Comments
Hi Atenas,
An indentation error happens when you have not properly indicated the structure of your code using indentation (tab or spaces at the start of a line). This is a fundamental property of Python, so if you feel that you don't have a clear grasp on indentation, then I would first take a step back and start a basic Python tutorial. That will save you a lot of time and frustration later!
Cheers!
Sebastiaan
Check out SigmundAI.eu for our OpenSesame AI assistant!
Hi, Sebastian.
Thanks a lot for your help!. I´m very grateful for OpenSesame. I´m from México, my university doesn´t have economic resources to acquires softwares like e-prime. So OpenSesame is saving me and making my life so much easier.
Have a good day!
Hi, again, @sebastiaan !
So, I finally could got the counterbalancing, just like the tutorial shows. But:
I have four blocks in total, I need that the first block runs across all the participants (Loop_NoT), the next three are the blocks where I putted the inline_script to get the counterbalance, but, with this code all the blocks runs across the participants. I need just one of the three blocks runs:
e.g:
Participant 1 : Loop_ Not and b1 but I don´t want to run the block 2 and 3.
Participant 2 : Loop_ Not and b2 but I don´t want to run the block 1 and 3
and so on,
¿what do I need to modify?
Thanks,
.
Hi Atena,
It looks like you're counterbalancing the order of the blocks right now (and not which participant does which block) although the details are a bit difficult to tell from your screenshot. I'm assuming that you have three blocks, and three groups of participants, and that you want to counterbalance like this:
Right?
In that case, you can simplify the structure quite a bit, and put the blocks directly into the experiment sequence. And then you can use a Run If statement that checks the subject number and determines which block should be executed. So the structure would look something like this:
Note a few things:
var.[name], rather thanself.get().%) operator gives the remainder of an integer division. This is useful for doing cyclical things like counterbalancing.Cheers!
Sebastiaan
Check out SigmundAI.eu for our OpenSesame AI assistant!
Right! Thanks a lot for your time, @sebastiaan !
After many try I got it!
So, I gonna let the printscreen if someone like me without experience with codes see this post.
The best way to understand Sebastian´s explanation is consulting this two things:
https://osdoc.cogsci.nl/3.2/manual/structure/sequence/
https://osdoc.cogsci.nl/3.2/manual/variables/#using-conditional-if-statements
And the result looks something like this:

Thanks!