How to use .txt file to assign order to stimuli presentation?
I am a beginner at Python. I am trying to create an experiment with a training/priming phase, and then a forced choice testing phase.
For the training phase, I have a .txt file that contains a "template" (a list of 700+ items) for the ordering of my stimuli. During the training phase, the participants will see a sequence of eight (8) randomised words individually, but over 700 times within a fixed order as laid out by the template.
The template is kind of like so:
What I need to do is randomise the word list and reassign the corresponding template items for each participant. For example, with the words orange, green, and blue; participant 1 one would have [a0] = orange, [a1] = green, [a2] = blue, participant 2 would have [a0] = blue, [a1] = orange, and [a2] = green.
So far in the prepare phase of an inline_script I have to import my .txt file:
import numpy as np
nonword_train = np.loadtxt(exp.get_file("training_template.txt"), dtype=str)
I apologise if this is not very clear. I would appreciate any help as I am quite lost.