Skip to content

Add response_index to survey-multi-choice data#3645

Merged
jadeddelta merged 2 commits intojspsych:mainfrom
stephenmjerge:fix-survey-multi-choice-response-index
Jan 29, 2026
Merged

Add response_index to survey-multi-choice data#3645
jadeddelta merged 2 commits intojspsych:mainfrom
stephenmjerge:fix-survey-multi-choice-response-index

Conversation

@stephenmjerge
Copy link
Contributor

Summary

  • add response_index array to survey-multi-choice trial data (unanswered = -1)
  • expose option indices via data attributes
  • update simulation to use indices when clicking
  • add tests for duplicate/empty options and unanswered questions
  • document response_index

Testing

  • npx jest -c packages/plugin-survey-multi-choice/jest.config.cjs

Fixes #3639

@changeset-bot
Copy link

changeset-bot bot commented Jan 24, 2026

🦋 Changeset detected

Latest commit: c18d82f

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@jspsych/plugin-survey-multi-choice Minor

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

Copy link
Contributor

@jadeddelta jadeddelta left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looks great, thanks so much for the change @stephenmjerge!

i will add a quick fix, this should be a minor version bump rather than a patch version bump. patches are reserved for simple bug fixes, and this adds a backwards-compatible feature being in the field to the data object, so i'll just update it to minor and merge it. appreciate the contribution!

@jadeddelta jadeddelta merged commit bc259f8 into jspsych:main Jan 29, 2026
2 checks passed
@github-actions github-actions bot mentioned this pull request Jan 22, 2026
@stephenmjerge stephenmjerge deleted the fix-survey-multi-choice-response-index branch January 29, 2026 21:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

survey-multi-choice does not record option indices

2 participants