Skip to content

Commit fe143e2

Browse files
authored
Merge pull request #3554 from jspsych/update-surveyjs-version
Update SurveyJS version
2 parents 7003c67 + 5e3aeee commit fe143e2

26 files changed

+296
-130
lines changed

.changeset/plenty-news-whisper.md

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
---
2+
"@jspsych/plugin-survey": major
3+
---
4+
5+
This release updates the SurveyJS version from 1.9.138 to 2.2.0. See the SurveyJS [release notes](https://surveyjs.io/stay-updated/release-notes) and list of [breaking changes](https://surveyjs.io/stay-updated/breaking-changes) for complete information. This update includes some bug fixes and improvements to SurveyJS that, while mostly minor, could change the appearance and functionality of existing jsPsych `survey` trials in unexpected ways. It also includes major (breaking) changes to the SurveyJS form library API that could affect users. Please test your experiments carefully when updating this plugin, and consult the SurveyJS release notes and other documentation for specifics.
6+
7+
- **New SurveyJS features**:
8+
- New slider and range slider question types.
9+
- Support for recursive question numbering.
10+
- In dynamic panels, the new `templateQuestionTitleWidth` property allows you to align question titles and input fields.
11+
- In dropdown and tag box questions, you can now allow user-defined choice options.
12+
- New loop and merge feature allows you to repeat a group of questions and combine the responses into one data object. It can be used to present a fixed set of questions, or dynamically repeat questions in response to the participant's responses.
13+
- New `round()` and `trunc()` functions that can be used for calculations in expressions.
14+
- The `dateDiff()` function now includes hours and minutes.
15+
- In checkbox questions, you can create a custom exclusive option that clears all other selected choices in the same question when selected.
16+
- **Breaking changes** that affect plugin users:
17+
- Survey element titles no longer use HTML heading tags (`<h1>`-`<h6>`). You may need to make changes if you use these tags as selectors for custom code/CSS.
18+
- Question numbering is disabled by default. If you use question numbering, you may need to add `showQuestionNumbers: true` to your top-level survey JSON, or `survey.showQuestionNumbers = true;` to your survey function.
19+
- The default logo sizes in the survey header have changed from 200 px H x 300 px W, to 40 px H x "auto" W (preserving original aspect ratio).
20+
- When multiple choice and checkbox items are presented in multiple columns, they are now laid out column-by-column instead of row-by-row.
21+
- In image picker questions, the images were previously capped in size but now fill the available space. You can set an upper limit on the image height/width with the `maxImageWidth` and `maxImageHeight` parameters.
22+
- There have been a number of form library API members (properties, methods, events) that have been [deprecated](https://surveyjs.io/stay-updated/release-notes/v2.0.0#obsolete-form-library-api) or [removed](https://surveyjs.io/stay-updated/release-notes/v2.0.0#removed-form-library-api).
23+
- **Developer-facing changes**:
24+
- SurveyJS UI package changed from survey-knockout-ui (removed in survey-core v2) to survey-js-ui (i.e. the Vanilla JS option).
25+
- SurveyJS v1 -> v2 code migration changes.
26+
- Hides a rollup build warning due to the use of top-level 'this' by SurveyJS.
27+
- Adds a `resizeObserver` mock to fix broken tests caused by SurveyJS's dependence on `resizeObserver`.
28+
- Creates a new survey container div on the display element to render into, to fix a rendering bug introduced by the SurveyJS update.
29+
- **Other plugin changes**:
30+
- Adds a **minified version of the plugin's CSS file**, `survey.min.css`, and loads it in the plugin example files.
31+
- In the docs and example files, (1) updates the `button_html` parameter value from a string to a function (for `*-button-response` v2 migration), (2) removes `showQuestionNumbers: false`, as that is now the default.
32+
- Adds a new "slider_scale.html" example to the plugin's examples folder. Thanks @Max-Lovell!

docs/demos/jspsych-survey-demo1.html

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
<script src="https://unpkg.com/@jspsych/[email protected]"></script>
77
<script src="https://unpkg.com/@jspsych/[email protected]"></script>
88
<link rel="stylesheet" href="https://unpkg.com/[email protected]/css/jspsych.css" />
9-
<link rel="stylesheet" href="https://unpkg.com/@jspsych/[email protected]/css/survey.css">
9+
<link rel="stylesheet" href="https://unpkg.com/@jspsych/[email protected]/css/survey.min.css">
1010
<link rel="stylesheet" href="docs-demo.css" type="text/css">
1111
</head>
1212
<body></body>
@@ -17,7 +17,6 @@
1717
const trial = {
1818
type: jsPsychSurvey,
1919
survey_json: {
20-
showQuestionNumbers: false,
2120
elements:
2221
[
2322
{

docs/demos/jspsych-survey-demo2.html

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
<script src="https://unpkg.com/@jspsych/[email protected]"></script>
88
<script src="https://unpkg.com/@jspsych/[email protected]"></script>
99
<link rel="stylesheet" href="https://unpkg.com/[email protected]/css/jspsych.css" />
10-
<link rel="stylesheet" href="https://unpkg.com/@jspsych/[email protected]/css/survey.css">
10+
<link rel="stylesheet" href="https://unpkg.com/@jspsych/[email protected]/css/survey.min.css">
1111
<link rel="stylesheet" href="docs-demo.css" type="text/css">
1212
</head>
1313
<body></body>
@@ -18,7 +18,6 @@
1818
const trial = {
1919
type: jsPsychSurvey,
2020
survey_json: {
21-
showQuestionNumbers: false,
2221
title: 'My questionnaire',
2322
completeText: 'Done!',
2423
pageNextText: 'Continue',

docs/demos/jspsych-survey-demo3.html

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
<script src="https://unpkg.com/@jspsych/[email protected]"></script>
88
<script src="https://unpkg.com/@jspsych/[email protected]"></script>
99
<link rel="stylesheet" href="https://unpkg.com/[email protected]/css/jspsych.css" />
10-
<link rel="stylesheet" href="https://unpkg.com/@jspsych/[email protected]/css/survey.css">
10+
<link rel="stylesheet" href="https://unpkg.com/@jspsych/[email protected]/css/survey.min.css">
1111
<link rel="stylesheet" href="docs-demo.css" type="text/css">
1212
</head>
1313
<body></body>
@@ -18,7 +18,6 @@
1818
const trial = {
1919
type: jsPsychSurvey,
2020
survey_json: {
21-
showQuestionNumbers: false,
2221
title: 'Likert scale examples',
2322
pages: [
2423
{

docs/demos/jspsych-survey-demo4.html

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
<script src="https://unpkg.com/@jspsych/[email protected]"></script>
88
<script src="https://unpkg.com/@jspsych/[email protected]"></script>
99
<link rel="stylesheet" href="https://unpkg.com/[email protected]/css/jspsych.css" />
10-
<link rel="stylesheet" href="https://unpkg.com/@jspsych/[email protected]/css/survey.css">
10+
<link rel="stylesheet" href="https://unpkg.com/@jspsych/[email protected]/css/survey.min.css">
1111
<link rel="stylesheet" href="docs-demo.css" type="text/css">
1212
</head>
1313
<body></body>
@@ -31,7 +31,6 @@
3131
const trial = {
3232
type: jsPsychSurvey,
3333
survey_json: {
34-
showQuestionNumbers: false,
3534
title: 'Conditional question visibility.',
3635
showNavigationButtons: "none",
3736
goNextPageAutomatic: true,

docs/demos/jspsych-survey-demo5.html

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
<script src="https://unpkg.com/@jspsych/[email protected]"></script>
88
<script src="https://unpkg.com/@jspsych/[email protected]"></script>
99
<link rel="stylesheet" href="https://unpkg.com/[email protected]/css/jspsych.css" />
10-
<link rel="stylesheet" href="https://unpkg.com/@jspsych/[email protected]/css/survey.css">
10+
<link rel="stylesheet" href="https://unpkg.com/@jspsych/[email protected]/css/survey.min.css">
1111
<link rel="stylesheet" href="docs-demo.css" type="text/css">
1212
</head>
1313
<body></body>
@@ -46,7 +46,6 @@
4646
// set up the survey JSON for this trial
4747
// any question-specific variables come from the appropriate object in the question_variables array
4848
let survey_json = {
49-
showQuestionNumbers: false,
5049
title: 'Dynamically constructing survey trials.',
5150
completeText: 'Next >>',
5251
elements: [

docs/demos/jspsych-survey-demo6.html

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
<script src="https://unpkg.com/@jspsych/[email protected]"></script>
99
<script src="https://unpkg.com/@jspsych/[email protected]"></script>
1010
<link rel="stylesheet" href="https://unpkg.com/[email protected]/css/jspsych.css" />
11-
<link rel="stylesheet" href="https://unpkg.com/@jspsych/[email protected]/css/survey.css">
11+
<link rel="stylesheet" href="https://unpkg.com/@jspsych/[email protected]/css/survey.min.css">
1212
<link rel="stylesheet" href="docs-demo.css" type="text/css" />
1313
<style>
1414
/* center the audio player and all image question types in the survey */
@@ -94,7 +94,6 @@
9494
showLabel: true,
9595
multiSelect: true
9696
}],
97-
showQuestionNumbers: "off",
9897
completeText: 'Next',
9998
};
10099

@@ -123,8 +122,7 @@
123122
regex: "[rR]{1}[eE]{1}[dD]{1}"
124123
}],
125124
}],
126-
completeText: "Check my response",
127-
showQuestionNumbers: "off"
125+
completeText: "Check my response"
128126
};
129127

130128
const sound_trial = {

docs/demos/jspsych-survey-demo7.html

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
<script src="https://unpkg.com/@jspsych/[email protected]"></script>
99
<script src="https://unpkg.com/@jspsych/[email protected]"></script>
1010
<link rel="stylesheet" href="https://unpkg.com/[email protected]/css/jspsych.css" />
11-
<link rel="stylesheet" href="https://unpkg.com/@jspsych/[email protected]/css/survey.css">
11+
<link rel="stylesheet" href="https://unpkg.com/@jspsych/[email protected]/css/survey.min.css">
1212
<link rel="stylesheet" href="docs-demo.css" type="text/css" />
1313
</head>
1414

@@ -77,8 +77,7 @@
7777
pattern: "aaa-9999"
7878
}
7979
}
80-
],
81-
showQuestionNumbers: false
80+
]
8281
};
8382

8483
timeline.push({

0 commit comments

Comments
 (0)