Resp.corr is not defined; correctAns not retrieved from Conditions.xlsx

URL of experiment: https://gitlab.pavlovia.org/jhilgard/maximum_emotion_stroop

Description of the problem:
Keyboard objects practice1_resp and practice2_resp retrieve a column “correctAns” from their respective conditions files. These work just fine in Python, and I am able to use inline code to check the value of practice1_resp.corr and practice2_resp.corr to provide appropriate feedback.

However, when I compile to JavaScript and pilot the script on Pavlovia, correctAns is now undefined and so too is practice1_resp.corr and practice2_resp.corr.

Here’s the code in Python:

msg = "Outcome: " + msg + "\n\nresp.keys: " + practice1_resp.keys + "\n\ncorrectAns: " + correctAns + "\n\nresp.corr" + str(practice1_resp.corr)

Printing $msg with a text component, I can see practice1_resp.keys, correctAns, and practice1_resp.corr:


Here’s the code in JS:

msg = ((((((("Outcome: " + msg) + "\n\nresp.keys: ") + practice1_resp.keys) + "\n\ncorrectAns: ") + correctAns) + "\n\nresp.corr") + practice1_resp.corr.toString());

Printing that same $msg with a text component, I get output indicating that practice1_resp.keys is working, but correctAns is undefined and so practice1_resp.corr is 0:

I’ve tried looking at another Pavlovia study that does have working feedback, and for the life of me I cannot figure out what’s wrong.

Please help me figure out why correctAns is working correctly in PsychoPy but undefined in PsychoJS. I can’t proceed with my experiment until feedback (and logging!) is working correctly.

I have a thought.

When I downloaded practice1_trials.xlsx cell D9 was highlighted, which isn’t in a valid column. I wonder if this confuses Pavlovia.

While in principle Excel files should work online, you could try switching to a CSV conditions file (which wouldn’t be able to store random potentially corrupting extra info).

I’m guessing that you do get the first trial, so the Excel is being read – just not correctAns.

Best wishes,

Wakefield

I tried switching the conditions files from .xslx to .csv. It hasn’t fixed anything.

Bizarrely, when I get the .csv of my pilot data, I can see that practice1_resp.keys matches correctAns, and yet practice1_resp.corr is 0.

practice1_loop.thisRepN practice1_resp.keys practice1_resp.corr correctAns
0 f 0 f
0 f 0 f
0 s 0 s
0 f 0 f

Here are the properties of practice1_resp, if it helps: