Columns in generated data file empty

Dear Forum,
The data files of my experiment do not generate the wanted output:

  1. The data files only show two trials even if I did more than two.
  2. The columns of the variables which need to be stored are empty.

The problem might be the loop since I have three different conditions (2 visual stimuli, 3 visual stimuli and 4 visual stimuli) which are randomized within the loop.

I am grateful for any help on how I can add all data to the data file.

trialsloop.py (147.6 KB)