case-editor-tools 1.0.0-beta.30 → 1.0.0-beta.34

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.
Files changed (36) hide show
  1. package/expression-utils/studyEngineExpressions.d.ts +40 -8
  2. package/expression-utils/studyEngineExpressions.js +75 -18
  3. package/expression-utils/studyEngineExpressions.js.map +1 -1
  4. package/package.json +1 -1
  5. package/surveys/index.js +1 -0
  6. package/surveys/index.js.map +1 -1
  7. package/surveys/responseTypeGenerators/likertGroupComponents.js +3 -0
  8. package/surveys/responseTypeGenerators/likertGroupComponents.js.map +1 -1
  9. package/surveys/responseTypeGenerators/matrixGroupComponent.js +1 -0
  10. package/surveys/responseTypeGenerators/matrixGroupComponent.js.map +1 -1
  11. package/surveys/responseTypeGenerators/optionGroupComponents.js +1 -0
  12. package/surveys/responseTypeGenerators/optionGroupComponents.js.map +1 -1
  13. package/surveys/survey-engine-expressions.js +5 -1
  14. package/surveys/survey-engine-expressions.js.map +1 -1
  15. package/surveys/survey-items.js +1 -0
  16. package/surveys/survey-items.js.map +1 -1
  17. package/surveys/types/group.js +1 -0
  18. package/surveys/types/group.js.map +1 -1
  19. package/surveys/types/index.js +2 -0
  20. package/surveys/types/index.js.map +1 -1
  21. package/surveys/types/item-properties.d.ts +10 -1
  22. package/surveys/types/item-properties.js +7 -0
  23. package/surveys/types/item-properties.js.map +1 -1
  24. package/surveys/types/survey-definition.js +1 -0
  25. package/surveys/types/survey-definition.js.map +1 -1
  26. package/surveys/utils/componentGenerators.js +1 -0
  27. package/surveys/utils/componentGenerators.js.map +1 -1
  28. package/surveys/utils/simple-generators.d.ts +3 -2
  29. package/surveys/utils/simple-generators.js +29 -0
  30. package/surveys/utils/simple-generators.js.map +1 -1
  31. package/surveys/utils/simple-question-editor.d.ts +2 -2
  32. package/surveys/utils/simple-question-editor.js +1 -0
  33. package/surveys/utils/simple-question-editor.js.map +1 -1
  34. package/types/studyRules.d.ts +2 -1
  35. package/types/studyRules.js +5 -1
  36. package/types/studyRules.js.map +1 -1
@@ -1,7 +1,7 @@
1
1
  import { Expression } from "survey-engine/data_types";
2
2
  import { Duration } from "../types/duration";
3
3
  export declare const NativeStudyEngineExpressions: {
4
- checkEventType: (equalsType: 'ENTER' | 'SUBMIT' | 'TIMER') => Expression;
4
+ checkEventType: (equalsType: 'ENTER' | 'SUBMIT' | 'TIMER' | 'MERGE') => Expression;
5
5
  checkSurveyResponseKey: (surveyKey: string) => Expression;
6
6
  responseHasKeysAny: (itemKey: string, responseSlotKey: string, ...optionKeys: string[]) => Expression;
7
7
  responseHasOnlyKeysOtherThan: (itemKey: string, responseSlotKey: string, ...optionKeys: string[]) => Expression;
@@ -22,6 +22,18 @@ export declare const NativeStudyEngineExpressions: {
22
22
  lastSubmissionDateOlderThan: (reference: number | Expression, surveyKey?: string | undefined) => Expression;
23
23
  hasMessageTypeAssigned: (messageType: string) => Expression;
24
24
  getMessageNextTime: (messageType: string) => Expression;
25
+ incomingParticipantState: {
26
+ getStudyEntryTime: () => Expression;
27
+ hasSurveyKeyAssigned: (surveyKey: string) => Expression;
28
+ getSurveyKeyAssignedFrom: (surveyKey: string) => Expression;
29
+ getSurveyKeyAssignedUntil: (surveyKey: string) => Expression;
30
+ hasStudyStatus: (status: string) => Expression;
31
+ hasParticipantFlagKeyAndValue: (key: string, value: string) => Expression;
32
+ hasParticipantFlagKey: (key: string) => Expression;
33
+ lastSubmissionDateOlderThan: (reference: number | Expression, surveyKey?: string | undefined) => Expression;
34
+ hasMessageTypeAssigned: (messageType: string) => Expression;
35
+ getMessageNextTime: (messageType: string) => Expression;
36
+ };
25
37
  };
26
38
  eq: (val1: Expression | string | number, val2: Expression | string | number) => Expression;
27
39
  lt: (val1: Expression | string | number, val2: Expression | string | number) => Expression;
@@ -47,9 +59,13 @@ export declare const StudyEngineActions: {
47
59
  remove: (surveyKey: string, selector: 'first' | 'last' | 'all') => Expression;
48
60
  };
49
61
  reports: {
50
- add: (itemKey: string) => Expression;
51
- removeAll: () => Expression;
52
- remove: (surveyKey: string, selector: 'first' | 'last' | 'all') => Expression;
62
+ init: (reportKey: string) => Expression;
63
+ cancel: (reportKey: string) => Expression;
64
+ updateData: (reportKey: string, attributeKey: string, value: number | string | Expression, dtype?: "string" | "date" | "float" | "int" | "rawMessage" | undefined) => Expression;
65
+ removeData: (reportKey: string, attributeKey: string) => Expression;
66
+ setReportIcon: (reportKey: string, icon: string) => Expression;
67
+ setReportMessage: (reportKey: string, content: string, asTranslationKey?: boolean | undefined) => Expression;
68
+ setReportSummary: (reportKey: string, content: string, asTranslationKey?: boolean | undefined) => Expression;
53
69
  };
54
70
  messages: {
55
71
  add: (messageType: string, scheduledFor: number | Expression) => Expression;
@@ -98,9 +114,13 @@ export declare const StudyEngine: {
98
114
  remove: (surveyKey: string, selector: 'first' | 'last' | 'all') => Expression;
99
115
  };
100
116
  reports: {
101
- add: (itemKey: string) => Expression;
102
- removeAll: () => Expression;
103
- remove: (surveyKey: string, selector: 'first' | 'last' | 'all') => Expression;
117
+ init: (reportKey: string) => Expression;
118
+ cancel: (reportKey: string) => Expression;
119
+ updateData: (reportKey: string, attributeKey: string, value: number | string | Expression, dtype?: "string" | "date" | "float" | "int" | "rawMessage" | undefined) => Expression;
120
+ removeData: (reportKey: string, attributeKey: string) => Expression;
121
+ setReportIcon: (reportKey: string, icon: string) => Expression;
122
+ setReportMessage: (reportKey: string, content: string, asTranslationKey?: boolean | undefined) => Expression;
123
+ setReportSummary: (reportKey: string, content: string, asTranslationKey?: boolean | undefined) => Expression;
104
124
  };
105
125
  messages: {
106
126
  add: (messageType: string, scheduledFor: number | Expression) => Expression;
@@ -110,7 +130,7 @@ export declare const StudyEngine: {
110
130
  stopParticipation: () => Expression;
111
131
  finishParticipation: () => Expression;
112
132
  };
113
- checkEventType: (equalsType: 'ENTER' | 'SUBMIT' | 'TIMER') => Expression;
133
+ checkEventType: (equalsType: 'ENTER' | 'SUBMIT' | 'TIMER' | 'MERGE') => Expression;
114
134
  checkSurveyResponseKey: (surveyKey: string) => Expression;
115
135
  responseHasKeysAny: (itemKey: string, responseSlotKey: string, ...optionKeys: string[]) => Expression;
116
136
  responseHasOnlyKeysOtherThan: (itemKey: string, responseSlotKey: string, ...optionKeys: string[]) => Expression;
@@ -131,6 +151,18 @@ export declare const StudyEngine: {
131
151
  lastSubmissionDateOlderThan: (reference: number | Expression, surveyKey?: string | undefined) => Expression;
132
152
  hasMessageTypeAssigned: (messageType: string) => Expression;
133
153
  getMessageNextTime: (messageType: string) => Expression;
154
+ incomingParticipantState: {
155
+ getStudyEntryTime: () => Expression;
156
+ hasSurveyKeyAssigned: (surveyKey: string) => Expression;
157
+ getSurveyKeyAssignedFrom: (surveyKey: string) => Expression;
158
+ getSurveyKeyAssignedUntil: (surveyKey: string) => Expression;
159
+ hasStudyStatus: (status: string) => Expression;
160
+ hasParticipantFlagKeyAndValue: (key: string, value: string) => Expression;
161
+ hasParticipantFlagKey: (key: string) => Expression;
162
+ lastSubmissionDateOlderThan: (reference: number | Expression, surveyKey?: string | undefined) => Expression;
163
+ hasMessageTypeAssigned: (messageType: string) => Expression;
164
+ getMessageNextTime: (messageType: string) => Expression;
165
+ };
134
166
  };
135
167
  eq: (val1: Expression | string | number, val2: Expression | string | number) => Expression;
136
168
  lt: (val1: Expression | string | number, val2: Expression | string | number) => Expression;
@@ -11,7 +11,7 @@ const and = (...args) => expressionUtils_expressionGen.generateExpression('and',
11
11
  const not = (arg) => expressionUtils_expressionGen.generateExpression('not', undefined, arg);
12
12
  /**
13
13
  * Check if the current event has the given type
14
- * @param equalsType string with the possible values: 'ENTER', 'SUBMIT', 'TIMER
14
+ * @param equalsType string with the possible values: 'ENTER', 'SUBMIT', 'TIMER', 'MERGE'
15
15
  * @returns if event type matches the argument, return true otherwise false
16
16
  */
17
17
  const checkEventType = (equalsType) => expressionUtils_expressionGen.generateExpression('checkEventType', undefined, equalsType);
@@ -80,30 +80,35 @@ const checkConditionForOldResponses = (condition, checkType, surveyKey, querySin
80
80
  * @returns timestamp
81
81
  */
82
82
  const getStudyEntryTime = () => expressionUtils_expressionGen.generateExpression('getStudyEntryTime');
83
+ const getStudyEntryTimeForIncoming = () => expressionUtils_expressionGen.generateExpression('incomingState:getStudyEntryTime');
83
84
  /**
84
85
  * Determines if a specific survey key is currently assigned to the participant.
85
86
  * @param surveyKey - string - key of the survey to check for.
86
87
  * @returns true if the participant has a survey with this surveyKey assigned, otherwise false.
87
88
  */
88
89
  const hasSurveyKeyAssigned = (surveyKey) => expressionUtils_expressionGen.generateExpression('hasSurveyKeyAssigned', undefined, surveyKey);
90
+ const hasSurveyKeyAssignedForIncoming = (surveyKey) => expressionUtils_expressionGen.generateExpression('incomingState:hasSurveyKeyAssigned', undefined, surveyKey);
89
91
  /**
90
92
  * Method to access the timestamp for a surveyKey is assigned from
91
93
  * @param surveyKey - string - key of the survey to check for.
92
94
  * @returns timestamp
93
95
  */
94
96
  const getSurveyKeyAssignedFrom = (surveyKey) => expressionUtils_expressionGen.generateExpression('getSurveyKeyAssignedFrom', undefined, surveyKey);
97
+ const getSurveyKeyAssignedFromForIncoming = (surveyKey) => expressionUtils_expressionGen.generateExpression('incomingState:getSurveyKeyAssignedFrom', undefined, surveyKey);
95
98
  /**
96
99
  * Method to access the timestamp for a surveyKey is assigned until
97
100
  * @param surveyKey - string - key of the survey to check for.
98
101
  * @returns timestamp
99
102
  */
100
103
  const getSurveyKeyAssignedUntil = (surveyKey) => expressionUtils_expressionGen.generateExpression('getSurveyKeyAssignedUntil', undefined, surveyKey);
104
+ const getSurveyKeyAssignedUntilForIncoming = (surveyKey) => expressionUtils_expressionGen.generateExpression('incomingState:getSurveyKeyAssignedUntil', undefined, surveyKey);
101
105
  /**
102
106
  * Check if a participant has a specific study status
103
107
  * @param status - string
104
108
  * @returns true/false
105
109
  */
106
110
  const hasStudyStatus = (status) => expressionUtils_expressionGen.generateExpression('getSurveyKeyAssignedUntil', undefined, status);
111
+ const hasStudyStatusForIncoming = (status) => expressionUtils_expressionGen.generateExpression('incomingState:getSurveyKeyAssignedUntil', undefined, status);
107
112
  /**
108
113
  * Check if a participant flag with specific value is present
109
114
  * @param key look up this flag
@@ -111,24 +116,28 @@ const hasStudyStatus = (status) => expressionUtils_expressionGen.generateExpress
111
116
  * @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.
112
117
  */
113
118
  const hasParticipantFlagKeyAndValue = (key, value) => expressionUtils_expressionGen.generateExpression('hasParticipantFlag', undefined, key, value);
119
+ const hasParticipantFlagKeyAndValueForIncoming = (key, value) => expressionUtils_expressionGen.generateExpression('incomingState:hasParticipantFlag', undefined, key, value);
114
120
  /**
115
121
  * Check if a participant flag is present
116
122
  * @param key look up this flag
117
123
  * @returns return true if key is present. If any of the two is different, or participant flags is empty, it returns false.
118
124
  */
119
125
  const hasParticipantFlagKey = (key) => expressionUtils_expressionGen.generateExpression('hasParticipantFlagKey', undefined, key);
126
+ const hasParticipantFlagKeyForIncoming = (key) => expressionUtils_expressionGen.generateExpression('incomingState:hasParticipantFlagKey', undefined, key);
120
127
  /**
121
128
  * Checks if the participant has a message type assigned (at least one)
122
129
  * @param messageType
123
130
  * @returns return true if a message with the given message type is assigned
124
131
  */
125
132
  const hasMessageTypeAssigned = (messageType) => expressionUtils_expressionGen.generateExpression('hasMessageTypeAssigned', undefined, messageType);
133
+ const hasMessageTypeAssignedForIncoming = (messageType) => expressionUtils_expressionGen.generateExpression('incomingState:hasMessageTypeAssigned', undefined, messageType);
126
134
  /**
127
135
  * Retrieve the timestamp (scheduledFor) for a particular message type. Return 0 if not assigned.
128
136
  * @param messageType
129
137
  * @returns timestamp value or zero
130
138
  */
131
139
  const getMessageNextTime = (messageType) => expressionUtils_expressionGen.generateExpression('getMessageNextTime', undefined, messageType);
140
+ const getMessageNextTimeForIncoming = (messageType) => expressionUtils_expressionGen.generateExpression('incomingState:getMessageNextTime', undefined, messageType);
132
141
  /**
133
142
  * Check if the last submission is older than the reference timestamp
134
143
  * @param reference look up this flag
@@ -136,6 +145,7 @@ const getMessageNextTime = (messageType) => expressionUtils_expressionGen.genera
136
145
  * @returns boolean
137
146
  */
138
147
  const lastSubmissionDateOlderThan = (reference, surveyKey) => expressionUtils_expressionGen.generateExpression('lastSubmissionDateOlderThan', undefined, reference, surveyKey);
148
+ const lastSubmissionDateOlderThanForIncoming = (reference, surveyKey) => expressionUtils_expressionGen.generateExpression('incomingState:lastSubmissionDateOlderThan', undefined, reference, surveyKey);
139
149
  const eq = (val1, val2) => expressionUtils_expressionGen.generateExpression('eq', undefined, val1, val2);
140
150
  const lt = (val1, val2) => expressionUtils_expressionGen.generateExpression('lt', undefined, val1, val2);
141
151
  const lte = (val1, val2) => expressionUtils_expressionGen.generateExpression('lte', undefined, val1, val2);
@@ -203,12 +213,6 @@ const REMOVE_ALL_MESSAGES = () => expressionUtils_expressionGen.generateExpressi
203
213
  * @returns
204
214
  */
205
215
  const REMOVE_MESSAGES_BY_TYPE = (messageType) => expressionUtils_expressionGen.generateExpression('REMOVE_MESSAGES_BY_TYPE', undefined, messageType);
206
- /**
207
- * When submitting the response, item response with the given key would be added to the report array
208
- * @param itemKey find and add this item to the report array
209
- * @returns
210
- */
211
- const ADD_REPORT = (itemKey) => expressionUtils_expressionGen.generateExpression('ADD_REPORT', undefined, itemKey);
212
216
  const REMOVE_SURVEY_BY_KEY = (surveyKey, selector) => {
213
217
  if (selector === 'all') {
214
218
  return expressionUtils_expressionGen.generateExpression('REMOVE_SURVEYS_BY_KEY', undefined, surveyKey);
@@ -217,14 +221,49 @@ const REMOVE_SURVEY_BY_KEY = (surveyKey, selector) => {
217
221
  return expressionUtils_expressionGen.generateExpression('REMOVE_SURVEY_BY_KEY', undefined, surveyKey, selector);
218
222
  }
219
223
  };
220
- const REMOVE_ALL_REPORTS = () => expressionUtils_expressionGen.generateExpression('REMOVE_ALL_REPORTS');
221
- const REMOVE_REPORT_BY_KEY = (surveyKey, selector) => {
222
- if (selector === 'all') {
223
- return expressionUtils_expressionGen.generateExpression('REMOVE_REPORTS_BY_KEY', undefined, surveyKey);
224
- }
225
- else {
226
- return expressionUtils_expressionGen.generateExpression('REMOVE_REPORT_BY_KEY', undefined, surveyKey, selector);
227
- }
224
+ /**
225
+ * Initialises or resets a report for the current event
226
+ * @param reportKey key to be used for the report
227
+ */
228
+ const INIT_REPORT = (reportKey) => {
229
+ return expressionUtils_expressionGen.generateExpression('INIT_REPORT', undefined, reportKey);
230
+ };
231
+ /**
232
+ * Remove the report from the list of reports to be added at the end of the event
233
+ * @param reportKey key of the report that should be removed
234
+ * @returns
235
+ */
236
+ const CANCEL_REPORT = (reportKey) => {
237
+ return expressionUtils_expressionGen.generateExpression('CANCEL_REPORT', undefined, reportKey);
238
+ };
239
+ /**
240
+ * Update one value attribute in a report. If report was not initialized, one will be added to the list.
241
+ * @param reportKey
242
+ * @param attributeKey update / create this attribute in the report
243
+ * @param value this should be the value for the given attribute
244
+ * @param dtype optional dtype to set info for the app how to render this data.
245
+ * @returns
246
+ */
247
+ const UPDATE_REPORT_DATA = (reportKey, attributeKey, value, dtype) => {
248
+ return expressionUtils_expressionGen.generateExpression('UPDATE_REPORT_DATA', undefined, reportKey, attributeKey, value, dtype);
249
+ };
250
+ /**
251
+ * Method to remove one attribute (key and value) from the report
252
+ * @param reportKey
253
+ * @param attributeKey
254
+ * @returns
255
+ */
256
+ const REMOVE_REPORT_DATA = (reportKey, attributeKey) => {
257
+ return expressionUtils_expressionGen.generateExpression('REMOVE_REPORT_DATA', undefined, reportKey, attributeKey);
258
+ };
259
+ const setReportIcon = (reportKey, icon) => {
260
+ return UPDATE_REPORT_DATA(reportKey, 'icon', icon);
261
+ };
262
+ const setReportMessage = (reportKey, content, asTranslationKey) => {
263
+ return UPDATE_REPORT_DATA(reportKey, 'message', content, asTranslationKey ? undefined : 'rawMessage');
264
+ };
265
+ const setReportSummary = (reportKey, content, asTranslationKey) => {
266
+ return UPDATE_REPORT_DATA(reportKey, 'summary', content, asTranslationKey ? undefined : 'rawMessage');
228
267
  };
229
268
  // ##################
230
269
  // Prefill rule methods:
@@ -304,6 +343,19 @@ const NativeStudyEngineExpressions = {
304
343
  lastSubmissionDateOlderThan,
305
344
  hasMessageTypeAssigned,
306
345
  getMessageNextTime,
346
+ incomingParticipantState: {
347
+ // for merge event
348
+ getStudyEntryTime: getStudyEntryTimeForIncoming,
349
+ hasSurveyKeyAssigned: hasSurveyKeyAssignedForIncoming,
350
+ getSurveyKeyAssignedFrom: getSurveyKeyAssignedFromForIncoming,
351
+ getSurveyKeyAssignedUntil: getSurveyKeyAssignedUntilForIncoming,
352
+ hasStudyStatus: hasStudyStatusForIncoming,
353
+ hasParticipantFlagKeyAndValue: hasParticipantFlagKeyAndValueForIncoming,
354
+ hasParticipantFlagKey: hasParticipantFlagKeyForIncoming,
355
+ lastSubmissionDateOlderThan: lastSubmissionDateOlderThanForIncoming,
356
+ hasMessageTypeAssigned: hasMessageTypeAssignedForIncoming,
357
+ getMessageNextTime: getMessageNextTimeForIncoming,
358
+ }
307
359
  },
308
360
  // logical and comparision
309
361
  eq,
@@ -331,9 +383,14 @@ const StudyEngineActions = {
331
383
  remove: REMOVE_SURVEY_BY_KEY,
332
384
  },
333
385
  reports: {
334
- add: ADD_REPORT,
335
- removeAll: REMOVE_ALL_REPORTS,
336
- remove: REMOVE_REPORT_BY_KEY,
386
+ init: INIT_REPORT,
387
+ cancel: CANCEL_REPORT,
388
+ updateData: UPDATE_REPORT_DATA,
389
+ removeData: REMOVE_REPORT_DATA,
390
+ // Extra methods:
391
+ setReportIcon,
392
+ setReportMessage,
393
+ setReportSummary,
337
394
  },
338
395
  messages: {
339
396
  add: ADD_MESSAGE,
@@ -1 +1 @@
1
- {"version":3,"file":"studyEngineExpressions.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"studyEngineExpressions.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "case-editor-tools",
3
3
  "description": "Javascript tools to simplify survey and study coding for CASE.",
4
- "version": "1.0.0-beta.30",
4
+ "version": "1.0.0-beta.34",
5
5
  "main": "index.js",
6
6
  "license": "Apache-2.0",
7
7
  "repository": "github:case-framework/case-editor-tools",
package/surveys/index.js CHANGED
@@ -11,6 +11,7 @@ require('./utils/randomKeyGenerator.js');
11
11
  require('../logger/logger.js');
12
12
  require('./utils/componentGenerators.js');
13
13
  require('./utils/simple-generators.js');
14
+ require('./types/item-properties.js');
14
15
  require('../types/duration.js');
15
16
  require('../constants/key-definitions.js');
16
17
  require('./utils/simple-question-editor.js');
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;"}
@@ -5,6 +5,7 @@ Object.defineProperty(exports, '__esModule', { value: true });
5
5
  var surveys_surveyEditor_componentEditor = require('../survey-editor/component-editor.js');
6
6
  var surveys_utils_randomKeyGenerator = require('../utils/randomKeyGenerator.js');
7
7
  var surveys_utils_simpleGenerators = require('../utils/simple-generators.js');
8
+ require('../types/item-properties.js');
8
9
 
9
10
  const initLikertScaleGroup = (key, rows, scaleOptions, stackOnSmallScreen, displayCondition) => {
10
11
  const groupEdit = new surveys_surveyEditor_componentEditor.ComponentEditor(undefined, {
@@ -163,6 +164,7 @@ const initResponsiveSingleChoiceArray = (rgKey, props, displayCondition) => {
163
164
  groupEdit.addItemComponent({
164
165
  key: row.key,
165
166
  role: 'row',
167
+ displayCondition: row.displayCondition,
166
168
  style: rowStyles.length > 0 ? rowStyles : undefined,
167
169
  content: !Array.isArray(row.content) ? surveys_utils_simpleGenerators.generateLocStrings(row.content) : undefined,
168
170
  items: Array.isArray(row.content) ? row.content.map((cont, index) => {
@@ -300,6 +302,7 @@ const initResponsiveBipolarLikertArray = (rgKey, props, displayCondition) => {
300
302
  groupEdit.addItemComponent({
301
303
  key: row.key,
302
304
  role: 'row',
305
+ displayCondition: row.displayCondition,
303
306
  style: rowStyles.length > 0 ? rowStyles : undefined,
304
307
  items: [
305
308
  startLabel, endLabel
@@ -1 +1 @@
1
- {"version":3,"file":"likertGroupComponents.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"likertGroupComponents.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
@@ -4,6 +4,7 @@ Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
5
  var surveys_surveyEditor_componentEditor = require('../survey-editor/component-editor.js');
6
6
  var surveys_utils_simpleGenerators = require('../utils/simple-generators.js');
7
+ require('../types/item-properties.js');
7
8
  require('../utils/randomKeyGenerator.js');
8
9
 
9
10
  const initMatrixQuestion = (key, rows, order) => {
@@ -1 +1 @@
1
- {"version":3,"file":"matrixGroupComponent.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"matrixGroupComponent.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
@@ -4,6 +4,7 @@ Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
5
  var surveys_surveyEditor_componentEditor = require('../survey-editor/component-editor.js');
6
6
  var surveys_utils_simpleGenerators = require('../utils/simple-generators.js');
7
+ require('../types/item-properties.js');
7
8
  require('../utils/randomKeyGenerator.js');
8
9
 
9
10
  const optionDefToItemComponent = (optionDef) => {
@@ -1 +1 @@
1
- {"version":3,"file":"optionGroupComponents.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"optionGroupComponents.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
@@ -319,8 +319,12 @@ const hasParticipantFlagKey = (key) => {
319
319
  const hasParticipantFlagKeyAndValue = (key, value) => {
320
320
  return eq(getAttribute(getAttribute(getContext(), 'participantFlags'), key), value);
321
321
  };
322
+ /**
323
+ * Check if the participant is logged in currently.
324
+ * @returns true if context variable isLoggedIn is set and true
325
+ */
322
326
  const isLoggedIn = () => {
323
- return getAttribute(getContext(), 'isLoggedIn');
327
+ return and(isDefined(getAttribute(getContext(), 'isLoggedIn')), getAttribute(getContext(), 'isLoggedIn'));
324
328
  };
325
329
  /**
326
330
  * Counts the number of selected options in a multiple choice question
@@ -1 +1 @@
1
- {"version":3,"file":"survey-engine-expressions.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"survey-engine-expressions.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
@@ -14,6 +14,7 @@ var surveys_responseTypeGenerators_optionGroupComponents = require('./responseTy
14
14
  var surveys_responseTypeGenerators_likertGroupComponents = require('./responseTypeGenerators/likertGroupComponents.js');
15
15
  require('./utils/randomKeyGenerator.js');
16
16
  require('../logger/logger.js');
17
+ require('./types/item-properties.js');
17
18
  require('../expression-utils/expressionGen.js');
18
19
 
19
20
  const commonQuestionGenerator = (props, rg_inner) => {
@@ -1 +1 @@
1
- {"version":3,"file":"survey-items.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"survey-items.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
@@ -7,6 +7,7 @@ var surveys_surveyEditor_itemEditor = require('../../item-editor-c6933791.js');
7
7
  var surveys_utils_simpleGenerators = require('../utils/simple-generators.js');
8
8
  require('../survey-editor/component-editor.js');
9
9
  require('../utils/randomKeyGenerator.js');
10
+ require('./item-properties.js');
10
11
 
11
12
  class Group {
12
13
  constructor(parentKey, groupKey, selectionMethod) {
@@ -1 +1 @@
1
- {"version":3,"file":"group.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"group.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
@@ -4,6 +4,7 @@ Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
5
  var surveys_types_group = require('./group.js');
6
6
  var surveys_types_item = require('./item.js');
7
+ var surveys_types_itemProperties = require('./item-properties.js');
7
8
  var surveys_types_surveyDefinition = require('./survey-definition.js');
8
9
  require('../../logger/logger.js');
9
10
  require('../../item-editor-c6933791.js');
@@ -16,5 +17,6 @@ require('../survey-editor/survey-editor.js');
16
17
 
17
18
  exports.Group = surveys_types_group.Group;
18
19
  exports.Item = surveys_types_item.Item;
20
+ exports.isDateDisplayComponentProp = surveys_types_itemProperties.isDateDisplayComponentProp;
19
21
  exports.SurveyDefinition = surveys_types_surveyDefinition.SurveyDefinition;
20
22
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;"}
@@ -4,6 +4,13 @@ export interface StyledTextComponentProp {
4
4
  content: Map<string, string>;
5
5
  className?: string;
6
6
  }
7
+ export interface DateDisplayComponentProp {
8
+ languageCodes: string[];
9
+ date: Expression;
10
+ dateFormat: string;
11
+ className?: string;
12
+ }
13
+ export declare const isDateDisplayComponentProp: (value: DateDisplayComponentProp | any) => value is DateDisplayComponentProp;
7
14
  export interface OptionDef {
8
15
  key: string;
9
16
  role: string;
@@ -22,7 +29,7 @@ export interface GenericQuestionProps {
22
29
  parentKey: string;
23
30
  itemKey: string;
24
31
  version?: number;
25
- questionText: Map<string, string> | Array<StyledTextComponentProp>;
32
+ questionText: Map<string, string> | Array<StyledTextComponentProp | DateDisplayComponentProp>;
26
33
  questionSubText?: Map<string, string>;
27
34
  titleClassName?: string;
28
35
  helpGroupContent?: Array<{
@@ -103,6 +110,7 @@ export interface ResponsiveSingleChoiceArrayProps {
103
110
  }>;
104
111
  rows: Array<{
105
112
  key: string;
113
+ displayCondition?: Expression;
106
114
  content: Map<string, string> | StyledTextComponentProp[];
107
115
  horizontalModeProps?: {
108
116
  labelPlacement?: 'none' | 'top' | 'bottom';
@@ -152,6 +160,7 @@ export interface ResponsiveBipolarLikertArrayProps {
152
160
  key: string;
153
161
  startLabel: Map<string, string> | StyledTextComponentProp[];
154
162
  endLabel: Map<string, string> | StyledTextComponentProp[];
163
+ displayCondition?: Expression;
155
164
  withLabelRowModeProps?: {
156
165
  className?: string;
157
166
  };
@@ -1,3 +1,10 @@
1
1
  'use strict';
2
2
 
3
+ Object.defineProperty(exports, '__esModule', { value: true });
4
+
5
+ const isDateDisplayComponentProp = (value) => {
6
+ return typeof (value) === 'object' && value.date !== undefined && value.dateFormat !== undefined && value.languageCodes !== undefined;
7
+ };
8
+
9
+ exports.isDateDisplayComponentProp = isDateDisplayComponentProp;
3
10
  //# sourceMappingURL=item-properties.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"item-properties.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;"}
1
+ {"version":3,"file":"item-properties.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;"}
@@ -8,6 +8,7 @@ var surveys_surveyEditor_surveyEditor = require('../survey-editor/survey-editor.
8
8
  var surveys_utils_simpleGenerators = require('../utils/simple-generators.js');
9
9
  require('../survey-editor/component-editor.js');
10
10
  require('../utils/randomKeyGenerator.js');
11
+ require('./item-properties.js');
11
12
 
12
13
  class SurveyDefinition {
13
14
  constructor(props) {
@@ -1 +1 @@
1
- {"version":3,"file":"survey-definition.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"survey-definition.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
@@ -5,6 +5,7 @@ Object.defineProperty(exports, '__esModule', { value: true });
5
5
  var surveys_utils_randomKeyGenerator = require('./randomKeyGenerator.js');
6
6
  var surveys_utils_simpleGenerators = require('./simple-generators.js');
7
7
  require('../survey-editor/component-editor.js');
8
+ require('../types/item-properties.js');
8
9
 
9
10
  const text = (props) => {
10
11
  const styles = [];
@@ -1 +1 @@
1
- {"version":3,"file":"componentGenerators.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"componentGenerators.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
@@ -1,7 +1,8 @@
1
1
  import { LocalizedString, ItemComponent, ExpressionName, Expression, ItemGroupComponent, SurveySingleItem } from "survey-engine/data_types";
2
- import { StyledTextComponentProp } from "../types/item-properties";
2
+ import { DateDisplayComponentProp, StyledTextComponentProp } from "../types/item-properties";
3
3
  export declare const generateLocStrings: (translations: Map<string, string>) => LocalizedString[];
4
- export declare const generateTitleComponent: (content: Map<string, string> | Array<StyledTextComponentProp>, description?: Map<string, string> | undefined, className?: string | undefined) => ItemComponent;
4
+ export declare const generateDateDisplayComp: (key: string, item: DateDisplayComponentProp) => ItemComponent;
5
+ export declare const generateTitleComponent: (content: Map<string, string> | Array<StyledTextComponentProp | DateDisplayComponentProp>, description?: Map<string, string> | undefined, className?: string | undefined) => ItemComponent;
5
6
  export declare const generateHelpGroupComponent: (items: Array<{
6
7
  content: Map<string, string>;
7
8
  style?: Array<{
@@ -3,6 +3,7 @@
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
5
  var surveys_surveyEditor_componentEditor = require('../survey-editor/component-editor.js');
6
+ var surveys_types_itemProperties = require('../types/item-properties.js');
6
7
  var surveys_utils_randomKeyGenerator = require('./randomKeyGenerator.js');
7
8
 
8
9
  const generateLocStrings = (translations) => {
@@ -17,11 +18,38 @@ const generateLocStrings = (translations) => {
17
18
  });
18
19
  return locString;
19
20
  };
21
+ const generateDateDisplayComp = (key, item) => {
22
+ // console.log(translations);
23
+ const styleArray = [
24
+ { key: 'dateFormat', value: item.dateFormat }
25
+ ];
26
+ if (item.className) {
27
+ styleArray.push({ key: 'className', value: item.className });
28
+ }
29
+ const locString = new Array();
30
+ const dateExp = item.date;
31
+ item.languageCodes.forEach((code) => {
32
+ const translatedItem = {
33
+ code: code,
34
+ parts: [{ exp: dateExp }]
35
+ };
36
+ locString.push(translatedItem);
37
+ });
38
+ return {
39
+ key: key,
40
+ role: 'dateDisplay',
41
+ content: locString,
42
+ style: item.className ? [{ key: 'className', value: item.className }] : undefined
43
+ };
44
+ };
20
45
  const generateTitleComponent = (content, description, className) => {
21
46
  let items = undefined;
22
47
  let currentContent = undefined;
23
48
  if (Array.isArray(content)) {
24
49
  items = content.map((item, index) => {
50
+ if (surveys_types_itemProperties.isDateDisplayComponentProp(item)) {
51
+ return generateDateDisplayComp(index.toFixed(), item);
52
+ }
25
53
  return {
26
54
  key: index.toFixed(),
27
55
  role: 'text',
@@ -95,6 +123,7 @@ const generatePageBreak = (parentKey, key) => {
95
123
  };
96
124
 
97
125
  exports.expWithArgs = expWithArgs;
126
+ exports.generateDateDisplayComp = generateDateDisplayComp;
98
127
  exports.generateHelpGroupComponent = generateHelpGroupComponent;
99
128
  exports.generateLocStrings = generateLocStrings;
100
129
  exports.generatePageBreak = generatePageBreak;
@@ -1 +1 @@
1
- {"version":3,"file":"simple-generators.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"simple-generators.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
@@ -1,12 +1,12 @@
1
1
  import { Expression, ItemComponent } from "survey-engine/data_types";
2
2
  import { ItemEditor } from "../survey-editor/item-editor";
3
- import { StyledTextComponentProp } from "../types/item-properties";
3
+ import { DateDisplayComponentProp, StyledTextComponentProp } from "../types/item-properties";
4
4
  export declare class SimpleQuestionEditor {
5
5
  editor: ItemEditor;
6
6
  key: string;
7
7
  constructor(parentKey: string, key: string, version: number);
8
8
  getItem(): import("survey-engine/data_types").SurveyItem;
9
- setTitle(title: Map<string, string> | Array<StyledTextComponentProp>, description?: Map<string, string>, className?: string): void;
9
+ setTitle(title: Map<string, string> | Array<StyledTextComponentProp | DateDisplayComponentProp>, description?: Map<string, string>, className?: string): void;
10
10
  setCondition(exp: Expression): void;
11
11
  addDisplayComponent(comp: ItemComponent, atPosition?: number): void;
12
12
  addHasResponseValidation(): void;
@@ -8,6 +8,7 @@ var surveys_utils_simpleGenerators = require('./simple-generators.js');
8
8
  require('../survey-editor/component-editor.js');
9
9
  require('./randomKeyGenerator.js');
10
10
  require('../../logger/logger.js');
11
+ require('../types/item-properties.js');
11
12
 
12
13
  class SimpleQuestionEditor {
13
14
  constructor(parentKey, key, version) {
@@ -1 +1 @@
1
- {"version":3,"file":"simple-question-editor.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"simple-question-editor.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
@@ -3,6 +3,7 @@ export declare class StudyRules {
3
3
  private enterRules?;
4
4
  private submitRules?;
5
5
  private timerRules?;
6
- constructor(enterRules?: Expression[], submitRules?: Expression[], timerRules?: Expression[]);
6
+ private mergeRules?;
7
+ constructor(enterRules?: Expression[], submitRules?: Expression[], timerRules?: Expression[], mergeRules?: Expression[]);
7
8
  get(): Expression[];
8
9
  }
@@ -8,10 +8,11 @@ require('./duration.js');
8
8
  require('../expression-utils/expressionGen.js');
9
9
 
10
10
  class StudyRules {
11
- constructor(enterRules, submitRules, timerRules) {
11
+ constructor(enterRules, submitRules, timerRules, mergeRules) {
12
12
  this.enterRules = enterRules;
13
13
  this.submitRules = submitRules;
14
14
  this.timerRules = timerRules;
15
+ this.mergeRules = mergeRules;
15
16
  }
16
17
  get() {
17
18
  const rules = [];
@@ -24,6 +25,9 @@ class StudyRules {
24
25
  if (this.timerRules) {
25
26
  rules.push(expressionUtils_studyEngineExpressions.StudyEngine.ifThen(expressionUtils_studyEngineExpressions.StudyEngine.checkEventType('TIMER'), ...this.timerRules));
26
27
  }
28
+ if (this.mergeRules) {
29
+ rules.push(expressionUtils_studyEngineExpressions.StudyEngine.ifThen(expressionUtils_studyEngineExpressions.StudyEngine.checkEventType('MERGE'), ...this.mergeRules));
30
+ }
27
31
  return rules;
28
32
  }
29
33
  }
@@ -1 +1 @@
1
- {"version":3,"file":"studyRules.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"studyRules.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}