Watts-Lab/surveyor

Survey REI Is Not Working

sumants-dev opened this issue · 2 comments

https://surveyor.seas.upenn.edu/s/?url=https://raw.githubusercontent.com/Watts-Lab/surveyor/main/surveys/REI.csv is bugging out in my test run. It seems to be a csv problem.

CsvError: Invalid Record Length: columns length is 5, got 4 on line 2
    at Parser.__onRecord (/home/sumants/watts/surveyor/node_modules/csv-parse/lib/index.js:783:9)
    at Parser.__parse (/home/sumants/watts/surveyor/node_modules/csv-parse/lib/index.js:662:38)
    at Parser._transform (/home/sumants/watts/surveyor/node_modules/csv-parse/lib/index.js:472:22)
    at Parser.Transform._write (node:internal/streams/transform:184:23)
    at writeOrBuffer (node:internal/streams/writable:389:12)
    at _write (node:internal/streams/writable:330:10)
    at Parser.Writable.write (node:internal/streams/writable:334:10)
    at Immediate._onImmediate (/home/sumants/watts/surveyor/node_modules/csv-parse/lib/index.js:1185:16)
    at processImmediate (node:internal/timers:464:21) {
  code: 'CSV_RECORD_DONT_MATCH_COLUMNS_LENGTH',
  comment_lines: 0,
  empty_lines: 0,
  invalid_field_length: 0,
  lines: 2,
  records: 0,
  columns: [
    { name: 'name' },
    { name: 'prompt' },
    { name: 'response' },
    { name: 'group_prompt' },
    { name: 'coding' }
  ],
  error: undefined,
  header: false,
  index: 4,
  column: 'coding',
  quoting: false,
  record: [
    'thinking',
    "I don't like to have to do a lot of thinking.",
    'Completely false | Mostly false | Neither true nor false | Mostly true | Completely True',
    'Please rate how true the following statement is of you.'
  ]
}

@markwhiting Some coding columns are empty. What would the resolution be here?

It looks like there's a missing ',' at the end of line 2 in the csv.

I'm on a train now, so feel free to add it in and commit.