Hi all,
I am using PsychoPy v2022.2.4 on macOS Ventura Catalina 10.15.7 (19H2026).
In my experiment, the participant has to study a concept and its definition, and can choose between three options: (1) re-read the concept and definition, (2) try to retrieve the definition by looking at the concept, and (3) rule out further studying that concept and move on to the next one. I have already managed it using several nested loops, but now I am faced with the difficulty of how to show the participant the following concept once once you have chosen the third option, that of discarding. I understand that I must include a small piece of code where a variable is created that allows me to increment it in each iteration of the loop, and that this variable should then be used to select the row of the conditions file that I use to present the stimuli (concepts and definitions ). I have tried it in the following way:
(1) in the code interface I have created a variable (it is called num_concept) at the “beginning of the experiment”, and I have given it the value of zero.
(2) I have increased this value by one in the “end of routine” part, with the following statement: concept_num+1.
(3) I have used this variable to select the row within the conditions file using “$num_concept”.
When I run the layout it gives me the following error:
File “/Users/mariadolores/Dropbox/doctorado UJA/psychopy/primer articulo/primer experimento/fase_aprendizaje/pruebas/contador_lastrun.py”, line 114, in
trialList=data.importConditions(‘conditions_2.csv’, selection=num_concept),
File “/Applications/PsychoPy.app/Contents/Resources/lib/python3.8/psychopy/data/utils.py”, line 457, in importConditions
elif len(selection) > 0:
TypeError: object of type ‘int’ has no len()
A greeting and thank you very much for the attention,
Miguel