Unfortunately, my online experiment does not run as I get the error message "
- ReferenceError: get_file_name is not defined
In Psychopy it seems that the Python code is not translatable to JavaScript. Does anyone have a hint what is wrong here?
def get_file_name(code_text, csv_file_path):
with open(csv_file_path, 'r') as file:
lines = file.readlines()
header = lines[0].strip().split(',')
vp_code_index = get_column_index(header, "part_code")
file_index = get_column_index(header, "file")
for line in lines[1:]:
row = line.strip().split(',')
if row[code_index] == code_text:
return row[file_index]
return None