Row 1 error in pavlovia survey

OS (e.g. Win10): Win 10
PsychoPy version (e.g. 2024.2.4 Py 3.8): v2024.2.4
Standard Standalone Installation? (y/n) Y
**Do you want it to also run locally? (y/n N
What are you trying to achieve?:

Hi there,

I am trying to get a Pavlovia survey to work using the Survey Model File option. I’ve piloted and the survey looks fine but I get the following error when I run my experiment online:

  • TypeError: Cannot read properties of undefined (reading ‘Row 1’)

Row 1 is in my json file. The survey is an information sheet. I have one consent question with five answers that a participant needs to say ‘Yes (option1)’ to. I also have a GDPR question which has two answers that a participant also needs to say yes to.

Here is a sample where Row 1 is used:

“name”: “page2”,
“elements”: [
{
“type”: “matrixdropdown”,
“name”: “question3”,
“title”: “Consent”,
“isRequired”: true,
“columns”: [
{
“name”: “Column 1”,
“title”: “Yes/No”
}
],
“choices”: [
{
“value”: “1”,
“text”: “Yes”
},
{
“value”: “2”,
“text”: “No”
}
],
“rows”: [
{
“value”: “Row 1”,
“text”: “I confirm that I am 18 years of age or over”
},
{
“value”: “Row 2”,
“text”: “I confirm that I have read and understand the information provided to me and that I have had the oppourtunity to ask questions”
},
{
“value”: “Row 3”,
“text”: “I understand that my participation is voluntary and that I am free to withdraw and terminate my participation, without providing reason at any time.”
},
{
“value”: “Row 4”,
“text”: “I understand that I am able to skip items I am not comfortable answering.”
},
{
“value”: “Row 5”,
“text”: “I agree to take part in the above study.”
}
]
}
],
“title”: “Consent Form”,
“description”: “Taking part (please tick the box that applies). By ticking ‘Yes’ I confirm that I agree to take part in this study. If you select ‘No’ to any of the questions in this section you will be taken to the end of the survey.”
},

What did you try to make it work?:

I’ve downloaded my JSON file.
Checked the JSON formatting (it looks fine).
I can see the file is synched in my Github.
I’ve changed the survey and experiment status between piloting/active/inactive
I’ve cleared the cache on my browser
I’ve tested to see if it works using SurveyID instead of Survey Model File

Thank you in advance for any ideas as to how I can get this survey working.

Do you use Row 1 in your PsychoPy file – for example when trying to check the consent?

Yes - that is exactly what I’m trying to do. The survey is an information sheet with yes/no to consent.

Thanks,
Charlotte

What does your PsychoPy code look like?

So after my information_sheet routine (which is the pavlovia survey) I have another routine called check_consent. In there I have a code component and in the Begin Routine tab I have the following:

window.information_sheet = information_sheet
consent_given = 1
print(information_sheet._overallSurveyResults[“question3”])
window.q3 = information_sheet._overallSurveyResults[“question3”]

print(information_sheet._overallSurveyResults[“question3”][“Row 1”][“Column 1”])
if information_sheet._overallSurveyResults[“question3”][“Row 1”][“Column 1”] == ‘2’:
consent_given = 0
if information_sheet._overallSurveyResults[“question3”][“Row 2”][“Column 1”] == ‘2’:
consent_given = 0
if information_sheet._overallSurveyResults[“question3”][“Row 3”][“Column 1”] == ‘2’:
consent_given = 0
if information_sheet._overallSurveyResults[“question3”][“Row 4”][“Column 1”] == ‘2’:
consent_given = 0
if information_sheet._overallSurveyResults[“question3”][“Row 5”][“Column 1”] == ‘2’:
consent_given = 0

if information_sheet._overallSurveyResults[“question4”][“Row 1”][“Column 1”] == “No”:
consent_given = 0
if information_sheet._overallSurveyResults[“question4”][“Row 2”][“Column 1”] == “No”:
consent_given = 0

print(“consent_given”, consent_given)

After the check_consent routine I have a loop which has num. reps as $consent_given

Additional context:
Worth noting that prior to me making some changes yesterday this experiment has been working as needed online. I have needed to make an adjustment to the experiment which was to put a loop around a task I no longer need and then re-synched the experiment. The orignal task was built in 2023.2.3 but now I am running 2024.2.4. I have re-made the whole experiment as I cannot revert in GitHub (I’ve tried but my confidence level is low and I’m worried about making it worse) to get back to my working version as of yesterday morning. I’ve re-made the experiment this morning and am still getting the same error so it makes me think its specifically about how it’s using the Pavlovia survey information sheet.

I don’t understand the purpose of this code.

Please look at the code for extracting survey responses in my linked tip.