Skip to content

Commit

Permalink
Merge pull request #3451 from jspsych/fix-survey-datatype
Browse files Browse the repository at this point in the history
fix `response` data type to be just `ParameterType.OBJECT`
  • Loading branch information
jodeleeuw authored Dec 2, 2024
2 parents 20b801e + 7ffc644 commit 5184770
Show file tree
Hide file tree
Showing 7 changed files with 16 additions and 84 deletions.
10 changes: 10 additions & 0 deletions .changeset/strange-countries-laugh.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
---
"@jspsych/plugin-survey": patch
"@jspsych/plugin-survey-html-form": patch
"@jspsych/plugin-survey-likert": patch
"@jspsych/plugin-survey-multi-choice": patch
"@jspsych/plugin-survey-multi-select": patch
"@jspsych/plugin-survey-text": patch
---

fix `response` data type to be just `ParameterType.OBJECT`
15 changes: 1 addition & 14 deletions packages/plugin-survey-html-form/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,20 +40,7 @@ const info = <const>{
data: {
/** An object containing the response for each input. The object will have a separate key (variable) for the response to each input, with each variable being named after its corresponding input element. Each response is a string containing whatever the participant answered for this particular input. This will be encoded as a JSON string when data is saved using the `.json()` or `.csv()` functions. */
response: {
type: ParameterType.COMPLEX,
nested: {
identifier: {
type: ParameterType.STRING,
},
response: {
type:
ParameterType.STRING |
ParameterType.INT |
ParameterType.FLOAT |
ParameterType.BOOL |
ParameterType.OBJECT,
},
},
type: ParameterType.OBJECT,
},
/** The response time in milliseconds for the participant to make a response. */
rt: {
Expand Down
15 changes: 1 addition & 14 deletions packages/plugin-survey-likert/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -63,20 +63,7 @@ const info = <const>{
data: {
/** An object containing the response for each question. The object will have a separate key (variable) for each question, with the first question in the trial being recorded in `Q0`, the second in `Q1`, and so on. The responses are recorded as integers, representing the position selected on the likert scale for that question. If the `name` parameter is defined for the question, then the response object will use the value of `name` as the key for each question. This will be encoded as a JSON string when data is saved using the `.json()` or `.csv()` functions. */
response: {
type: ParameterType.COMPLEX,
nested: {
identifier: {
type: ParameterType.STRING,
},
response: {
type:
ParameterType.STRING |
ParameterType.INT |
ParameterType.FLOAT |
ParameterType.BOOL |
ParameterType.OBJECT,
},
},
type: ParameterType.OBJECT,
},
/** The response time in milliseconds for the participant to make a response. The time is measured from when the questions first appear on the screen until the participant's response(s) are submitted. */
rt: {
Expand Down
15 changes: 1 addition & 14 deletions packages/plugin-survey-multi-choice/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -80,20 +80,7 @@ const info = <const>{
data: {
/** An object containing the response for each question. The object will have a separate key (variable) for each question, with the first question in the trial being recorded in `Q0`, the second in `Q1`, and so on. The responses are recorded as integers, representing the position selected on the likert scale for that question. If the `name` parameter is defined for the question, then the response object will use the value of `name` as the key for each question. This will be encoded as a JSON string when data is saved using the `.json()` or `.csv()` functions. */
response: {
type: ParameterType.COMPLEX,
nested: {
identifier: {
type: ParameterType.STRING,
},
response: {
type:
ParameterType.STRING |
ParameterType.INT |
ParameterType.FLOAT |
ParameterType.BOOL |
ParameterType.OBJECT,
},
},
type: ParameterType.OBJECT,
},
/** The response time in milliseconds for the participant to make a response. The time is measured from when the questions first appear on the screen until the participant's response(s) are submitted. */
rt: {
Expand Down
15 changes: 1 addition & 14 deletions packages/plugin-survey-multi-select/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -85,20 +85,7 @@ const info = <const>{
data: {
/** An object containing the response for each question. The object will have a separate key (variable) for each question, with the first question in the trial being recorded in `Q0`, the second in `Q1`, and so on. The responses are recorded as integers, representing the position selected on the likert scale for that question. If the `name` parameter is defined for the question, then the response object will use the value of `name` as the key for each question. This will be encoded as a JSON string when data is saved using the `.json()` or `.csv()` functions. */
response: {
type: ParameterType.COMPLEX,
nested: {
identifier: {
type: ParameterType.STRING,
},
response: {
type:
ParameterType.STRING |
ParameterType.INT |
ParameterType.FLOAT |
ParameterType.BOOL |
ParameterType.OBJECT,
},
},
type: ParameterType.OBJECT,
},
/** The response time in milliseconds for the participant to make a response. The time is measured from when the questions first appear on the screen until the participant's response(s) are submitted. */
rt: {
Expand Down
15 changes: 1 addition & 14 deletions packages/plugin-survey-text/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -83,20 +83,7 @@ const info = <const>{
data: {
/** An object containing the response for each question. The object will have a separate key (variable) for each question, with the first question in the trial being recorded in `Q0`, the second in `Q1`, and so on. The responses are recorded as integers, representing the position selected on the likert scale for that question. If the `name` parameter is defined for the question, then the response object will use the value of `name` as the key for each question. This will be encoded as a JSON string when data is saved using the `.json()` or `.csv()` functions. */
response: {
type: ParameterType.COMPLEX,
nested: {
identifier: {
type: ParameterType.STRING,
},
response: {
type:
ParameterType.STRING |
ParameterType.INT |
ParameterType.FLOAT |
ParameterType.BOOL |
ParameterType.OBJECT,
},
},
type: ParameterType.OBJECT,
},
/** The response time in milliseconds for the participant to make a response. The time is measured from when the questions first appear on the screen until the participant's response(s) are submitted. */
rt: {
Expand Down
15 changes: 1 addition & 14 deletions packages/plugin-survey/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -46,20 +46,7 @@ const info = <const>{
data: {
/** An object containing the response to each question. The object will have a separate key (identifier) for each question. If the `name` parameter is defined for the question (recommended), then the response object will use the value of `name` as the key for each question. If any questions do not have a name parameter, their keys will named automatically, with the first unnamed question recorded as `question1`, the second as `question2`, and so on. The response type will depend on the question type. This will be encoded as a JSON string when data is saved using the `.json()` or `.csv()` functions. */
response: {
type: ParameterType.COMPLEX,
nested: {
identifier: {
type: ParameterType.STRING,
},
response: {
type:
ParameterType.STRING |
ParameterType.INT |
ParameterType.FLOAT |
ParameterType.BOOL |
ParameterType.OBJECT,
},
},
type: ParameterType.OBJECT,
},
/** The response time in milliseconds for the participant to make a response. The time is measured from when the questions first appear on the screen until the participant's response(s) are submitted. */
rt: {
Expand Down

0 comments on commit 5184770

Please sign in to comment.