Your JavaScript method expects parameter options when you call:
MultipleChoiceQuestion(title, text, options)
Based on the error and possibly the calling point
createSurveyQuestions
, you are not defining
options
or passing it. When
MultipleChoiceQuestion
is executed, a line of code comes like these:
for (var counter = 0; counter < options.length; counter++)
Probably, you are missing a commma post between defining the questions and adding options:
var q1 = new MultipleChoiceQuestionOther(
"Gender",
"What is your gender?" [
"Male",
"Female",
"I do not identify with a gender",
"Prefer not to answer"
]
);
Try:
var q1 = new MultipleChoiceQuestionOther(
"Gender",
"What is your gender?",
[
"Male",
"Female",
"I do not identify with a gender",
"Prefer not to answer"
]
);
Believe a simple Javascript debugging should have pointed the same to you. Try out!