Unfortunately, my online experiment does not run as I get the error message "
- ReferenceError: get_file_name is not defined
def get_file_name(code_text, csv_file_path):
with open(csv_file_path, 'r') as file:
lines = file.readlines()
header = lines.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:
I don’t think JS understands “with x as y”. Also, I don’t think your code will work online.
Have a look at my Moving Cue and Trial Switching online demos for how to load a spreadsheet in a code component online.