I’m running PsychoPy 1.85.4. on OS High Sierra, using the Builder.
In my experiment, participants see videos and have to rate them as either being shorter or longer (temporal bisection task).
In the training phase, they see some videos, rate them and get direct feedback if they were correct or wrong in their answers. This works fine.
However, I also want to include a conditional looping, where they have to repeat the training session if they had less than a certain percentage of correct answers before continuing with the probe phase.
I looked up the previous topics regarding this task, but the experiment still doesn’t repeat the loop (set the threshold to 95%, still it just goes to the probe phase without repetition)
I designed the experiment as follows
Hi Vau, you should insert some (temporary) debugging code so you can monitor what is happening. e.g. sprinkle some print() statements at appropriate places so you can see how values change from trial to trial:
It’s not the specific number at issue here, but that a loop is not a number, so it can never be equal to a number. A loop is an object which is actually a collection of different things.
In programming languages, we have to be careful to only compare things of the same type
In an analogous fashion in the real world, it makes sense to ask “is this dog a labrador” but not “is this dog the square root of two”?
It might be that you are actually wanting to compare to a specific property of a loop, which is itself a number. e.g. loops have a trial counter, so a valid comparison would be to such a specific property of a loop:
# this is valid, as this specific property of a loop is an an integer:
if training_loop.thisN == 11:
# do something
# this is not a valid comparison, as a loop is a complex object called a `TrialHandler`, not an integer:
if training_loop == 11: # will always be false
# this will never do anything
Hi Michael
this may sound like a stupid question but it’s not clear to me where in the builder do I have to insert the debugging code?
I don’t have prior experience with programming language.
I’m still working with the builder, I set up my whole experiment in it, will still have to make some adjustments afterwards regarding time, files etc. and just wonder if it’s better to switch to the coder for the rest?