Skip to content

survey-multi-choice does not record option indices #3639

@wilbertvanham

Description

@wilbertvanham

survey-multi-choice does currently not record the index of the option selected. This makes a trial like this, with multiple identical strings in the options array, useless.

type: jsPsychSurveyMultiChoice,
questions: [
  {
    prompt: "How much", 
    options: ["Little","","","","Much"],
  }
]

In my opinion not relying on the string in data analysis is better since it allows for instance for internationalization. It would also solve the issue that an unanswered question is indistinguishable from choosing an empty string option now.

Adding a response_index array in the data would be a downward compatible way to solve this issue.

"response": {
	"question1": "Little",
	"question2": "",
	"question3": "",
	"question4": ""
},
"response_index": [
	0,
	1,
	2,
	3
],
"question_order": [
	0,
	1,
	2,
	3
],

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions