I’m working on a staircase paradigm I’m trying to get to run for online testing. Each participant does two blocks where they start from above and below threshold. The aim is to see whether the two staircases converge.
I would like to randomise where participants start from for each gender. So I have a file ‘Participants.csv’ where I store the gender of all participants who do the study. If the number of all females/males who did the study is divisible by 2, they start above, otherwise they start below.
My implementation works in Python, but I’m not sure how to translate the code below to JavaScript.
Can anyone help with translating this code to JavaScript?
Participants = open('Participants.csv', 'a')
Participants.write(Gender_key_resp.keys+'\n')
Participants.close()
Participants = open('Participants.csv', 'r')
Ppts_allLines = Participants.readlines()
Participants.close()