case-editor-tools 1.0.0-beta.3 → 1.0.0-beta.30
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/{build/constants → constants}/key-definitions.d.ts +1 -0
- package/{build/constants → constants}/key-definitions.js +3 -1
- package/{build/constants → constants}/key-definitions.js.map +1 -1
- package/exporter/index.d.ts +2 -0
- package/exporter/index.js +99 -0
- package/exporter/index.js.map +1 -0
- package/{build/expression-utils → expression-utils}/expressionGen.d.ts +1 -1
- package/{build/expression-utils → expression-utils}/expressionGen.js +0 -0
- package/{build/expression-utils → expression-utils}/expressionGen.js.map +0 -0
- package/{build/expression-utils → expression-utils}/studyEngineExpressions.d.ts +37 -7
- package/{build/expression-utils → expression-utils}/studyEngineExpressions.js +93 -4
- package/{build/expression-utils → expression-utils}/studyEngineExpressions.js.map +1 -1
- package/{build/index.d.ts → index.d.ts} +0 -0
- package/{build/index.js → index.js} +0 -0
- package/{build/index.js.map → index.js.map} +0 -0
- package/{build/item-editor-8fd24b61.js → item-editor-c6933791.js} +69 -51
- package/item-editor-c6933791.js.map +1 -0
- package/logger/index.d.ts +1 -0
- package/logger/index.js +10 -0
- package/logger/index.js.map +1 -0
- package/{build/logger → logger}/logger.d.ts +0 -0
- package/{build/logger → logger}/logger.js +0 -0
- package/{build/logger → logger}/logger.js.map +0 -0
- package/package.json +7 -8
- package/surveys/index.d.ts +3 -0
- package/surveys/index.js +28 -0
- package/surveys/index.js.map +1 -0
- package/surveys/responseTypeGenerators/likertGroupComponents.d.ts +27 -0
- package/surveys/responseTypeGenerators/likertGroupComponents.js +347 -0
- package/surveys/responseTypeGenerators/likertGroupComponents.js.map +1 -0
- package/surveys/responseTypeGenerators/matrixGroupComponent.d.ts +49 -0
- package/surveys/responseTypeGenerators/matrixGroupComponent.js +99 -0
- package/surveys/responseTypeGenerators/matrixGroupComponent.js.map +1 -0
- package/surveys/responseTypeGenerators/optionGroupComponents.d.ts +7 -0
- package/surveys/responseTypeGenerators/optionGroupComponents.js +125 -0
- package/surveys/responseTypeGenerators/optionGroupComponents.js.map +1 -0
- package/{build → surveys}/survey-editor/component-editor.d.ts +1 -1
- package/{build → surveys}/survey-editor/component-editor.js +0 -0
- package/{build → surveys}/survey-editor/component-editor.js.map +0 -0
- package/{build → surveys}/survey-editor/data-types.d.ts +1 -1
- package/{build → surveys}/survey-editor/data-types.js +0 -0
- package/{build → surveys}/survey-editor/data-types.js.map +0 -0
- package/{build → surveys}/survey-editor/item-editor.d.ts +1 -1
- package/{build → surveys}/survey-editor/item-editor.js +3 -2
- package/{build → surveys}/survey-editor/item-editor.js.map +1 -1
- package/{build → surveys}/survey-editor/survey-editor.d.ts +6 -1
- package/{build → surveys}/survey-editor/survey-editor.js +15 -8
- package/{build → surveys}/survey-editor/survey-editor.js.map +1 -1
- package/{build/expression-utils/surveyEngineExpressions.d.ts → surveys/survey-engine-expressions.d.ts} +9 -2
- package/{build/expression-utils/surveyEngineExpressions.js → surveys/survey-engine-expressions.js} +36 -4
- package/{build/expression-utils/surveyEngineExpressions.js.map → surveys/survey-engine-expressions.js.map} +1 -1
- package/surveys/survey-items.d.ts +66 -0
- package/surveys/survey-items.js +302 -0
- package/surveys/survey-items.js.map +1 -0
- package/{build → surveys}/types/group.d.ts +1 -1
- package/{build → surveys}/types/group.js +5 -5
- package/{build → surveys}/types/group.js.map +0 -0
- package/surveys/types/index.d.ts +4 -0
- package/surveys/types/index.js +20 -0
- package/surveys/types/index.js.map +1 -0
- package/surveys/types/item-properties.d.ts +189 -0
- package/surveys/types/item-properties.js +3 -0
- package/surveys/types/item-properties.js.map +1 -0
- package/{build → surveys}/types/item.d.ts +1 -1
- package/{build → surveys}/types/item.js +0 -0
- package/{build → surveys}/types/item.js.map +0 -0
- package/{build/types/surveyDefinition.d.ts → surveys/types/survey-definition.d.ts} +7 -3
- package/{build/types/surveyDefinition.js → surveys/types/survey-definition.js} +19 -11
- package/surveys/types/survey-definition.js.map +1 -0
- package/{build → surveys}/utils/componentGenerators.d.ts +2 -13
- package/surveys/utils/componentGenerators.js +58 -0
- package/{build → surveys}/utils/componentGenerators.js.map +1 -1
- package/surveys/utils/optionDefGenerators.d.ts +69 -0
- package/surveys/utils/optionDefGenerators.js +169 -0
- package/surveys/utils/optionDefGenerators.js.map +1 -0
- package/{build → surveys}/utils/randomKeyGenerator.d.ts +0 -0
- package/{build → surveys}/utils/randomKeyGenerator.js +0 -0
- package/{build → surveys}/utils/randomKeyGenerator.js.map +0 -0
- package/{build → surveys}/utils/simple-generators.d.ts +2 -2
- package/{build → surveys}/utils/simple-generators.js +5 -5
- package/{build → surveys}/utils/simple-generators.js.map +0 -0
- package/{build → surveys}/utils/simple-question-editor.d.ts +3 -3
- package/{build → surveys}/utils/simple-question-editor.js +7 -6
- package/{build → surveys}/utils/simple-question-editor.js.map +1 -1
- package/{build/types → types}/duration.d.ts +0 -0
- package/{build/types → types}/duration.js +0 -0
- package/{build/types → types}/duration.js.map +0 -0
- package/{build/types → types}/expression.d.ts +1 -1
- package/{build/types → types}/expression.js +0 -0
- package/{build/types → types}/expression.js.map +0 -0
- package/{build/types → types}/study.d.ts +2 -2
- package/{build/types → types}/study.js +0 -0
- package/{build/types → types}/study.js.map +0 -0
- package/{build/types → types}/studyRules.d.ts +1 -1
- package/{build/types → types}/studyRules.js +0 -0
- package/{build/types → types}/studyRules.js.map +0 -0
- package/.babelrc.js +0 -7
- package/.editorconfig +0 -13
- package/LICENSE +0 -202
- package/build/item-editor-8fd24b61.js.map +0 -1
- package/build/package.json +0 -26
- package/build/types/surveyDefinition.js.map +0 -1
- package/build/utils/componentGenerators.js +0 -92
- package/build/utils/question-type-generator.d.ts +0 -283
- package/build/utils/question-type-generator.js +0 -949
- package/build/utils/question-type-generator.js.map +0 -1
- package/rollup.config.js +0 -53
- package/src/constants/key-definitions.ts +0 -13
- package/src/expression-utils/expressionGen.ts +0 -28
- package/src/expression-utils/studyEngineExpressions.ts +0 -359
- package/src/expression-utils/surveyEngineExpressions.ts +0 -483
- package/src/index.ts +0 -1
- package/src/logger/logger.ts +0 -31
- package/src/survey-editor/component-editor.ts +0 -133
- package/src/survey-editor/data-types.ts +0 -18
- package/src/survey-editor/item-editor.ts +0 -528
- package/src/survey-editor/survey-editor.ts +0 -260
- package/src/types/duration.ts +0 -32
- package/src/types/expression.ts +0 -22
- package/src/types/group.ts +0 -73
- package/src/types/item.ts +0 -42
- package/src/types/study.ts +0 -17
- package/src/types/studyRules.ts +0 -39
- package/src/types/surveyDefinition.ts +0 -83
- package/src/utils/componentGenerators.ts +0 -122
- package/src/utils/question-type-generator.ts +0 -1516
- package/src/utils/randomKeyGenerator.ts +0 -11
- package/src/utils/simple-generators.ts +0 -106
- package/src/utils/simple-question-editor.ts +0 -52
- package/tsconfig.json +0 -100
|
@@ -14,8 +14,10 @@ const sliderCategoricalKey = "scc";
|
|
|
14
14
|
const inputKey = "ic";
|
|
15
15
|
const numericInputKey = "num";
|
|
16
16
|
const datePickerKey = "date";
|
|
17
|
-
const matrixKey = "mat";
|
|
17
|
+
const matrixKey = "mat";
|
|
18
|
+
const clozeKey = "cloze";
|
|
18
19
|
|
|
20
|
+
exports.clozeKey = clozeKey;
|
|
19
21
|
exports.datePickerKey = datePickerKey;
|
|
20
22
|
exports.dropDownKey = dropDownKey;
|
|
21
23
|
exports.inputKey = inputKey;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"key-definitions.js","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"key-definitions.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
5
|
+
var fs = require('fs');
|
|
6
|
+
var logger_logger = require('../logger/logger.js');
|
|
7
|
+
|
|
8
|
+
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
9
|
+
|
|
10
|
+
var fs__default = /*#__PURE__*/_interopDefaultLegacy(fs);
|
|
11
|
+
|
|
12
|
+
const generateFilesForStudy = (study, pretty) => {
|
|
13
|
+
const outputName = study.outputFolderName ? study.outputFolderName : study.studyKey;
|
|
14
|
+
const outputRoot = `./output/${outputName}`;
|
|
15
|
+
logger_logger.Logger.log(`Start generating files for study ${outputName}.`);
|
|
16
|
+
if (!fs__default["default"].existsSync(outputRoot)) {
|
|
17
|
+
fs__default["default"].mkdirSync(outputRoot, { recursive: true });
|
|
18
|
+
}
|
|
19
|
+
// Surveys:
|
|
20
|
+
generateSurveyFiles(study, outputRoot, pretty);
|
|
21
|
+
// Study rules:
|
|
22
|
+
generateStudyRuleFile(study, outputRoot, pretty);
|
|
23
|
+
// Custom Study rules: (manually triggered rules)
|
|
24
|
+
generateCustomStudyRules(study, outputRoot, pretty);
|
|
25
|
+
};
|
|
26
|
+
const generateSurveyFiles = (study, outputPath, pretty) => {
|
|
27
|
+
if (study.surveys.length > 0) {
|
|
28
|
+
logger_logger.Logger.log(`\tSurveys:`);
|
|
29
|
+
}
|
|
30
|
+
else {
|
|
31
|
+
logger_logger.Logger.log(`\tNo surveys in the study.`);
|
|
32
|
+
}
|
|
33
|
+
const surveyOutPath = `${outputPath}/surveys`;
|
|
34
|
+
if (!fs__default["default"].existsSync(surveyOutPath)) {
|
|
35
|
+
fs__default["default"].mkdirSync(surveyOutPath, { recursive: true });
|
|
36
|
+
}
|
|
37
|
+
study.surveys.forEach(survey => {
|
|
38
|
+
const fileName = `${surveyOutPath}/${survey.key}.json`;
|
|
39
|
+
const outputObject = {
|
|
40
|
+
studyKey: study.studyKey,
|
|
41
|
+
survey: survey.getSurvey()
|
|
42
|
+
};
|
|
43
|
+
try {
|
|
44
|
+
fs__default["default"].writeFileSync(fileName, JSON.stringify(outputObject, undefined, pretty ? 2 : undefined));
|
|
45
|
+
}
|
|
46
|
+
catch (err) {
|
|
47
|
+
logger_logger.Logger.error(err);
|
|
48
|
+
return;
|
|
49
|
+
}
|
|
50
|
+
logger_logger.Logger.success(`\t\t${survey.key} saved`);
|
|
51
|
+
});
|
|
52
|
+
};
|
|
53
|
+
const generateStudyRuleFile = (study, outputPath, pretty) => {
|
|
54
|
+
if (!study.studyRules) {
|
|
55
|
+
logger_logger.Logger.log(`\tNo study rules in the study.`);
|
|
56
|
+
return;
|
|
57
|
+
}
|
|
58
|
+
else {
|
|
59
|
+
logger_logger.Logger.log(`\tStudy rule:`);
|
|
60
|
+
}
|
|
61
|
+
const fileName = `${outputPath}/studyRules.json`;
|
|
62
|
+
const outputObject = study.studyRules.get();
|
|
63
|
+
try {
|
|
64
|
+
fs__default["default"].writeFileSync(fileName, JSON.stringify(outputObject, undefined, pretty ? 2 : undefined));
|
|
65
|
+
}
|
|
66
|
+
catch (err) {
|
|
67
|
+
logger_logger.Logger.error(err);
|
|
68
|
+
return;
|
|
69
|
+
}
|
|
70
|
+
logger_logger.Logger.success(`\t\tStudy rules saved`);
|
|
71
|
+
};
|
|
72
|
+
const generateCustomStudyRules = (study, outputPath, pretty) => {
|
|
73
|
+
if (!study.customStudyRules || study.customStudyRules.length < 0) {
|
|
74
|
+
logger_logger.Logger.log(`\tNo custom study rules in the study.`);
|
|
75
|
+
return;
|
|
76
|
+
}
|
|
77
|
+
else {
|
|
78
|
+
logger_logger.Logger.log(`\tCustom study rules:`);
|
|
79
|
+
}
|
|
80
|
+
const customRulePath = `${outputPath}/customRules`;
|
|
81
|
+
if (!fs__default["default"].existsSync(customRulePath)) {
|
|
82
|
+
fs__default["default"].mkdirSync(customRulePath, { recursive: true });
|
|
83
|
+
}
|
|
84
|
+
study.customStudyRules.forEach(studyRule => {
|
|
85
|
+
const fileName = `${customRulePath}/${studyRule.name}.json`;
|
|
86
|
+
const outputObject = studyRule.rules;
|
|
87
|
+
try {
|
|
88
|
+
fs__default["default"].writeFileSync(fileName, JSON.stringify(outputObject, undefined, pretty ? 2 : undefined));
|
|
89
|
+
}
|
|
90
|
+
catch (err) {
|
|
91
|
+
logger_logger.Logger.error(err);
|
|
92
|
+
return;
|
|
93
|
+
}
|
|
94
|
+
logger_logger.Logger.success(`\t\tRule ${studyRule.name} saved`);
|
|
95
|
+
});
|
|
96
|
+
};
|
|
97
|
+
|
|
98
|
+
exports.generateFilesForStudy = generateFilesForStudy;
|
|
99
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { Expression, ExpressionName } from "survey-engine/
|
|
1
|
+
import { Expression, ExpressionName } from "survey-engine/data_types";
|
|
2
2
|
export declare const generateExpression: (name: ExpressionName, returnType?: "string" | "float" | undefined, ...args: any[]) => Expression;
|
|
File without changes
|
|
File without changes
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Expression } from "survey-engine/
|
|
1
|
+
import { Expression } from "survey-engine/data_types";
|
|
2
2
|
import { Duration } from "../types/duration";
|
|
3
3
|
export declare const NativeStudyEngineExpressions: {
|
|
4
4
|
checkEventType: (equalsType: 'ENTER' | 'SUBMIT' | 'TIMER') => Expression;
|
|
@@ -7,6 +7,8 @@ export declare const NativeStudyEngineExpressions: {
|
|
|
7
7
|
responseHasOnlyKeysOtherThan: (itemKey: string, responseSlotKey: string, ...optionKeys: string[]) => Expression;
|
|
8
8
|
getResponseValueAsNum: (itemKey: string, responseKey: string) => Expression;
|
|
9
9
|
getResponseValueAsStr: (itemKey: string, responseKey: string) => Expression;
|
|
10
|
+
hasResponseKey: (itemKey: string, responseKey: string) => Expression;
|
|
11
|
+
hasResponseKeyWithValue: (itemKey: string, responseKey: string, value: string) => Expression;
|
|
10
12
|
countResponseItems: (itemKey: string, responseKey: string) => Expression;
|
|
11
13
|
checkConditionForOldResponses: (condition: Expression, checkType?: number | "all" | "any" | undefined, surveyKey?: string | undefined, querySince?: number | Expression | undefined, queryUntil?: number | Expression | undefined) => Expression;
|
|
12
14
|
participantState: {
|
|
@@ -15,8 +17,11 @@ export declare const NativeStudyEngineExpressions: {
|
|
|
15
17
|
getSurveyKeyAssignedFrom: (surveyKey: string) => Expression;
|
|
16
18
|
getSurveyKeyAssignedUntil: (surveyKey: string) => Expression;
|
|
17
19
|
hasStudyStatus: (status: string) => Expression;
|
|
18
|
-
|
|
20
|
+
hasParticipantFlagKeyAndValue: (key: string, value: string) => Expression;
|
|
21
|
+
hasParticipantFlagKey: (key: string) => Expression;
|
|
19
22
|
lastSubmissionDateOlderThan: (reference: number | Expression, surveyKey?: string | undefined) => Expression;
|
|
23
|
+
hasMessageTypeAssigned: (messageType: string) => Expression;
|
|
24
|
+
getMessageNextTime: (messageType: string) => Expression;
|
|
20
25
|
};
|
|
21
26
|
eq: (val1: Expression | string | number, val2: Expression | string | number) => Expression;
|
|
22
27
|
lt: (val1: Expression | string | number, val2: Expression | string | number) => Expression;
|
|
@@ -34,10 +39,10 @@ export declare const StudyEngineActions: {
|
|
|
34
39
|
ifThen: (condition: Expression, ...args: Expression[]) => Expression;
|
|
35
40
|
participantActions: {
|
|
36
41
|
updateStudyStatus: (status: string) => Expression;
|
|
37
|
-
updateFlag: (key: string, newValue: string) => Expression;
|
|
42
|
+
updateFlag: (key: string, newValue: string | number | Expression) => Expression;
|
|
38
43
|
removeFlag: (key: string) => Expression;
|
|
39
44
|
assignedSurveys: {
|
|
40
|
-
add: (surveyKey: string, category: 'prio' | 'normal' | 'optional', activeFrom?: number | Expression | undefined, activeUntil?: number | Expression | undefined) => Expression;
|
|
45
|
+
add: (surveyKey: string, category: 'immediate' | 'prio' | 'normal' | 'optional', activeFrom?: number | Expression | undefined, activeUntil?: number | Expression | undefined) => Expression;
|
|
41
46
|
removeAll: () => Expression;
|
|
42
47
|
remove: (surveyKey: string, selector: 'first' | 'last' | 'all') => Expression;
|
|
43
48
|
};
|
|
@@ -46,6 +51,11 @@ export declare const StudyEngineActions: {
|
|
|
46
51
|
removeAll: () => Expression;
|
|
47
52
|
remove: (surveyKey: string, selector: 'first' | 'last' | 'all') => Expression;
|
|
48
53
|
};
|
|
54
|
+
messages: {
|
|
55
|
+
add: (messageType: string, scheduledFor: number | Expression) => Expression;
|
|
56
|
+
removeAll: () => Expression;
|
|
57
|
+
remove: (messageType: string) => Expression;
|
|
58
|
+
};
|
|
49
59
|
stopParticipation: () => Expression;
|
|
50
60
|
finishParticipation: () => Expression;
|
|
51
61
|
};
|
|
@@ -65,15 +75,25 @@ export declare const StudyEngine: {
|
|
|
65
75
|
validFromOlderThan: (surveyKey: string, delta: Duration, reference?: number | Expression | undefined) => Expression;
|
|
66
76
|
validUntilSoonerThan: (surveyKey: string, delta: Duration, reference?: number | Expression | undefined) => Expression;
|
|
67
77
|
};
|
|
78
|
+
prefillRules: {
|
|
79
|
+
GET_LAST_SURVEY_ITEM: (surveyKey: string, itemKey: string, submittedLaterThan?: Duration | undefined) => Expression;
|
|
80
|
+
};
|
|
81
|
+
contextRules: {
|
|
82
|
+
previousResponses: {
|
|
83
|
+
LAST_RESPONSES_BY_KEY: (surveyKey: string, limit: number) => Expression;
|
|
84
|
+
ALL_RESPONSES_SINCE: (sinceTimestamp: number) => Expression;
|
|
85
|
+
RESPONSES_SINCE_BY_KEY: (sinceTimestamp: number, surveyKey: string) => Expression;
|
|
86
|
+
};
|
|
87
|
+
};
|
|
68
88
|
if: (condition: Expression, actionIfTrue: Expression, actionIfFalse?: Expression | undefined) => Expression;
|
|
69
89
|
do: (...args: Expression[]) => Expression;
|
|
70
90
|
ifThen: (condition: Expression, ...args: Expression[]) => Expression;
|
|
71
91
|
participantActions: {
|
|
72
92
|
updateStudyStatus: (status: string) => Expression;
|
|
73
|
-
updateFlag: (key: string, newValue: string) => Expression;
|
|
93
|
+
updateFlag: (key: string, newValue: string | number | Expression) => Expression;
|
|
74
94
|
removeFlag: (key: string) => Expression;
|
|
75
95
|
assignedSurveys: {
|
|
76
|
-
add: (surveyKey: string, category: 'prio' | 'normal' | 'optional', activeFrom?: number | Expression | undefined, activeUntil?: number | Expression | undefined) => Expression;
|
|
96
|
+
add: (surveyKey: string, category: 'immediate' | 'prio' | 'normal' | 'optional', activeFrom?: number | Expression | undefined, activeUntil?: number | Expression | undefined) => Expression;
|
|
77
97
|
removeAll: () => Expression;
|
|
78
98
|
remove: (surveyKey: string, selector: 'first' | 'last' | 'all') => Expression;
|
|
79
99
|
};
|
|
@@ -82,6 +102,11 @@ export declare const StudyEngine: {
|
|
|
82
102
|
removeAll: () => Expression;
|
|
83
103
|
remove: (surveyKey: string, selector: 'first' | 'last' | 'all') => Expression;
|
|
84
104
|
};
|
|
105
|
+
messages: {
|
|
106
|
+
add: (messageType: string, scheduledFor: number | Expression) => Expression;
|
|
107
|
+
removeAll: () => Expression;
|
|
108
|
+
remove: (messageType: string) => Expression;
|
|
109
|
+
};
|
|
85
110
|
stopParticipation: () => Expression;
|
|
86
111
|
finishParticipation: () => Expression;
|
|
87
112
|
};
|
|
@@ -91,6 +116,8 @@ export declare const StudyEngine: {
|
|
|
91
116
|
responseHasOnlyKeysOtherThan: (itemKey: string, responseSlotKey: string, ...optionKeys: string[]) => Expression;
|
|
92
117
|
getResponseValueAsNum: (itemKey: string, responseKey: string) => Expression;
|
|
93
118
|
getResponseValueAsStr: (itemKey: string, responseKey: string) => Expression;
|
|
119
|
+
hasResponseKey: (itemKey: string, responseKey: string) => Expression;
|
|
120
|
+
hasResponseKeyWithValue: (itemKey: string, responseKey: string, value: string) => Expression;
|
|
94
121
|
countResponseItems: (itemKey: string, responseKey: string) => Expression;
|
|
95
122
|
checkConditionForOldResponses: (condition: Expression, checkType?: number | "all" | "any" | undefined, surveyKey?: string | undefined, querySince?: number | Expression | undefined, queryUntil?: number | Expression | undefined) => Expression;
|
|
96
123
|
participantState: {
|
|
@@ -99,8 +126,11 @@ export declare const StudyEngine: {
|
|
|
99
126
|
getSurveyKeyAssignedFrom: (surveyKey: string) => Expression;
|
|
100
127
|
getSurveyKeyAssignedUntil: (surveyKey: string) => Expression;
|
|
101
128
|
hasStudyStatus: (status: string) => Expression;
|
|
102
|
-
|
|
129
|
+
hasParticipantFlagKeyAndValue: (key: string, value: string) => Expression;
|
|
130
|
+
hasParticipantFlagKey: (key: string) => Expression;
|
|
103
131
|
lastSubmissionDateOlderThan: (reference: number | Expression, surveyKey?: string | undefined) => Expression;
|
|
132
|
+
hasMessageTypeAssigned: (messageType: string) => Expression;
|
|
133
|
+
getMessageNextTime: (messageType: string) => Expression;
|
|
104
134
|
};
|
|
105
135
|
eq: (val1: Expression | string | number, val2: Expression | string | number) => Expression;
|
|
106
136
|
lt: (val1: Expression | string | number, val2: Expression | string | number) => Expression;
|
|
@@ -37,6 +37,25 @@ const responseHasKeysAny = (itemKey, responseSlotKey, ...optionKeys) => expressi
|
|
|
37
37
|
* @returns true if a response key is present, but is not in the list defined by optionKeys. If item or the response group is not found, returns false.
|
|
38
38
|
*/
|
|
39
39
|
const responseHasOnlyKeysOtherThan = (itemKey, responseSlotKey, ...optionKeys) => expressionUtils_expressionGen.generateExpression('responseHasOnlyKeysOtherThan', undefined, itemKey, responseSlotKey, ...optionKeys);
|
|
40
|
+
/**
|
|
41
|
+
*
|
|
42
|
+
* @param itemKey full key to the survey item, in the form, e.g., <surveyKey>.<groupKey>.<itemKey>
|
|
43
|
+
* @param responseKey full key to the response that should exists
|
|
44
|
+
* @returns if item contains responseKey return true
|
|
45
|
+
*/
|
|
46
|
+
const hasResponseKey = (itemKey, responseKey) => {
|
|
47
|
+
return expressionUtils_expressionGen.generateExpression('hasResponseKey', undefined, itemKey, responseKey);
|
|
48
|
+
};
|
|
49
|
+
/**
|
|
50
|
+
*
|
|
51
|
+
* @param itemKey full key to the survey item, in the form, e.g., <surveyKey>.<groupKey>.<itemKey>
|
|
52
|
+
* @param responseKey full key to the response that should exists
|
|
53
|
+
* @param value the response object with the above key should have this value
|
|
54
|
+
* @returns if the response object exists and has the value return true
|
|
55
|
+
*/
|
|
56
|
+
const hasResponseKeyWithValue = (itemKey, responseKey, value) => {
|
|
57
|
+
return expressionUtils_expressionGen.generateExpression('hasResponseKeyWithValue', undefined, itemKey, responseKey, value);
|
|
58
|
+
};
|
|
40
59
|
const getResponseValueAsNum = (itemKey, responseKey) => {
|
|
41
60
|
return expressionUtils_expressionGen.generateExpression('getResponseValueAsNum', 'float', itemKey, responseKey);
|
|
42
61
|
};
|
|
@@ -86,12 +105,30 @@ const getSurveyKeyAssignedUntil = (surveyKey) => expressionUtils_expressionGen.g
|
|
|
86
105
|
*/
|
|
87
106
|
const hasStudyStatus = (status) => expressionUtils_expressionGen.generateExpression('getSurveyKeyAssignedUntil', undefined, status);
|
|
88
107
|
/**
|
|
89
|
-
* Check if a participant flag is present
|
|
108
|
+
* Check if a participant flag with specific value is present
|
|
90
109
|
* @param key look up this flag
|
|
91
110
|
* @param value and for this value
|
|
92
111
|
* @returns return true if key - value pair (with case sensitive matching for both key and value) is present. If any of the two is different, or participant flags is empty, it returns false.
|
|
93
112
|
*/
|
|
94
|
-
const
|
|
113
|
+
const hasParticipantFlagKeyAndValue = (key, value) => expressionUtils_expressionGen.generateExpression('hasParticipantFlag', undefined, key, value);
|
|
114
|
+
/**
|
|
115
|
+
* Check if a participant flag is present
|
|
116
|
+
* @param key look up this flag
|
|
117
|
+
* @returns return true if key is present. If any of the two is different, or participant flags is empty, it returns false.
|
|
118
|
+
*/
|
|
119
|
+
const hasParticipantFlagKey = (key) => expressionUtils_expressionGen.generateExpression('hasParticipantFlagKey', undefined, key);
|
|
120
|
+
/**
|
|
121
|
+
* Checks if the participant has a message type assigned (at least one)
|
|
122
|
+
* @param messageType
|
|
123
|
+
* @returns return true if a message with the given message type is assigned
|
|
124
|
+
*/
|
|
125
|
+
const hasMessageTypeAssigned = (messageType) => expressionUtils_expressionGen.generateExpression('hasMessageTypeAssigned', undefined, messageType);
|
|
126
|
+
/**
|
|
127
|
+
* Retrieve the timestamp (scheduledFor) for a particular message type. Return 0 if not assigned.
|
|
128
|
+
* @param messageType
|
|
129
|
+
* @returns timestamp value or zero
|
|
130
|
+
*/
|
|
131
|
+
const getMessageNextTime = (messageType) => expressionUtils_expressionGen.generateExpression('getMessageNextTime', undefined, messageType);
|
|
95
132
|
/**
|
|
96
133
|
* Check if the last submission is older than the reference timestamp
|
|
97
134
|
* @param reference look up this flag
|
|
@@ -141,13 +178,31 @@ const UPDATE_STUDY_STATUS = (status) => expressionUtils_expressionGen.generateEx
|
|
|
141
178
|
/**
|
|
142
179
|
* Add or update a participant flag
|
|
143
180
|
* @param key
|
|
144
|
-
* @param newValue
|
|
181
|
+
* @param newValue: string, number or expression where result should be written in the flag's value
|
|
145
182
|
* @returns
|
|
146
183
|
*/
|
|
147
184
|
const UPDATE_FLAG = (key, newValue) => expressionUtils_expressionGen.generateExpression('UPDATE_FLAG', undefined, key, newValue);
|
|
148
185
|
const REMOVE_FLAG = (key) => expressionUtils_expressionGen.generateExpression('REMOVE_FLAG', undefined, key);
|
|
149
186
|
const ADD_NEW_SURVEY = (surveyKey, category, activeFrom, activeUntil) => expressionUtils_expressionGen.generateExpression('ADD_NEW_SURVEY', undefined, surveyKey, activeFrom !== undefined ? activeFrom : 0, activeUntil !== undefined ? activeUntil : 0, category);
|
|
150
187
|
const REMOVE_ALL_SURVEYS = () => expressionUtils_expressionGen.generateExpression('REMOVE_ALL_SURVEYS');
|
|
188
|
+
/**
|
|
189
|
+
* Add participant message
|
|
190
|
+
* @param messageType message type
|
|
191
|
+
* @param scheduledFor timestamp or expression returning a timestamp
|
|
192
|
+
* @returns
|
|
193
|
+
*/
|
|
194
|
+
const ADD_MESSAGE = (messageType, scheduledFor) => expressionUtils_expressionGen.generateExpression('ADD_MESSAGE', undefined, messageType, scheduledFor);
|
|
195
|
+
/**
|
|
196
|
+
* Remove all messages scheduled for the participant
|
|
197
|
+
* @returns
|
|
198
|
+
*/
|
|
199
|
+
const REMOVE_ALL_MESSAGES = () => expressionUtils_expressionGen.generateExpression('REMOVE_ALL_MESSAGES', undefined);
|
|
200
|
+
/**
|
|
201
|
+
* Remove all messages with this message type
|
|
202
|
+
* @param messageType message type
|
|
203
|
+
* @returns
|
|
204
|
+
*/
|
|
205
|
+
const REMOVE_MESSAGES_BY_TYPE = (messageType) => expressionUtils_expressionGen.generateExpression('REMOVE_MESSAGES_BY_TYPE', undefined, messageType);
|
|
151
206
|
/**
|
|
152
207
|
* When submitting the response, item response with the given key would be added to the report array
|
|
153
208
|
* @param itemKey find and add this item to the report array
|
|
@@ -172,6 +227,22 @@ const REMOVE_REPORT_BY_KEY = (surveyKey, selector) => {
|
|
|
172
227
|
}
|
|
173
228
|
};
|
|
174
229
|
// ##################
|
|
230
|
+
// Prefill rule methods:
|
|
231
|
+
const GET_LAST_SURVEY_ITEM = (surveyKey, itemKey, submittedLaterThan) => {
|
|
232
|
+
return expressionUtils_expressionGen.generateExpression('GET_LAST_SURVEY_ITEM', undefined, surveyKey, itemKey, submittedLaterThan ? types_duration.durationObjectToSeconds(submittedLaterThan) : undefined);
|
|
233
|
+
};
|
|
234
|
+
// ##################
|
|
235
|
+
// Context previous responses methods:
|
|
236
|
+
const LAST_RESPONSES_BY_KEY = (surveyKey, limit) => {
|
|
237
|
+
return expressionUtils_expressionGen.generateExpression('LAST_RESPONSES_BY_KEY', undefined, surveyKey, limit);
|
|
238
|
+
};
|
|
239
|
+
const ALL_RESPONSES_SINCE = (sinceTimestamp) => {
|
|
240
|
+
return expressionUtils_expressionGen.generateExpression('ALL_RESPONSES_SINCE', undefined, sinceTimestamp);
|
|
241
|
+
};
|
|
242
|
+
const RESPONSES_SINCE_BY_KEY = (sinceTimestamp, surveyKey) => {
|
|
243
|
+
return expressionUtils_expressionGen.generateExpression('RESPONSES_SINCE_BY_KEY', undefined, sinceTimestamp, surveyKey);
|
|
244
|
+
};
|
|
245
|
+
// ##################
|
|
175
246
|
// Extra methods:
|
|
176
247
|
const singleChoiceOptionsSelected = (itemKey, ...optionKeys) => expressionUtils_expressionGen.generateExpression('responseHasKeysAny', undefined, itemKey, [constants_keyDefinitions.responseGroupKey, constants_keyDefinitions.singleChoiceKey].join('.'), ...optionKeys);
|
|
177
248
|
const multipleChoiceOptionsSelected = (itemKey, ...optionKeys) => expressionUtils_expressionGen.generateExpression('responseHasKeysAny', undefined, itemKey, [constants_keyDefinitions.responseGroupKey, constants_keyDefinitions.multipleChoiceKey].join('.'), ...optionKeys);
|
|
@@ -216,6 +287,8 @@ const NativeStudyEngineExpressions = {
|
|
|
216
287
|
responseHasOnlyKeysOtherThan,
|
|
217
288
|
getResponseValueAsNum,
|
|
218
289
|
getResponseValueAsStr,
|
|
290
|
+
hasResponseKey,
|
|
291
|
+
hasResponseKeyWithValue,
|
|
219
292
|
countResponseItems,
|
|
220
293
|
// Old responses
|
|
221
294
|
checkConditionForOldResponses,
|
|
@@ -226,8 +299,11 @@ const NativeStudyEngineExpressions = {
|
|
|
226
299
|
getSurveyKeyAssignedFrom,
|
|
227
300
|
getSurveyKeyAssignedUntil,
|
|
228
301
|
hasStudyStatus,
|
|
229
|
-
|
|
302
|
+
hasParticipantFlagKeyAndValue,
|
|
303
|
+
hasParticipantFlagKey,
|
|
230
304
|
lastSubmissionDateOlderThan,
|
|
305
|
+
hasMessageTypeAssigned,
|
|
306
|
+
getMessageNextTime,
|
|
231
307
|
},
|
|
232
308
|
// logical and comparision
|
|
233
309
|
eq,
|
|
@@ -259,6 +335,11 @@ const StudyEngineActions = {
|
|
|
259
335
|
removeAll: REMOVE_ALL_REPORTS,
|
|
260
336
|
remove: REMOVE_REPORT_BY_KEY,
|
|
261
337
|
},
|
|
338
|
+
messages: {
|
|
339
|
+
add: ADD_MESSAGE,
|
|
340
|
+
removeAll: REMOVE_ALL_MESSAGES,
|
|
341
|
+
remove: REMOVE_MESSAGES_BY_TYPE,
|
|
342
|
+
},
|
|
262
343
|
// Extra methods:
|
|
263
344
|
stopParticipation,
|
|
264
345
|
finishParticipation,
|
|
@@ -275,6 +356,14 @@ const StudyEngine = Object.assign(Object.assign(Object.assign({}, NativeStudyEng
|
|
|
275
356
|
isActive: hasSurveyKeyActive,
|
|
276
357
|
validFromOlderThan: hasSurveyKeyValidFromOlderThan,
|
|
277
358
|
validUntilSoonerThan: hasSurveyKeyValidUntilSoonerThan,
|
|
359
|
+
}, prefillRules: {
|
|
360
|
+
GET_LAST_SURVEY_ITEM,
|
|
361
|
+
}, contextRules: {
|
|
362
|
+
previousResponses: {
|
|
363
|
+
LAST_RESPONSES_BY_KEY,
|
|
364
|
+
ALL_RESPONSES_SINCE,
|
|
365
|
+
RESPONSES_SINCE_BY_KEY,
|
|
366
|
+
}
|
|
278
367
|
} });
|
|
279
368
|
|
|
280
369
|
exports.NativeStudyEngineExpressions = NativeStudyEngineExpressions;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"studyEngineExpressions.js","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"studyEngineExpressions.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
@@ -1,63 +1,81 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
4
|
-
var
|
|
3
|
+
var surveys_surveyEditor_componentEditor = require('./surveys/survey-editor/component-editor.js');
|
|
4
|
+
var surveys_utils_randomKeyGenerator = require('./surveys/utils/randomKeyGenerator.js');
|
|
5
|
+
var logger_logger = require('./logger/logger.js');
|
|
5
6
|
|
|
6
7
|
var data_types = {};
|
|
7
8
|
|
|
8
9
|
var expression = {};
|
|
9
10
|
|
|
10
|
-
Object.defineProperty(expression,
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
11
|
+
Object.defineProperty(expression, '__esModule', { value: true });
|
|
12
|
+
|
|
13
|
+
const isExpression = (value) => {
|
|
14
|
+
return typeof (value) === 'object' && value.name !== undefined && value.name.length > 0;
|
|
15
|
+
};
|
|
16
|
+
const expressionArgParser = (arg) => {
|
|
17
|
+
switch (arg.dtype) {
|
|
18
|
+
case 'num':
|
|
19
|
+
return arg.num;
|
|
20
|
+
case 'str':
|
|
21
|
+
return arg.str;
|
|
22
|
+
case 'exp':
|
|
23
|
+
return arg.exp;
|
|
24
|
+
default:
|
|
25
|
+
return arg.str;
|
|
26
|
+
}
|
|
25
27
|
};
|
|
26
28
|
|
|
29
|
+
expression.expressionArgParser = expressionArgParser;
|
|
30
|
+
expression.isExpression = isExpression;
|
|
31
|
+
|
|
27
32
|
var surveyItem = {};
|
|
28
33
|
|
|
29
|
-
Object.defineProperty(surveyItem,
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
34
|
+
Object.defineProperty(surveyItem, '__esModule', { value: true });
|
|
35
|
+
|
|
36
|
+
const isSurveyGroupItem$1 = (item) => {
|
|
37
|
+
const items = item.items;
|
|
38
|
+
return items !== undefined && items.length > 0;
|
|
33
39
|
};
|
|
34
40
|
|
|
41
|
+
surveyItem.isSurveyGroupItem = isSurveyGroupItem$1;
|
|
42
|
+
|
|
35
43
|
var surveyItemComponent = {};
|
|
36
44
|
|
|
37
|
-
Object.defineProperty(surveyItemComponent,
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
45
|
+
Object.defineProperty(surveyItemComponent, '__esModule', { value: true });
|
|
46
|
+
|
|
47
|
+
const isItemGroupComponent$1 = (item) => {
|
|
48
|
+
const items = item.items;
|
|
49
|
+
return items !== undefined && items.length > 0;
|
|
41
50
|
};
|
|
42
51
|
|
|
52
|
+
surveyItemComponent.isItemGroupComponent = isItemGroupComponent$1;
|
|
53
|
+
|
|
43
54
|
var response = {};
|
|
44
55
|
|
|
45
|
-
Object.defineProperty(response,
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
56
|
+
Object.defineProperty(response, '__esModule', { value: true });
|
|
57
|
+
|
|
58
|
+
const isSurveyGroupItemResponse = (item) => {
|
|
59
|
+
const items = item.items;
|
|
60
|
+
return items !== undefined && items.length > 0;
|
|
49
61
|
};
|
|
50
62
|
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
63
|
+
response.isSurveyGroupItemResponse = isSurveyGroupItemResponse;
|
|
64
|
+
|
|
65
|
+
Object.defineProperty(data_types, '__esModule', { value: true });
|
|
66
|
+
|
|
67
|
+
var data_types_expression = expression;
|
|
68
|
+
var data_types_surveyItem = surveyItem;
|
|
69
|
+
var data_types_surveyItemComponent = surveyItemComponent;
|
|
70
|
+
var data_types_response = response;
|
|
71
|
+
|
|
72
|
+
|
|
73
|
+
|
|
74
|
+
data_types.expressionArgParser = data_types_expression.expressionArgParser;
|
|
75
|
+
data_types.isExpression = data_types_expression.isExpression;
|
|
76
|
+
var isSurveyGroupItem = data_types.isSurveyGroupItem = data_types_surveyItem.isSurveyGroupItem;
|
|
77
|
+
var isItemGroupComponent = data_types.isItemGroupComponent = data_types_surveyItemComponent.isItemGroupComponent;
|
|
78
|
+
data_types.isSurveyGroupItemResponse = data_types_response.isSurveyGroupItemResponse;
|
|
61
79
|
|
|
62
80
|
const initialRootComp = () => {
|
|
63
81
|
return {
|
|
@@ -260,7 +278,7 @@ class ItemEditor {
|
|
|
260
278
|
props.key = 'rg';
|
|
261
279
|
}
|
|
262
280
|
props.isGroup = true;
|
|
263
|
-
const newComponent = (new
|
|
281
|
+
const newComponent = (new surveys_surveyEditor_componentEditor.ComponentEditor(undefined, props)).getComponent();
|
|
264
282
|
const ind = currentItem.components.items.findIndex(comp => comp.role === 'responseGroup');
|
|
265
283
|
if (ind < 0) {
|
|
266
284
|
currentItem.components.items.push(newComponent);
|
|
@@ -281,7 +299,7 @@ class ItemEditor {
|
|
|
281
299
|
obj = currentItem.components.items[ind];
|
|
282
300
|
continue;
|
|
283
301
|
}
|
|
284
|
-
if (!
|
|
302
|
+
if (!isItemGroupComponent(obj)) {
|
|
285
303
|
obj.items = [];
|
|
286
304
|
// leaf found
|
|
287
305
|
break;
|
|
@@ -298,10 +316,10 @@ class ItemEditor {
|
|
|
298
316
|
return;
|
|
299
317
|
}
|
|
300
318
|
if (obj.items.find(it => props.key === it.key)) {
|
|
301
|
-
|
|
319
|
+
logger_logger.Logger.criticalError('Duplicate key: ' + props.key);
|
|
302
320
|
return undefined;
|
|
303
321
|
}
|
|
304
|
-
const newComponent = (new
|
|
322
|
+
const newComponent = (new surveys_surveyEditor_componentEditor.ComponentEditor(undefined, props)).getComponent();
|
|
305
323
|
if (atPosition !== undefined) {
|
|
306
324
|
obj.items.splice(atPosition, 0, newComponent);
|
|
307
325
|
}
|
|
@@ -317,7 +335,7 @@ class ItemEditor {
|
|
|
317
335
|
currentItem.components = Object.assign({}, initialRootComp());
|
|
318
336
|
}
|
|
319
337
|
if (newComp.key === undefined) {
|
|
320
|
-
newComp.key =
|
|
338
|
+
newComp.key = surveys_utils_randomKeyGenerator.generateRandomKey(4);
|
|
321
339
|
}
|
|
322
340
|
if (!parentKey) {
|
|
323
341
|
const ind = currentItem.components.items.findIndex(comp => comp.role === 'responseGroup');
|
|
@@ -340,7 +358,7 @@ class ItemEditor {
|
|
|
340
358
|
obj = currentItem.components.items[ind];
|
|
341
359
|
continue;
|
|
342
360
|
}
|
|
343
|
-
if (!
|
|
361
|
+
if (!isItemGroupComponent(obj)) {
|
|
344
362
|
obj.items = [];
|
|
345
363
|
// leaf found
|
|
346
364
|
break;
|
|
@@ -357,7 +375,7 @@ class ItemEditor {
|
|
|
357
375
|
return;
|
|
358
376
|
}
|
|
359
377
|
if (obj.items.find(it => newComp.key === it.key)) {
|
|
360
|
-
|
|
378
|
+
logger_logger.Logger.criticalError('Duplicate key: ' + newComp.key);
|
|
361
379
|
return undefined;
|
|
362
380
|
}
|
|
363
381
|
if (atPosition !== undefined) {
|
|
@@ -392,7 +410,7 @@ class ItemEditor {
|
|
|
392
410
|
const parentIds = ids.slice(1, ids.length - 1);
|
|
393
411
|
let obj = responseGroup;
|
|
394
412
|
for (const currentKey of parentIds) {
|
|
395
|
-
if (!
|
|
413
|
+
if (!isItemGroupComponent(obj)) {
|
|
396
414
|
// leaf found
|
|
397
415
|
break;
|
|
398
416
|
}
|
|
@@ -433,7 +451,7 @@ class ItemEditor {
|
|
|
433
451
|
const parentIds = ids.slice(1, ids.length - 1);
|
|
434
452
|
let obj = responseGroup;
|
|
435
453
|
for (const currentKey of parentIds) {
|
|
436
|
-
if (!
|
|
454
|
+
if (!isItemGroupComponent(obj)) {
|
|
437
455
|
// leaf found
|
|
438
456
|
break;
|
|
439
457
|
}
|
|
@@ -468,7 +486,7 @@ class ItemEditor {
|
|
|
468
486
|
obj = currentItem.components.items[ind];
|
|
469
487
|
continue;
|
|
470
488
|
}
|
|
471
|
-
if (!
|
|
489
|
+
if (!isItemGroupComponent(obj)) {
|
|
472
490
|
obj.items = [];
|
|
473
491
|
// leaf found
|
|
474
492
|
break;
|
|
@@ -517,5 +535,5 @@ class ItemEditor {
|
|
|
517
535
|
}
|
|
518
536
|
|
|
519
537
|
exports.ItemEditor = ItemEditor;
|
|
520
|
-
exports.
|
|
521
|
-
//# sourceMappingURL=item-editor-
|
|
538
|
+
exports.isSurveyGroupItem = isSurveyGroupItem;
|
|
539
|
+
//# sourceMappingURL=item-editor-c6933791.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"item-editor-c6933791.js","sources":["../node_modules/survey-engine/data_types/expression.js","../node_modules/survey-engine/data_types/survey-item.js","../node_modules/survey-engine/data_types/survey-item-component.js","../node_modules/survey-engine/data_types/response.js","../node_modules/survey-engine/data_types/index.js"],"sourcesContent":["'use strict';\n\nObject.defineProperty(exports, '__esModule', { value: true });\n\nconst isExpression = (value) => {\r\n return typeof (value) === 'object' && value.name !== undefined && value.name.length > 0;\r\n};\r\nconst expressionArgParser = (arg) => {\r\n switch (arg.dtype) {\r\n case 'num':\r\n return arg.num;\r\n case 'str':\r\n return arg.str;\r\n case 'exp':\r\n return arg.exp;\r\n default:\r\n return arg.str;\r\n }\r\n};\n\nexports.expressionArgParser = expressionArgParser;\nexports.isExpression = isExpression;\n//# sourceMappingURL=expression.js.map\n","'use strict';\n\nObject.defineProperty(exports, '__esModule', { value: true });\n\nconst isSurveyGroupItem = (item) => {\r\n const items = item.items;\r\n return items !== undefined && items.length > 0;\r\n};\n\nexports.isSurveyGroupItem = isSurveyGroupItem;\n//# sourceMappingURL=survey-item.js.map\n","'use strict';\n\nObject.defineProperty(exports, '__esModule', { value: true });\n\nconst isItemGroupComponent = (item) => {\r\n const items = item.items;\r\n return items !== undefined && items.length > 0;\r\n};\n\nexports.isItemGroupComponent = isItemGroupComponent;\n//# sourceMappingURL=survey-item-component.js.map\n","'use strict';\n\nObject.defineProperty(exports, '__esModule', { value: true });\n\nconst isSurveyGroupItemResponse = (item) => {\r\n const items = item.items;\r\n return items !== undefined && items.length > 0;\r\n};\n\nexports.isSurveyGroupItemResponse = isSurveyGroupItemResponse;\n//# sourceMappingURL=response.js.map\n","'use strict';\n\nObject.defineProperty(exports, '__esModule', { value: true });\n\nvar data_types_expression = require('./expression.js');\nvar data_types_surveyItem = require('./survey-item.js');\nvar data_types_surveyItemComponent = require('./survey-item-component.js');\nvar data_types_response = require('./response.js');\n\n\n\nexports.expressionArgParser = data_types_expression.expressionArgParser;\nexports.isExpression = data_types_expression.isExpression;\nexports.isSurveyGroupItem = data_types_surveyItem.isSurveyGroupItem;\nexports.isItemGroupComponent = data_types_surveyItemComponent.isItemGroupComponent;\nexports.isSurveyGroupItemResponse = data_types_response.isSurveyGroupItemResponse;\n//# sourceMappingURL=index.js.map\n"],"names":["isSurveyGroupItem","isItemGroupComponent","require$$0","require$$1","require$$2","require$$3"],"mappings":"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"}
|