@jspsych/plugin-survey-likert 1.1.2 → 1.1.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +8 -2
- package/dist/index.browser.js +243 -243
- package/dist/index.browser.min.js +2 -2
- package/dist/index.browser.min.js.map +1 -1
- package/dist/index.cjs +242 -242
- package/dist/index.d.ts +156 -156
- package/dist/index.js +242 -242
- package/package.json +2 -2
- package/src/index.spec.ts +2 -2
package/dist/index.d.ts
CHANGED
|
@@ -1,156 +1,156 @@
|
|
|
1
|
-
import { JsPsych, JsPsychPlugin, ParameterType, TrialType } from "jspsych";
|
|
2
|
-
declare const info: {
|
|
3
|
-
readonly name: "survey-likert";
|
|
4
|
-
readonly parameters: {
|
|
5
|
-
/** Array containing one or more objects with parameters for the question(s) that should be shown on the page. */
|
|
6
|
-
readonly questions: {
|
|
7
|
-
readonly type: ParameterType.COMPLEX;
|
|
8
|
-
readonly array: true;
|
|
9
|
-
readonly pretty_name: "Questions";
|
|
10
|
-
readonly nested: {
|
|
11
|
-
/** Question prompt. */
|
|
12
|
-
readonly prompt: {
|
|
13
|
-
readonly type: ParameterType.HTML_STRING;
|
|
14
|
-
readonly pretty_name: "Prompt";
|
|
15
|
-
readonly default: any;
|
|
16
|
-
};
|
|
17
|
-
/** Array of likert labels to display for this question. */
|
|
18
|
-
readonly labels: {
|
|
19
|
-
readonly type: ParameterType.STRING;
|
|
20
|
-
readonly array: true;
|
|
21
|
-
readonly pretty_name: "Labels";
|
|
22
|
-
readonly default: any;
|
|
23
|
-
};
|
|
24
|
-
/** Whether or not a response to this question must be given in order to continue. */
|
|
25
|
-
readonly required: {
|
|
26
|
-
readonly type: ParameterType.BOOL;
|
|
27
|
-
readonly pretty_name: "Required";
|
|
28
|
-
readonly default: false;
|
|
29
|
-
};
|
|
30
|
-
/** Name of the question in the trial data. If no name is given, the questions are named Q0, Q1, etc. */
|
|
31
|
-
readonly name: {
|
|
32
|
-
readonly type: ParameterType.STRING;
|
|
33
|
-
readonly pretty_name: "Question Name";
|
|
34
|
-
readonly default: "";
|
|
35
|
-
};
|
|
36
|
-
};
|
|
37
|
-
};
|
|
38
|
-
/** If true, the order of the questions in the 'questions' array will be randomized. */
|
|
39
|
-
readonly randomize_question_order: {
|
|
40
|
-
readonly type: ParameterType.BOOL;
|
|
41
|
-
readonly pretty_name: "Randomize Question Order";
|
|
42
|
-
readonly default: false;
|
|
43
|
-
};
|
|
44
|
-
/** HTML-formatted string to display at top of the page above all of the questions. */
|
|
45
|
-
readonly preamble: {
|
|
46
|
-
readonly type: ParameterType.HTML_STRING;
|
|
47
|
-
readonly pretty_name: "Preamble";
|
|
48
|
-
readonly default: any;
|
|
49
|
-
};
|
|
50
|
-
/** Width of the likert scales in pixels. */
|
|
51
|
-
readonly scale_width: {
|
|
52
|
-
readonly type: ParameterType.INT;
|
|
53
|
-
readonly pretty_name: "Scale width";
|
|
54
|
-
readonly default: any;
|
|
55
|
-
};
|
|
56
|
-
/** Label of the button to submit responses. */
|
|
57
|
-
readonly button_label: {
|
|
58
|
-
readonly type: ParameterType.STRING;
|
|
59
|
-
readonly pretty_name: "Button label";
|
|
60
|
-
readonly default: "Continue";
|
|
61
|
-
};
|
|
62
|
-
/** Setting this to true will enable browser auto-complete or auto-fill for the form. */
|
|
63
|
-
readonly autocomplete: {
|
|
64
|
-
readonly type: ParameterType.BOOL;
|
|
65
|
-
readonly pretty_name: "Allow autocomplete";
|
|
66
|
-
readonly default: false;
|
|
67
|
-
};
|
|
68
|
-
};
|
|
69
|
-
};
|
|
70
|
-
|
|
71
|
-
/**
|
|
72
|
-
* **survey-likert**
|
|
73
|
-
*
|
|
74
|
-
* jsPsych plugin for gathering responses to questions on a likert scale
|
|
75
|
-
*
|
|
76
|
-
* @author Josh de Leeuw
|
|
77
|
-
* @see {@link https://www.jspsych.org/plugins/jspsych-survey-likert/ survey-likert plugin documentation on jspsych.org}
|
|
78
|
-
*/
|
|
79
|
-
declare class SurveyLikertPlugin implements JsPsychPlugin<Info> {
|
|
80
|
-
private jsPsych;
|
|
81
|
-
static info: {
|
|
82
|
-
readonly name: "survey-likert";
|
|
83
|
-
readonly parameters: {
|
|
84
|
-
/** Array containing one or more objects with parameters for the question(s) that should be shown on the page. */
|
|
85
|
-
readonly questions: {
|
|
86
|
-
readonly type: ParameterType.COMPLEX;
|
|
87
|
-
readonly array: true;
|
|
88
|
-
readonly pretty_name: "Questions";
|
|
89
|
-
readonly nested: {
|
|
90
|
-
/** Question prompt. */
|
|
91
|
-
readonly prompt: {
|
|
92
|
-
readonly type: ParameterType.HTML_STRING;
|
|
93
|
-
readonly pretty_name: "Prompt";
|
|
94
|
-
readonly default: any;
|
|
95
|
-
};
|
|
96
|
-
/** Array of likert labels to display for this question. */
|
|
97
|
-
readonly labels: {
|
|
98
|
-
readonly type: ParameterType.STRING;
|
|
99
|
-
readonly array: true;
|
|
100
|
-
readonly pretty_name: "Labels";
|
|
101
|
-
readonly default: any;
|
|
102
|
-
};
|
|
103
|
-
/** Whether or not a response to this question must be given in order to continue. */
|
|
104
|
-
readonly required: {
|
|
105
|
-
readonly type: ParameterType.BOOL;
|
|
106
|
-
readonly pretty_name: "Required";
|
|
107
|
-
readonly default: false;
|
|
108
|
-
};
|
|
109
|
-
/** Name of the question in the trial data. If no name is given, the questions are named Q0, Q1, etc. */
|
|
110
|
-
readonly name: {
|
|
111
|
-
readonly type: ParameterType.STRING;
|
|
112
|
-
readonly pretty_name: "Question Name";
|
|
113
|
-
readonly default: "";
|
|
114
|
-
};
|
|
115
|
-
};
|
|
116
|
-
};
|
|
117
|
-
/** If true, the order of the questions in the 'questions' array will be randomized. */
|
|
118
|
-
readonly randomize_question_order: {
|
|
119
|
-
readonly type: ParameterType.BOOL;
|
|
120
|
-
readonly pretty_name: "Randomize Question Order";
|
|
121
|
-
readonly default: false;
|
|
122
|
-
};
|
|
123
|
-
/** HTML-formatted string to display at top of the page above all of the questions. */
|
|
124
|
-
readonly preamble: {
|
|
125
|
-
readonly type: ParameterType.HTML_STRING;
|
|
126
|
-
readonly pretty_name: "Preamble";
|
|
127
|
-
readonly default: any;
|
|
128
|
-
};
|
|
129
|
-
/** Width of the likert scales in pixels. */
|
|
130
|
-
readonly scale_width: {
|
|
131
|
-
readonly type: ParameterType.INT;
|
|
132
|
-
readonly pretty_name: "Scale width";
|
|
133
|
-
readonly default: any;
|
|
134
|
-
};
|
|
135
|
-
/** Label of the button to submit responses. */
|
|
136
|
-
readonly button_label: {
|
|
137
|
-
readonly type: ParameterType.STRING;
|
|
138
|
-
readonly pretty_name: "Button label";
|
|
139
|
-
readonly default: "Continue";
|
|
140
|
-
};
|
|
141
|
-
/** Setting this to true will enable browser auto-complete or auto-fill for the form. */
|
|
142
|
-
readonly autocomplete: {
|
|
143
|
-
readonly type: ParameterType.BOOL;
|
|
144
|
-
readonly pretty_name: "Allow autocomplete";
|
|
145
|
-
readonly default: false;
|
|
146
|
-
};
|
|
147
|
-
};
|
|
148
|
-
};
|
|
149
|
-
constructor(jsPsych: JsPsych);
|
|
150
|
-
trial(display_element: HTMLElement, trial: TrialType<Info>): void;
|
|
151
|
-
simulate(trial: TrialType<Info>, simulation_mode: any, simulation_options: any, load_callback: () => void): void;
|
|
152
|
-
private create_simulation_data;
|
|
153
|
-
private simulate_data_only;
|
|
154
|
-
private simulate_visual;
|
|
155
|
-
}
|
|
156
|
-
export default SurveyLikertPlugin;
|
|
1
|
+
import { JsPsych, JsPsychPlugin, ParameterType, TrialType } from "jspsych";
|
|
2
|
+
declare const info: {
|
|
3
|
+
readonly name: "survey-likert";
|
|
4
|
+
readonly parameters: {
|
|
5
|
+
/** Array containing one or more objects with parameters for the question(s) that should be shown on the page. */
|
|
6
|
+
readonly questions: {
|
|
7
|
+
readonly type: ParameterType.COMPLEX;
|
|
8
|
+
readonly array: true;
|
|
9
|
+
readonly pretty_name: "Questions";
|
|
10
|
+
readonly nested: {
|
|
11
|
+
/** Question prompt. */
|
|
12
|
+
readonly prompt: {
|
|
13
|
+
readonly type: ParameterType.HTML_STRING;
|
|
14
|
+
readonly pretty_name: "Prompt";
|
|
15
|
+
readonly default: any;
|
|
16
|
+
};
|
|
17
|
+
/** Array of likert labels to display for this question. */
|
|
18
|
+
readonly labels: {
|
|
19
|
+
readonly type: ParameterType.STRING;
|
|
20
|
+
readonly array: true;
|
|
21
|
+
readonly pretty_name: "Labels";
|
|
22
|
+
readonly default: any;
|
|
23
|
+
};
|
|
24
|
+
/** Whether or not a response to this question must be given in order to continue. */
|
|
25
|
+
readonly required: {
|
|
26
|
+
readonly type: ParameterType.BOOL;
|
|
27
|
+
readonly pretty_name: "Required";
|
|
28
|
+
readonly default: false;
|
|
29
|
+
};
|
|
30
|
+
/** Name of the question in the trial data. If no name is given, the questions are named Q0, Q1, etc. */
|
|
31
|
+
readonly name: {
|
|
32
|
+
readonly type: ParameterType.STRING;
|
|
33
|
+
readonly pretty_name: "Question Name";
|
|
34
|
+
readonly default: "";
|
|
35
|
+
};
|
|
36
|
+
};
|
|
37
|
+
};
|
|
38
|
+
/** If true, the order of the questions in the 'questions' array will be randomized. */
|
|
39
|
+
readonly randomize_question_order: {
|
|
40
|
+
readonly type: ParameterType.BOOL;
|
|
41
|
+
readonly pretty_name: "Randomize Question Order";
|
|
42
|
+
readonly default: false;
|
|
43
|
+
};
|
|
44
|
+
/** HTML-formatted string to display at top of the page above all of the questions. */
|
|
45
|
+
readonly preamble: {
|
|
46
|
+
readonly type: ParameterType.HTML_STRING;
|
|
47
|
+
readonly pretty_name: "Preamble";
|
|
48
|
+
readonly default: any;
|
|
49
|
+
};
|
|
50
|
+
/** Width of the likert scales in pixels. */
|
|
51
|
+
readonly scale_width: {
|
|
52
|
+
readonly type: ParameterType.INT;
|
|
53
|
+
readonly pretty_name: "Scale width";
|
|
54
|
+
readonly default: any;
|
|
55
|
+
};
|
|
56
|
+
/** Label of the button to submit responses. */
|
|
57
|
+
readonly button_label: {
|
|
58
|
+
readonly type: ParameterType.STRING;
|
|
59
|
+
readonly pretty_name: "Button label";
|
|
60
|
+
readonly default: "Continue";
|
|
61
|
+
};
|
|
62
|
+
/** Setting this to true will enable browser auto-complete or auto-fill for the form. */
|
|
63
|
+
readonly autocomplete: {
|
|
64
|
+
readonly type: ParameterType.BOOL;
|
|
65
|
+
readonly pretty_name: "Allow autocomplete";
|
|
66
|
+
readonly default: false;
|
|
67
|
+
};
|
|
68
|
+
};
|
|
69
|
+
};
|
|
70
|
+
type Info = typeof info;
|
|
71
|
+
/**
|
|
72
|
+
* **survey-likert**
|
|
73
|
+
*
|
|
74
|
+
* jsPsych plugin for gathering responses to questions on a likert scale
|
|
75
|
+
*
|
|
76
|
+
* @author Josh de Leeuw
|
|
77
|
+
* @see {@link https://www.jspsych.org/plugins/jspsych-survey-likert/ survey-likert plugin documentation on jspsych.org}
|
|
78
|
+
*/
|
|
79
|
+
declare class SurveyLikertPlugin implements JsPsychPlugin<Info> {
|
|
80
|
+
private jsPsych;
|
|
81
|
+
static info: {
|
|
82
|
+
readonly name: "survey-likert";
|
|
83
|
+
readonly parameters: {
|
|
84
|
+
/** Array containing one or more objects with parameters for the question(s) that should be shown on the page. */
|
|
85
|
+
readonly questions: {
|
|
86
|
+
readonly type: ParameterType.COMPLEX;
|
|
87
|
+
readonly array: true;
|
|
88
|
+
readonly pretty_name: "Questions";
|
|
89
|
+
readonly nested: {
|
|
90
|
+
/** Question prompt. */
|
|
91
|
+
readonly prompt: {
|
|
92
|
+
readonly type: ParameterType.HTML_STRING;
|
|
93
|
+
readonly pretty_name: "Prompt";
|
|
94
|
+
readonly default: any;
|
|
95
|
+
};
|
|
96
|
+
/** Array of likert labels to display for this question. */
|
|
97
|
+
readonly labels: {
|
|
98
|
+
readonly type: ParameterType.STRING;
|
|
99
|
+
readonly array: true;
|
|
100
|
+
readonly pretty_name: "Labels";
|
|
101
|
+
readonly default: any;
|
|
102
|
+
};
|
|
103
|
+
/** Whether or not a response to this question must be given in order to continue. */
|
|
104
|
+
readonly required: {
|
|
105
|
+
readonly type: ParameterType.BOOL;
|
|
106
|
+
readonly pretty_name: "Required";
|
|
107
|
+
readonly default: false;
|
|
108
|
+
};
|
|
109
|
+
/** Name of the question in the trial data. If no name is given, the questions are named Q0, Q1, etc. */
|
|
110
|
+
readonly name: {
|
|
111
|
+
readonly type: ParameterType.STRING;
|
|
112
|
+
readonly pretty_name: "Question Name";
|
|
113
|
+
readonly default: "";
|
|
114
|
+
};
|
|
115
|
+
};
|
|
116
|
+
};
|
|
117
|
+
/** If true, the order of the questions in the 'questions' array will be randomized. */
|
|
118
|
+
readonly randomize_question_order: {
|
|
119
|
+
readonly type: ParameterType.BOOL;
|
|
120
|
+
readonly pretty_name: "Randomize Question Order";
|
|
121
|
+
readonly default: false;
|
|
122
|
+
};
|
|
123
|
+
/** HTML-formatted string to display at top of the page above all of the questions. */
|
|
124
|
+
readonly preamble: {
|
|
125
|
+
readonly type: ParameterType.HTML_STRING;
|
|
126
|
+
readonly pretty_name: "Preamble";
|
|
127
|
+
readonly default: any;
|
|
128
|
+
};
|
|
129
|
+
/** Width of the likert scales in pixels. */
|
|
130
|
+
readonly scale_width: {
|
|
131
|
+
readonly type: ParameterType.INT;
|
|
132
|
+
readonly pretty_name: "Scale width";
|
|
133
|
+
readonly default: any;
|
|
134
|
+
};
|
|
135
|
+
/** Label of the button to submit responses. */
|
|
136
|
+
readonly button_label: {
|
|
137
|
+
readonly type: ParameterType.STRING;
|
|
138
|
+
readonly pretty_name: "Button label";
|
|
139
|
+
readonly default: "Continue";
|
|
140
|
+
};
|
|
141
|
+
/** Setting this to true will enable browser auto-complete or auto-fill for the form. */
|
|
142
|
+
readonly autocomplete: {
|
|
143
|
+
readonly type: ParameterType.BOOL;
|
|
144
|
+
readonly pretty_name: "Allow autocomplete";
|
|
145
|
+
readonly default: false;
|
|
146
|
+
};
|
|
147
|
+
};
|
|
148
|
+
};
|
|
149
|
+
constructor(jsPsych: JsPsych);
|
|
150
|
+
trial(display_element: HTMLElement, trial: TrialType<Info>): void;
|
|
151
|
+
simulate(trial: TrialType<Info>, simulation_mode: any, simulation_options: any, load_callback: () => void): void;
|
|
152
|
+
private create_simulation_data;
|
|
153
|
+
private simulate_data_only;
|
|
154
|
+
private simulate_visual;
|
|
155
|
+
}
|
|
156
|
+
export default SurveyLikertPlugin;
|