@pie-element/likert 0.7.0 → 0.7.1-beta.1
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/configure/package.json +3 -3
- package/controller/package.json +1 -1
- package/package.json +5 -4
- package/configure/lib/choiceGenerator.js +0 -246
- package/configure/lib/choiceGenerator.js.map +0 -1
- package/configure/lib/defaults.js +0 -38
- package/configure/lib/defaults.js.map +0 -1
- package/configure/lib/index.js +0 -171
- package/configure/lib/index.js.map +0 -1
- package/configure/lib/likertEntities.js +0 -27
- package/configure/lib/likertEntities.js.map +0 -1
- package/configure/lib/main.js +0 -455
- package/configure/lib/main.js.map +0 -1
- package/controller/lib/defaults.js +0 -11
- package/controller/lib/defaults.js.map +0 -1
- package/controller/lib/index.js +0 -99
- package/controller/lib/index.js.map +0 -1
- package/lib/choice-input.js +0 -162
- package/lib/choice-input.js.map +0 -1
- package/lib/index.js +0 -107
- package/lib/index.js.map +0 -1
- package/lib/likert.js +0 -143
- package/lib/likert.js.map +0 -1
- package/lib/likertEntities.js +0 -12
- package/lib/likertEntities.js.map +0 -1
- package/lib/main.js +0 -96
- package/lib/main.js.map +0 -1
- package/lib/session-updater.js +0 -17
- package/lib/session-updater.js.map +0 -1
package/configure/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pie-element/likert-configure",
|
|
3
3
|
"private": true,
|
|
4
|
-
"version": "0.4.0",
|
|
4
|
+
"version": "0.4.1-beta.0",
|
|
5
5
|
"description": "",
|
|
6
6
|
"main": "lib/index.js",
|
|
7
7
|
"module": "src/index.js",
|
|
@@ -9,8 +9,8 @@
|
|
|
9
9
|
"dependencies": {
|
|
10
10
|
"@material-ui/core": "^3.9.2",
|
|
11
11
|
"@pie-framework/pie-configure-events": "^1.3.0",
|
|
12
|
-
"@pie-lib/config-ui": "
|
|
13
|
-
"@pie-lib/editable-html": "
|
|
12
|
+
"@pie-lib/config-ui": "12.0.0-beta.4",
|
|
13
|
+
"@pie-lib/editable-html": "10.0.0-beta.5",
|
|
14
14
|
"debug": "^4.1.1",
|
|
15
15
|
"prop-types": "^15.6.2",
|
|
16
16
|
"react": "^16.8.1",
|
package/controller/package.json
CHANGED
package/package.json
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
"access": "public"
|
|
5
5
|
},
|
|
6
6
|
"repository": "pie-framework/pie-elements",
|
|
7
|
-
"version": "0.7.
|
|
7
|
+
"version": "0.7.1-beta.1+73223f303",
|
|
8
8
|
"description": "",
|
|
9
9
|
"scripts": {
|
|
10
10
|
"test": "echo \"Error: no test specified\" && exit 1"
|
|
@@ -12,10 +12,11 @@
|
|
|
12
12
|
"dependencies": {
|
|
13
13
|
"@material-ui/core": "^3.9.2",
|
|
14
14
|
"@pie-framework/pie-player-events": "^0.1.0",
|
|
15
|
-
"@pie-lib/math-rendering": "^2.5.
|
|
16
|
-
"@pie-lib/render-ui": "^4.
|
|
15
|
+
"@pie-lib/math-rendering": "^2.5.12",
|
|
16
|
+
"@pie-lib/render-ui": "^4.14.12",
|
|
17
17
|
"classnames": "^2.2.5",
|
|
18
18
|
"debug": "^4.1.1",
|
|
19
|
+
"is-plain-object": "^5.0.0",
|
|
19
20
|
"lodash": "^4.17.10",
|
|
20
21
|
"prop-types": "^15.6.1",
|
|
21
22
|
"react": "^16.8.1",
|
|
@@ -25,7 +26,7 @@
|
|
|
25
26
|
},
|
|
26
27
|
"author": "",
|
|
27
28
|
"license": "ISC",
|
|
28
|
-
"gitHead": "
|
|
29
|
+
"gitHead": "73223f303ea31ca510b096d77e6fb06382b0f0c6",
|
|
29
30
|
"main": "lib/index.js",
|
|
30
31
|
"module": "src/index.js"
|
|
31
32
|
}
|
|
@@ -1,246 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
-
|
|
5
|
-
Object.defineProperty(exports, "__esModule", {
|
|
6
|
-
value: true
|
|
7
|
-
});
|
|
8
|
-
exports["default"] = void 0;
|
|
9
|
-
|
|
10
|
-
var _toConsumableArray2 = _interopRequireDefault(require("@babel/runtime/helpers/toConsumableArray"));
|
|
11
|
-
|
|
12
|
-
var _likertEntities = require("./likertEntities");
|
|
13
|
-
|
|
14
|
-
var likert3Agreement = [{
|
|
15
|
-
label: 'Disagree',
|
|
16
|
-
value: -1
|
|
17
|
-
}, {
|
|
18
|
-
label: 'Unsure',
|
|
19
|
-
value: 0
|
|
20
|
-
}, {
|
|
21
|
-
label: 'Agree',
|
|
22
|
-
value: 1
|
|
23
|
-
}];
|
|
24
|
-
var likert5Agreement = [{
|
|
25
|
-
label: 'Strongly Disagree',
|
|
26
|
-
value: -2
|
|
27
|
-
}].concat(likert3Agreement, [{
|
|
28
|
-
label: 'Strongly Agree',
|
|
29
|
-
value: 2
|
|
30
|
-
}]);
|
|
31
|
-
var likert7Agreement = [{
|
|
32
|
-
label: 'Extremely Disagree',
|
|
33
|
-
value: -3
|
|
34
|
-
}].concat((0, _toConsumableArray2["default"])(likert5Agreement), [{
|
|
35
|
-
label: 'Extremely Agree',
|
|
36
|
-
value: 3
|
|
37
|
-
}]);
|
|
38
|
-
var likert3Frequency = [{
|
|
39
|
-
label: 'Infrequently',
|
|
40
|
-
value: -1
|
|
41
|
-
}, {
|
|
42
|
-
label: 'Unsure',
|
|
43
|
-
value: 0
|
|
44
|
-
}, {
|
|
45
|
-
label: 'Frequently',
|
|
46
|
-
value: 1
|
|
47
|
-
}];
|
|
48
|
-
var likert5Frequency = [{
|
|
49
|
-
label: 'Very Infrequently',
|
|
50
|
-
value: -2
|
|
51
|
-
}].concat(likert3Frequency, [{
|
|
52
|
-
label: 'Very Frequently',
|
|
53
|
-
value: 2
|
|
54
|
-
}]);
|
|
55
|
-
var likert7Frequency = [{
|
|
56
|
-
label: 'Never',
|
|
57
|
-
value: -3
|
|
58
|
-
}].concat((0, _toConsumableArray2["default"])(likert5Frequency), [{
|
|
59
|
-
label: 'Always',
|
|
60
|
-
value: 3
|
|
61
|
-
}]);
|
|
62
|
-
var likert3YesNo = [{
|
|
63
|
-
label: 'No',
|
|
64
|
-
value: -1
|
|
65
|
-
}, {
|
|
66
|
-
label: 'Unsure',
|
|
67
|
-
value: 0
|
|
68
|
-
}, {
|
|
69
|
-
label: 'Yes',
|
|
70
|
-
value: 1
|
|
71
|
-
}];
|
|
72
|
-
var likert5YesNo = [{
|
|
73
|
-
label: 'No',
|
|
74
|
-
value: -2
|
|
75
|
-
}, {
|
|
76
|
-
label: 'Not really',
|
|
77
|
-
value: -1
|
|
78
|
-
}, {
|
|
79
|
-
label: 'Unsure',
|
|
80
|
-
value: 0
|
|
81
|
-
}, {
|
|
82
|
-
label: 'Sometimes',
|
|
83
|
-
value: 1
|
|
84
|
-
}, {
|
|
85
|
-
label: 'Yes',
|
|
86
|
-
value: 2
|
|
87
|
-
}];
|
|
88
|
-
var likert7YesNo = [{
|
|
89
|
-
label: 'No',
|
|
90
|
-
value: -3
|
|
91
|
-
}, {
|
|
92
|
-
label: 'Rarely',
|
|
93
|
-
value: -2
|
|
94
|
-
}, {
|
|
95
|
-
label: 'Not really',
|
|
96
|
-
value: -1
|
|
97
|
-
}, {
|
|
98
|
-
label: 'Unsure',
|
|
99
|
-
value: 0
|
|
100
|
-
}, {
|
|
101
|
-
label: 'Sometimes',
|
|
102
|
-
value: 1
|
|
103
|
-
}, {
|
|
104
|
-
label: 'Very Often',
|
|
105
|
-
value: 2
|
|
106
|
-
}, {
|
|
107
|
-
label: 'Always',
|
|
108
|
-
value: 3
|
|
109
|
-
}];
|
|
110
|
-
var likert3Likelihood = [{
|
|
111
|
-
label: 'Not Likely',
|
|
112
|
-
value: -1
|
|
113
|
-
}, {
|
|
114
|
-
label: 'Unsure',
|
|
115
|
-
value: 0
|
|
116
|
-
}, {
|
|
117
|
-
label: 'Likely',
|
|
118
|
-
value: 1
|
|
119
|
-
}];
|
|
120
|
-
var likert5Likelihood = [{
|
|
121
|
-
label: 'Very Unlikely',
|
|
122
|
-
value: -2
|
|
123
|
-
}].concat(likert3Likelihood, [{
|
|
124
|
-
label: 'Very Likely',
|
|
125
|
-
value: 2
|
|
126
|
-
}]);
|
|
127
|
-
var likert7Likelihood = [{
|
|
128
|
-
label: 'Extremely Unlikely',
|
|
129
|
-
value: -3
|
|
130
|
-
}].concat((0, _toConsumableArray2["default"])(likert5Likelihood), [{
|
|
131
|
-
label: 'Extremely Likely',
|
|
132
|
-
value: 3
|
|
133
|
-
}]);
|
|
134
|
-
var likert3Importance = [{
|
|
135
|
-
label: 'Not Important',
|
|
136
|
-
value: -1
|
|
137
|
-
}, {
|
|
138
|
-
label: 'Unsure',
|
|
139
|
-
value: 0
|
|
140
|
-
}, {
|
|
141
|
-
label: 'Important',
|
|
142
|
-
value: 1
|
|
143
|
-
}];
|
|
144
|
-
var likert5Importance = [{
|
|
145
|
-
label: 'Very Not Important',
|
|
146
|
-
value: -2
|
|
147
|
-
}].concat(likert3Importance, [{
|
|
148
|
-
label: 'Very Important',
|
|
149
|
-
value: 2
|
|
150
|
-
}]);
|
|
151
|
-
var likert7Importance = [{
|
|
152
|
-
label: 'Extremely Not Important',
|
|
153
|
-
value: -3
|
|
154
|
-
}].concat((0, _toConsumableArray2["default"])(likert5Importance), [{
|
|
155
|
-
label: 'Extremely Important',
|
|
156
|
-
value: 3
|
|
157
|
-
}]);
|
|
158
|
-
var likert3Like = [{
|
|
159
|
-
label: 'Dislike',
|
|
160
|
-
value: -1
|
|
161
|
-
}, {
|
|
162
|
-
label: 'Unsure',
|
|
163
|
-
value: 0
|
|
164
|
-
}, {
|
|
165
|
-
label: 'Like',
|
|
166
|
-
value: 1
|
|
167
|
-
}];
|
|
168
|
-
var likert5Like = [{
|
|
169
|
-
label: 'Really Dislike',
|
|
170
|
-
value: -2
|
|
171
|
-
}].concat(likert3Like, [{
|
|
172
|
-
label: 'Really Like',
|
|
173
|
-
value: 2
|
|
174
|
-
}]);
|
|
175
|
-
var likert7Like = [{
|
|
176
|
-
label: 'Extremely Dislike',
|
|
177
|
-
value: -3
|
|
178
|
-
}].concat((0, _toConsumableArray2["default"])(likert5Like), [{
|
|
179
|
-
label: 'Extremely Like',
|
|
180
|
-
value: 3
|
|
181
|
-
}]);
|
|
182
|
-
|
|
183
|
-
var generateChoices = function generateChoices(likertScale, likertType) {
|
|
184
|
-
switch ("".concat(likertScale, "-").concat(likertType)) {
|
|
185
|
-
case "".concat(_likertEntities.LIKERT_SCALE.likert3, "-").concat(_likertEntities.LIKERT_TYPE.agreement):
|
|
186
|
-
return [].concat(likert3Agreement);
|
|
187
|
-
|
|
188
|
-
case "".concat(_likertEntities.LIKERT_SCALE.likert5, "-").concat(_likertEntities.LIKERT_TYPE.agreement):
|
|
189
|
-
return (0, _toConsumableArray2["default"])(likert5Agreement);
|
|
190
|
-
|
|
191
|
-
case "".concat(_likertEntities.LIKERT_SCALE.likert7, "-").concat(_likertEntities.LIKERT_TYPE.agreement):
|
|
192
|
-
return (0, _toConsumableArray2["default"])(likert7Agreement);
|
|
193
|
-
|
|
194
|
-
case "".concat(_likertEntities.LIKERT_SCALE.likert3, "-").concat(_likertEntities.LIKERT_TYPE.frequency):
|
|
195
|
-
return [].concat(likert3Frequency);
|
|
196
|
-
|
|
197
|
-
case "".concat(_likertEntities.LIKERT_SCALE.likert5, "-").concat(_likertEntities.LIKERT_TYPE.frequency):
|
|
198
|
-
return (0, _toConsumableArray2["default"])(likert5Frequency);
|
|
199
|
-
|
|
200
|
-
case "".concat(_likertEntities.LIKERT_SCALE.likert7, "-").concat(_likertEntities.LIKERT_TYPE.frequency):
|
|
201
|
-
return (0, _toConsumableArray2["default"])(likert7Frequency);
|
|
202
|
-
|
|
203
|
-
case "".concat(_likertEntities.LIKERT_SCALE.likert3, "-").concat(_likertEntities.LIKERT_TYPE.yesNo):
|
|
204
|
-
return [].concat(likert3YesNo);
|
|
205
|
-
|
|
206
|
-
case "".concat(_likertEntities.LIKERT_SCALE.likert5, "-").concat(_likertEntities.LIKERT_TYPE.yesNo):
|
|
207
|
-
return [].concat(likert5YesNo);
|
|
208
|
-
|
|
209
|
-
case "".concat(_likertEntities.LIKERT_SCALE.likert7, "-").concat(_likertEntities.LIKERT_TYPE.yesNo):
|
|
210
|
-
return [].concat(likert7YesNo);
|
|
211
|
-
|
|
212
|
-
case "".concat(_likertEntities.LIKERT_SCALE.likert3, "-").concat(_likertEntities.LIKERT_TYPE.likelihood):
|
|
213
|
-
return [].concat(likert3Likelihood);
|
|
214
|
-
|
|
215
|
-
case "".concat(_likertEntities.LIKERT_SCALE.likert5, "-").concat(_likertEntities.LIKERT_TYPE.likelihood):
|
|
216
|
-
return (0, _toConsumableArray2["default"])(likert5Likelihood);
|
|
217
|
-
|
|
218
|
-
case "".concat(_likertEntities.LIKERT_SCALE.likert7, "-").concat(_likertEntities.LIKERT_TYPE.likelihood):
|
|
219
|
-
return (0, _toConsumableArray2["default"])(likert7Likelihood);
|
|
220
|
-
|
|
221
|
-
case "".concat(_likertEntities.LIKERT_SCALE.likert3, "-").concat(_likertEntities.LIKERT_TYPE.importance):
|
|
222
|
-
return [].concat(likert3Importance);
|
|
223
|
-
|
|
224
|
-
case "".concat(_likertEntities.LIKERT_SCALE.likert5, "-").concat(_likertEntities.LIKERT_TYPE.importance):
|
|
225
|
-
return (0, _toConsumableArray2["default"])(likert5Importance);
|
|
226
|
-
|
|
227
|
-
case "".concat(_likertEntities.LIKERT_SCALE.likert7, "-").concat(_likertEntities.LIKERT_TYPE.importance):
|
|
228
|
-
return (0, _toConsumableArray2["default"])(likert7Importance);
|
|
229
|
-
|
|
230
|
-
case "".concat(_likertEntities.LIKERT_SCALE.likert3, "-").concat(_likertEntities.LIKERT_TYPE.like):
|
|
231
|
-
return [].concat(likert3Like);
|
|
232
|
-
|
|
233
|
-
case "".concat(_likertEntities.LIKERT_SCALE.likert5, "-").concat(_likertEntities.LIKERT_TYPE.like):
|
|
234
|
-
return (0, _toConsumableArray2["default"])(likert5Like);
|
|
235
|
-
|
|
236
|
-
case "".concat(_likertEntities.LIKERT_SCALE.likert7, "-").concat(_likertEntities.LIKERT_TYPE.like):
|
|
237
|
-
return (0, _toConsumableArray2["default"])(likert7Like);
|
|
238
|
-
|
|
239
|
-
default:
|
|
240
|
-
return [];
|
|
241
|
-
}
|
|
242
|
-
};
|
|
243
|
-
|
|
244
|
-
var _default = generateChoices;
|
|
245
|
-
exports["default"] = _default;
|
|
246
|
-
//# sourceMappingURL=choiceGenerator.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/choiceGenerator.js"],"names":["likert3Agreement","label","value","likert5Agreement","likert7Agreement","likert3Frequency","likert5Frequency","likert7Frequency","likert3YesNo","likert5YesNo","likert7YesNo","likert3Likelihood","likert5Likelihood","likert7Likelihood","likert3Importance","likert5Importance","likert7Importance","likert3Like","likert5Like","likert7Like","generateChoices","likertScale","likertType","LIKERT_SCALE","likert3","LIKERT_TYPE","agreement","likert5","likert7","frequency","yesNo","likelihood","importance","like"],"mappings":";;;;;;;;;;;AAAA;;AAEA,IAAMA,gBAAgB,GAAG,CACvB;AACEC,EAAAA,KAAK,EAAE,UADT;AAEEC,EAAAA,KAAK,EAAE,CAAC;AAFV,CADuB,EAKvB;AACED,EAAAA,KAAK,EAAE,QADT;AAEEC,EAAAA,KAAK,EAAE;AAFT,CALuB,EASvB;AACED,EAAAA,KAAK,EAAE,OADT;AAEEC,EAAAA,KAAK,EAAE;AAFT,CATuB,CAAzB;AAeA,IAAMC,gBAAgB,IACpB;AACEF,EAAAA,KAAK,EAAE,mBADT;AAEEC,EAAAA,KAAK,EAAE,CAAC;AAFV,CADoB,SAKjBF,gBALiB,GAMpB;AACEC,EAAAA,KAAK,EAAE,gBADT;AAEEC,EAAAA,KAAK,EAAE;AAFT,CANoB,EAAtB;AAYA,IAAME,gBAAgB,IACpB;AACEH,EAAAA,KAAK,EAAE,oBADT;AAEEC,EAAAA,KAAK,EAAE,CAAC;A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AAgCF,4BAAYM,UAA5C;AACE,iDAAWnB,iBAAX;;AACF,mBAAQW,6BAAaK,OAArB,cAAgCH,4BAAYM,UAA5C;AACE,iDAAWlB,iBAAX;;AACF,mBAAQU,6BAAaC,OAArB,cAAgCC,4BAAYO,UAA5C;AACE,uBAAWlB,iBAAX;;AACF,mBAAQS,6BAAaI,OAArB,cAAgCF,4BAAYO,UAA5C;AACE,iDAAWjB,iBAAX;;AACF,mBAAQQ,6BAAaK,OAArB,cAAgCH,4BAAYO,UAA5C;AACE,iDAAWhB,iBAAX;;AACF,mBAAQO,6BAAaC,OAArB,cAAgCC,4BAAYQ,IAA5C;AACE,uBAAWhB,WAAX;;AACF,mBAAQM,6BAAaI,OAArB,cAAgCF,4BAAYQ,IAA5C;AACE,iDAAWf,WAAX;;AACF,mBAAQK,6BAAaK,OAArB,cAAgCH,4BAAYQ,IAA5C;AACE,iDAAWd,WAAX;;AACF;AACE,aAAO,EAAP;AAtCJ;AAwCD,CAzCD;;eA2CeC,e","sourcesContent":["import { LIKERT_TYPE, LIKERT_SCALE } from './likertEntities';\n\nconst likert3Agreement = [\n {\n label: 'Disagree',\n value: -1,\n },\n {\n label: 'Unsure',\n value: 0,\n },\n {\n label: 'Agree',\n value: 1,\n },\n];\n\nconst likert5Agreement = [\n {\n label: 'Strongly Disagree',\n value: -2,\n },\n ...likert3Agreement,\n {\n label: 'Strongly Agree',\n value: 2,\n },\n];\n\nconst likert7Agreement = [\n {\n label: 'Extremely Disagree',\n value: -3,\n },\n ...likert5Agreement,\n {\n label: 'Extremely Agree',\n value: 3,\n },\n];\n\nconst likert3Frequency = [\n {\n label: 'Infrequently',\n value: -1,\n },\n {\n label: 'Unsure',\n value: 0,\n },\n {\n label: 'Frequently',\n value: 1,\n },\n];\n\nconst likert5Frequency = [\n {\n label: 'Very Infrequently',\n value: -2,\n },\n ...likert3Frequency,\n {\n label: 'Very Frequently',\n value: 2,\n },\n];\n\nconst likert7Frequency = [\n {\n label: 'Never',\n value: -3,\n },\n ...likert5Frequency,\n {\n label: 'Always',\n value: 3,\n },\n];\n\nconst likert3YesNo = [\n {\n label: 'No',\n value: -1,\n },\n {\n label: 'Unsure',\n value: 0,\n },\n {\n label: 'Yes',\n value: 1,\n },\n];\n\nconst likert5YesNo = [\n {\n label: 'No',\n value: -2,\n },\n {\n label: 'Not really',\n value: -1,\n },\n {\n label: 'Unsure',\n value: 0,\n },\n {\n label: 'Sometimes',\n value: 1,\n },\n {\n label: 'Yes',\n value: 2,\n },\n];\n\nconst likert7YesNo = [\n {\n label: 'No',\n value: -3,\n },\n {\n label: 'Rarely',\n value: -2,\n },\n {\n label: 'Not really',\n value: -1,\n },\n {\n label: 'Unsure',\n value: 0,\n },\n {\n label: 'Sometimes',\n value: 1,\n },\n {\n label: 'Very Often',\n value: 2,\n },\n {\n label: 'Always',\n value: 3,\n },\n];\n\nconst likert3Likelihood = [\n {\n label: 'Not Likely',\n value: -1,\n },\n {\n label: 'Unsure',\n value: 0,\n },\n {\n label: 'Likely',\n value: 1,\n },\n];\n\nconst likert5Likelihood = [\n {\n label: 'Very Unlikely',\n value: -2,\n },\n ...likert3Likelihood,\n {\n label: 'Very Likely',\n value: 2,\n },\n];\n\nconst likert7Likelihood = [\n {\n label: 'Extremely Unlikely',\n value: -3,\n },\n ...likert5Likelihood,\n {\n label: 'Extremely Likely',\n value: 3,\n },\n];\n\nconst likert3Importance = [\n {\n label: 'Not Important',\n value: -1,\n },\n {\n label: 'Unsure',\n value: 0,\n },\n {\n label: 'Important',\n value: 1,\n },\n];\n\nconst likert5Importance = [\n {\n label: 'Very Not Important',\n value: -2,\n },\n ...likert3Importance,\n {\n label: 'Very Important',\n value: 2,\n },\n];\n\nconst likert7Importance = [\n {\n label: 'Extremely Not Important',\n value: -3,\n },\n ...likert5Importance,\n {\n label: 'Extremely Important',\n value: 3,\n },\n];\n\nconst likert3Like = [\n {\n label: 'Dislike',\n value: -1,\n },\n {\n label: 'Unsure',\n value: 0,\n },\n {\n label: 'Like',\n value: 1,\n },\n];\n\nconst likert5Like = [\n {\n label: 'Really Dislike',\n value: -2,\n },\n ...likert3Like,\n {\n label: 'Really Like',\n value: 2,\n },\n];\n\nconst likert7Like = [\n {\n label: 'Extremely Dislike',\n value: -3,\n },\n ...likert5Like,\n {\n label: 'Extremely Like',\n value: 3,\n },\n];\n\nconst generateChoices = (likertScale, likertType) => {\n switch (`${likertScale}-${likertType}`) {\n case `${LIKERT_SCALE.likert3}-${LIKERT_TYPE.agreement}`:\n return [...likert3Agreement];\n case `${LIKERT_SCALE.likert5}-${LIKERT_TYPE.agreement}`:\n return [...likert5Agreement];\n case `${LIKERT_SCALE.likert7}-${LIKERT_TYPE.agreement}`:\n return [...likert7Agreement];\n case `${LIKERT_SCALE.likert3}-${LIKERT_TYPE.frequency}`:\n return [...likert3Frequency];\n case `${LIKERT_SCALE.likert5}-${LIKERT_TYPE.frequency}`:\n return [...likert5Frequency];\n case `${LIKERT_SCALE.likert7}-${LIKERT_TYPE.frequency}`:\n return [...likert7Frequency];\n case `${LIKERT_SCALE.likert3}-${LIKERT_TYPE.yesNo}`:\n return [...likert3YesNo];\n case `${LIKERT_SCALE.likert5}-${LIKERT_TYPE.yesNo}`:\n return [...likert5YesNo];\n case `${LIKERT_SCALE.likert7}-${LIKERT_TYPE.yesNo}`:\n return [...likert7YesNo];\n case `${LIKERT_SCALE.likert3}-${LIKERT_TYPE.likelihood}`:\n return [...likert3Likelihood];\n case `${LIKERT_SCALE.likert5}-${LIKERT_TYPE.likelihood}`:\n return [...likert5Likelihood];\n case `${LIKERT_SCALE.likert7}-${LIKERT_TYPE.likelihood}`:\n return [...likert7Likelihood];\n case `${LIKERT_SCALE.likert3}-${LIKERT_TYPE.importance}`:\n return [...likert3Importance];\n case `${LIKERT_SCALE.likert5}-${LIKERT_TYPE.importance}`:\n return [...likert5Importance];\n case `${LIKERT_SCALE.likert7}-${LIKERT_TYPE.importance}`:\n return [...likert7Importance];\n case `${LIKERT_SCALE.likert3}-${LIKERT_TYPE.like}`:\n return [...likert3Like];\n case `${LIKERT_SCALE.likert5}-${LIKERT_TYPE.like}`:\n return [...likert5Like];\n case `${LIKERT_SCALE.likert7}-${LIKERT_TYPE.like}`:\n return [...likert7Like];\n default:\n return [];\n }\n};\n\nexport default generateChoices;\n"],"file":"choiceGenerator.js"}
|
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports["default"] = void 0;
|
|
7
|
-
|
|
8
|
-
/** NOTE: teacherInstructions, studentInstructions, rationale & scoringType
|
|
9
|
-
* functionalities are not defined yet - the value for those can belong to
|
|
10
|
-
* model or to configure
|
|
11
|
-
*/
|
|
12
|
-
var _default = {
|
|
13
|
-
model: {
|
|
14
|
-
likertScale: 'likert3',
|
|
15
|
-
likertType: 'agreement',
|
|
16
|
-
likertOrientation: 'horizontal',
|
|
17
|
-
choices: [],
|
|
18
|
-
teacherInstructionsEnabled: true
|
|
19
|
-
},
|
|
20
|
-
configuration: {
|
|
21
|
-
prompt: {
|
|
22
|
-
settings: true,
|
|
23
|
-
label: 'Prompt'
|
|
24
|
-
},
|
|
25
|
-
settingsPanelDisabled: false,
|
|
26
|
-
spellCheck: {
|
|
27
|
-
label: 'Spellcheck',
|
|
28
|
-
settings: false,
|
|
29
|
-
enabled: true
|
|
30
|
-
},
|
|
31
|
-
teacherInstructions: {
|
|
32
|
-
settings: true,
|
|
33
|
-
label: 'Teacher Instructions'
|
|
34
|
-
}
|
|
35
|
-
}
|
|
36
|
-
};
|
|
37
|
-
exports["default"] = _default;
|
|
38
|
-
//# sourceMappingURL=defaults.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/defaults.js"],"names":["model","likertScale","likertType","likertOrientation","choices","teacherInstructionsEnabled","configuration","prompt","settings","label","settingsPanelDisabled","spellCheck","enabled","teacherInstructions"],"mappings":";;;;;;;AAAA;AACA;AACA;AACA;eACe;AACbA,EAAAA,KAAK,EAAE;AACLC,IAAAA,WAAW,EAAE,SADR;AAELC,IAAAA,UAAU,EAAE,WAFP;AAGLC,IAAAA,iBAAiB,EAAE,YAHd;AAILC,IAAAA,OAAO,EAAE,EAJJ;AAKLC,IAAAA,0BAA0B,EAAE;AALvB,GADM;AAQbC,EAAAA,aAAa,EAAE;AACbC,IAAAA,MAAM,EAAE;AACNC,MAAAA,QAAQ,EAAE,IADJ;AAENC,MAAAA,KAAK,EAAE;AAFD,KADK;AAKbC,IAAAA,qBAAqB,EAAE,KALV;AAMbC,IAAAA,UAAU,EAAE;AACVF,MAAAA,KAAK,EAAE,YADG;AAEVD,MAAAA,QAAQ,EAAE,KAFA;AAGVI,MAAAA,OAAO,EAAE;AAHC,KANC;AAWbC,IAAAA,mBAAmB,EAAE;AACnBL,MAAAA,QAAQ,EAAE,IADS;AAEnBC,MAAAA,KAAK,EAAE;AAFY;AAXR;AARF,C","sourcesContent":["/** NOTE: teacherInstructions, studentInstructions, rationale & scoringType\n * functionalities are not defined yet - the value for those can belong to\n * model or to configure\n */\nexport default {\n model: {\n likertScale: 'likert3',\n likertType: 'agreement',\n likertOrientation: 'horizontal',\n choices: [],\n teacherInstructionsEnabled: true,\n },\n configuration: {\n prompt: {\n settings: true,\n label: 'Prompt',\n },\n settingsPanelDisabled: false,\n spellCheck: {\n label: 'Spellcheck',\n settings: false,\n enabled: true,\n },\n teacherInstructions: {\n settings: true,\n label: 'Teacher Instructions',\n },\n },\n};\n"],"file":"defaults.js"}
|
package/configure/lib/index.js
DELETED
|
@@ -1,171 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
-
|
|
5
|
-
Object.defineProperty(exports, "__esModule", {
|
|
6
|
-
value: true
|
|
7
|
-
});
|
|
8
|
-
exports["default"] = void 0;
|
|
9
|
-
|
|
10
|
-
var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));
|
|
11
|
-
|
|
12
|
-
var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));
|
|
13
|
-
|
|
14
|
-
var _assertThisInitialized2 = _interopRequireDefault(require("@babel/runtime/helpers/assertThisInitialized"));
|
|
15
|
-
|
|
16
|
-
var _inherits2 = _interopRequireDefault(require("@babel/runtime/helpers/inherits"));
|
|
17
|
-
|
|
18
|
-
var _possibleConstructorReturn2 = _interopRequireDefault(require("@babel/runtime/helpers/possibleConstructorReturn"));
|
|
19
|
-
|
|
20
|
-
var _getPrototypeOf2 = _interopRequireDefault(require("@babel/runtime/helpers/getPrototypeOf"));
|
|
21
|
-
|
|
22
|
-
var _wrapNativeSuper2 = _interopRequireDefault(require("@babel/runtime/helpers/wrapNativeSuper"));
|
|
23
|
-
|
|
24
|
-
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
25
|
-
|
|
26
|
-
var _react = _interopRequireDefault(require("react"));
|
|
27
|
-
|
|
28
|
-
var _reactDom = _interopRequireDefault(require("react-dom"));
|
|
29
|
-
|
|
30
|
-
var _debug = _interopRequireDefault(require("debug"));
|
|
31
|
-
|
|
32
|
-
var _pieConfigureEvents = require("@pie-framework/pie-configure-events");
|
|
33
|
-
|
|
34
|
-
var _main = _interopRequireDefault(require("./main"));
|
|
35
|
-
|
|
36
|
-
var _defaults = _interopRequireDefault(require("lodash/defaults"));
|
|
37
|
-
|
|
38
|
-
var _defaults2 = _interopRequireDefault(require("./defaults"));
|
|
39
|
-
|
|
40
|
-
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
41
|
-
|
|
42
|
-
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { (0, _defineProperty2["default"])(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
43
|
-
|
|
44
|
-
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = (0, _getPrototypeOf2["default"])(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = (0, _getPrototypeOf2["default"])(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return (0, _possibleConstructorReturn2["default"])(this, result); }; }
|
|
45
|
-
|
|
46
|
-
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
|
|
47
|
-
|
|
48
|
-
var log = (0, _debug["default"])('likert:configure');
|
|
49
|
-
|
|
50
|
-
var prepareCustomizationObject = function prepareCustomizationObject(config, model) {
|
|
51
|
-
var configuration = (0, _defaults["default"])(config, _defaults2["default"].configuration);
|
|
52
|
-
return {
|
|
53
|
-
configuration: configuration,
|
|
54
|
-
model: model
|
|
55
|
-
};
|
|
56
|
-
};
|
|
57
|
-
|
|
58
|
-
var Likert = /*#__PURE__*/function (_HTMLElement) {
|
|
59
|
-
(0, _inherits2["default"])(Likert, _HTMLElement);
|
|
60
|
-
|
|
61
|
-
var _super = _createSuper(Likert);
|
|
62
|
-
|
|
63
|
-
function Likert() {
|
|
64
|
-
var _this;
|
|
65
|
-
|
|
66
|
-
(0, _classCallCheck2["default"])(this, Likert);
|
|
67
|
-
_this = _super.call(this);
|
|
68
|
-
_this._model = Likert.createDefaultModel();
|
|
69
|
-
_this._configuration = _defaults2["default"].configuration;
|
|
70
|
-
_this.onModelChanged = _this.onModelChanged.bind((0, _assertThisInitialized2["default"])(_this));
|
|
71
|
-
_this.onConfigurationChanged = _this.onConfigurationChanged.bind((0, _assertThisInitialized2["default"])(_this));
|
|
72
|
-
return _this;
|
|
73
|
-
}
|
|
74
|
-
|
|
75
|
-
(0, _createClass2["default"])(Likert, [{
|
|
76
|
-
key: "model",
|
|
77
|
-
set: function set(s) {
|
|
78
|
-
this._model = Likert.createDefaultModel(s);
|
|
79
|
-
this._model = _objectSpread(_objectSpread({}, this._model), {}, {
|
|
80
|
-
choices: this._model.choices.map(function (choice) {
|
|
81
|
-
return _objectSpread(_objectSpread({}, choice), {}, {
|
|
82
|
-
value: parseInt(choice.value)
|
|
83
|
-
});
|
|
84
|
-
})
|
|
85
|
-
});
|
|
86
|
-
|
|
87
|
-
this._render();
|
|
88
|
-
}
|
|
89
|
-
}, {
|
|
90
|
-
key: "configuration",
|
|
91
|
-
set: function set(c) {
|
|
92
|
-
var info = prepareCustomizationObject(c, this._model);
|
|
93
|
-
this.onModelChanged(info.model);
|
|
94
|
-
this._configuration = info.configuration;
|
|
95
|
-
|
|
96
|
-
this._render();
|
|
97
|
-
}
|
|
98
|
-
}, {
|
|
99
|
-
key: "disableSidePanel",
|
|
100
|
-
set: function set(s) {
|
|
101
|
-
this._disableSidePanel = s;
|
|
102
|
-
|
|
103
|
-
this._render();
|
|
104
|
-
}
|
|
105
|
-
}, {
|
|
106
|
-
key: "dispatchModelUpdated",
|
|
107
|
-
value: function dispatchModelUpdated(reset) {
|
|
108
|
-
var resetValue = !!reset;
|
|
109
|
-
this.dispatchEvent(new _pieConfigureEvents.ModelUpdatedEvent(this._model, resetValue));
|
|
110
|
-
}
|
|
111
|
-
}, {
|
|
112
|
-
key: "onModelChanged",
|
|
113
|
-
value: function onModelChanged(m, reset) {
|
|
114
|
-
this._model = m;
|
|
115
|
-
|
|
116
|
-
this._render();
|
|
117
|
-
|
|
118
|
-
this.dispatchModelUpdated(reset);
|
|
119
|
-
}
|
|
120
|
-
}, {
|
|
121
|
-
key: "onConfigurationChanged",
|
|
122
|
-
value: function onConfigurationChanged(c) {
|
|
123
|
-
this._configuration = prepareCustomizationObject(c, this._model).configuration;
|
|
124
|
-
|
|
125
|
-
if (this._model) {
|
|
126
|
-
this.onModelChanged(this._model);
|
|
127
|
-
}
|
|
128
|
-
|
|
129
|
-
this._render();
|
|
130
|
-
}
|
|
131
|
-
}, {
|
|
132
|
-
key: "insertSound",
|
|
133
|
-
value: function insertSound(handler) {
|
|
134
|
-
this.dispatchEvent(new _pieConfigureEvents.InsertSoundEvent(handler));
|
|
135
|
-
}
|
|
136
|
-
}, {
|
|
137
|
-
key: "onDeleteSound",
|
|
138
|
-
value: function onDeleteSound(src, done) {
|
|
139
|
-
this.dispatchEvent(new _pieConfigureEvents.DeleteSoundEvent(src, done));
|
|
140
|
-
}
|
|
141
|
-
}, {
|
|
142
|
-
key: "_render",
|
|
143
|
-
value: function _render() {
|
|
144
|
-
log('_render');
|
|
145
|
-
|
|
146
|
-
var element = /*#__PURE__*/_react["default"].createElement(_main["default"], {
|
|
147
|
-
model: this._model,
|
|
148
|
-
configuration: this._configuration,
|
|
149
|
-
onModelChanged: this.onModelChanged,
|
|
150
|
-
onConfigurationChanged: this.onConfigurationChanged,
|
|
151
|
-
disableSidePanel: this._disableSidePanel,
|
|
152
|
-
uploadSoundSupport: {
|
|
153
|
-
add: this.insertSound.bind(this),
|
|
154
|
-
"delete": this.onDeleteSound.bind(this)
|
|
155
|
-
}
|
|
156
|
-
});
|
|
157
|
-
|
|
158
|
-
_reactDom["default"].render(element, this);
|
|
159
|
-
}
|
|
160
|
-
}]);
|
|
161
|
-
return Likert;
|
|
162
|
-
}( /*#__PURE__*/(0, _wrapNativeSuper2["default"])(HTMLElement));
|
|
163
|
-
|
|
164
|
-
exports["default"] = Likert;
|
|
165
|
-
(0, _defineProperty2["default"])(Likert, "createDefaultModel", function () {
|
|
166
|
-
var model = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
167
|
-
return _objectSpread(_objectSpread(_objectSpread({}, _defaults2["default"].model), model), {}, {
|
|
168
|
-
choices: model && model.choices || []
|
|
169
|
-
});
|
|
170
|
-
});
|
|
171
|
-
//# sourceMappingURL=index.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/index.js"],"names":["log","prepareCustomizationObject","config","model","configuration","sensibleDefaults","Likert","_model","createDefaultModel","_configuration","onModelChanged","bind","onConfigurationChanged","s","choices","map","choice","value","parseInt","_render","c","info","_disableSidePanel","reset","resetValue","dispatchEvent","ModelUpdatedEvent","m","dispatchModelUpdated","handler","InsertSoundEvent","src","done","DeleteSoundEvent","element","React","createElement","Main","disableSidePanel","uploadSoundSupport","add","insertSound","onDeleteSound","ReactDOM","render","HTMLElement"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;AACA;;AACA;;AACA;;AAEA;;AACA;;AAEA;;;;;;;;;;AAEA,IAAMA,GAAG,GAAG,uBAAM,kBAAN,CAAZ;;AAEA,IAAMC,0BAA0B,GAAG,SAA7BA,0BAA6B,CAACC,MAAD,EAASC,KAAT,EAAmB;AACpD,MAAMC,aAAa,GAAG,0BAASF,MAAT,EAAiBG,sBAAiBD,aAAlC,CAAtB;AAEA,SAAO;AACLA,IAAAA,aAAa,EAAbA,aADK;AAELD,IAAAA,KAAK,EAALA;AAFK,GAAP;AAID,CAPD;;IASqBG,M;;;;;AAOnB,oBAAc;AAAA;;AAAA;AACZ;AACA,UAAKC,MAAL,GAAcD,MAAM,CAACE,kBAAP,EAAd;AACA,UAAKC,cAAL,GAAsBJ,sBAAiBD,aAAvC;AACA,UAAKM,cAAL,GAAsB,MAAKA,cAAL,CAAoBC,IAApB,gDAAtB;AACA,UAAKC,sBAAL,GAA8B,MAAKA,sBAAL,CAA4BD,IAA5B,gDAA9B;AALY;AAMb;;;;SAED,a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J,aAAL,CAAmB,IAAIK,oCAAJ,CAAqBD,OAArB,CAAnB;AACD;;;WAED,uBAAcE,GAAd,EAAmBC,IAAnB,EAAyB;AACvB,WAAKP,aAAL,CAAmB,IAAIQ,oCAAJ,CAAqBF,GAArB,EAA0BC,IAA1B,CAAnB;AACD;;;WAED,mBAAU;AACRhC,MAAAA,GAAG,CAAC,SAAD,CAAH;;AACA,UAAIkC,OAAO,gBAAGC,kBAAMC,aAAN,CAAoBC,gBAApB,EAA0B;AACtClC,QAAAA,KAAK,EAAE,KAAKI,MAD0B;AAEtCH,QAAAA,aAAa,EAAE,KAAKK,cAFkB;AAGtCC,QAAAA,cAAc,EAAE,KAAKA,cAHiB;AAItCE,QAAAA,sBAAsB,EAAE,KAAKA,sBAJS;AAKtC0B,QAAAA,gBAAgB,EAAE,KAAKhB,iBALe;AAMtCiB,QAAAA,kBAAkB,EAAE;AAClBC,UAAAA,GAAG,EAAE,KAAKC,WAAL,CAAiB9B,IAAjB,CAAsB,IAAtB,CADa;AAElB,oBAAQ,KAAK+B,aAAL,CAAmB/B,IAAnB,CAAwB,IAAxB;AAFU;AANkB,OAA1B,CAAd;;AAWAgC,2BAASC,MAAT,CAAgBV,OAAhB,EAAyB,IAAzB;AACD;;;kDAjFiCW,W;;;iCAAfvC,M,wBACS;AAAA,MAACH,KAAD,uEAAS,EAAT;AAAA,uDACvBE,sBAAiBF,KADM,GAEvBA,KAFuB;AAG1BW,IAAAA,OAAO,EAAGX,KAAK,IAAIA,KAAK,CAACW,OAAhB,IAA4B;AAHX;AAAA,C","sourcesContent":["import React from 'react';\nimport ReactDOM from 'react-dom';\nimport debug from 'debug';\nimport { ModelUpdatedEvent, InsertSoundEvent, DeleteSoundEvent } from '@pie-framework/pie-configure-events';\n\nimport Main from './main';\nimport defaults from 'lodash/defaults';\n\nimport sensibleDefaults from './defaults';\n\nconst log = debug('likert:configure');\n\nconst prepareCustomizationObject = (config, model) => {\n const configuration = defaults(config, sensibleDefaults.configuration);\n\n return {\n configuration,\n model,\n };\n};\n\nexport default class Likert extends HTMLElement {\n static createDefaultModel = (model = {}) => ({\n ...sensibleDefaults.model,\n ...model,\n choices: (model && model.choices) || [],\n });\n\n constructor() {\n super();\n this._model = Likert.createDefaultModel();\n this._configuration = sensibleDefaults.configuration;\n this.onModelChanged = this.onModelChanged.bind(this);\n this.onConfigurationChanged = this.onConfigurationChanged.bind(this);\n }\n\n set model(s) {\n this._model = Likert.createDefaultModel(s);\n this._model = {\n ...this._model,\n choices: this._model.choices.map((choice) => ({ ...choice, value: parseInt(choice.value) })),\n };\n this._render();\n }\n\n set configuration(c) {\n const info = prepareCustomizationObject(c, this._model);\n\n this.onModelChanged(info.model);\n this._configuration = info.configuration;\n this._render();\n }\n\n set disableSidePanel(s) {\n this._disableSidePanel = s;\n this._render();\n }\n\n dispatchModelUpdated(reset) {\n const resetValue = !!reset;\n\n this.dispatchEvent(new ModelUpdatedEvent(this._model, resetValue));\n }\n\n onModelChanged(m, reset) {\n this._model = m;\n this._render();\n this.dispatchModelUpdated(reset);\n }\n\n onConfigurationChanged(c) {\n this._configuration = prepareCustomizationObject(c, this._model).configuration;\n\n if (this._model) {\n this.onModelChanged(this._model);\n }\n\n this._render();\n }\n\n insertSound(handler) {\n this.dispatchEvent(new InsertSoundEvent(handler));\n }\n\n onDeleteSound(src, done) {\n this.dispatchEvent(new DeleteSoundEvent(src, done));\n }\n\n _render() {\n log('_render');\n let element = React.createElement(Main, {\n model: this._model,\n configuration: this._configuration,\n onModelChanged: this.onModelChanged,\n onConfigurationChanged: this.onConfigurationChanged,\n disableSidePanel: this._disableSidePanel,\n uploadSoundSupport: {\n add: this.insertSound.bind(this),\n delete: this.onDeleteSound.bind(this),\n },\n });\n ReactDOM.render(element, this);\n }\n}\n"],"file":"index.js"}
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.LIKERT_TYPE = exports.LIKERT_SCALE = exports.LIKERT_ORIENTATION = void 0;
|
|
7
|
-
var LIKERT_SCALE = {
|
|
8
|
-
likert3: 'likert3',
|
|
9
|
-
likert5: 'likert5',
|
|
10
|
-
likert7: 'likert7'
|
|
11
|
-
};
|
|
12
|
-
exports.LIKERT_SCALE = LIKERT_SCALE;
|
|
13
|
-
var LIKERT_TYPE = {
|
|
14
|
-
agreement: 'agreement',
|
|
15
|
-
frequency: 'frequency',
|
|
16
|
-
yesNo: 'yesNo',
|
|
17
|
-
importance: 'importance',
|
|
18
|
-
likelihood: 'likelihood',
|
|
19
|
-
like: 'like'
|
|
20
|
-
};
|
|
21
|
-
exports.LIKERT_TYPE = LIKERT_TYPE;
|
|
22
|
-
var LIKERT_ORIENTATION = {
|
|
23
|
-
horizontal: 'horizontal',
|
|
24
|
-
vertical: 'vertical'
|
|
25
|
-
};
|
|
26
|
-
exports.LIKERT_ORIENTATION = LIKERT_ORIENTATION;
|
|
27
|
-
//# sourceMappingURL=likertEntities.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/likertEntities.js"],"names":["LIKERT_SCALE","likert3","likert5","likert7","LIKERT_TYPE","agreement","frequency","yesNo","importance","likelihood","like","LIKERT_ORIENTATION","horizontal","vertical"],"mappings":";;;;;;AAAO,IAAMA,YAAY,GAAG;AAC1BC,EAAAA,OAAO,EAAE,SADiB;AAE1BC,EAAAA,OAAO,EAAE,SAFiB;AAG1BC,EAAAA,OAAO,EAAE;AAHiB,CAArB;;AAMA,IAAMC,WAAW,GAAG;AACzBC,EAAAA,SAAS,EAAE,WADc;AAEzBC,EAAAA,SAAS,EAAE,WAFc;AAGzBC,EAAAA,KAAK,EAAE,OAHkB;AAIzBC,EAAAA,UAAU,EAAE,YAJa;AAKzBC,EAAAA,UAAU,EAAE,YALa;AAMzBC,EAAAA,IAAI,EAAE;AANmB,CAApB;;AASA,IAAMC,kBAAkB,GAAG;AAChCC,EAAAA,UAAU,EAAE,YADoB;AAEhCC,EAAAA,QAAQ,EAAE;AAFsB,CAA3B","sourcesContent":["export const LIKERT_SCALE = {\n likert3: 'likert3',\n likert5: 'likert5',\n likert7: 'likert7',\n};\n\nexport const LIKERT_TYPE = {\n agreement: 'agreement',\n frequency: 'frequency',\n yesNo: 'yesNo',\n importance: 'importance',\n likelihood: 'likelihood',\n like: 'like',\n};\n\nexport const LIKERT_ORIENTATION = {\n horizontal: 'horizontal',\n vertical: 'vertical',\n};\n"],"file":"likertEntities.js"}
|