@inseefr/lunatic 3.5.2 → 3.5.4

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 (148) hide show
  1. package/components/Input/Input.spec.js +6 -0
  2. package/components/Input/Input.spec.js.map +1 -1
  3. package/components/InputNumber/InputNumber.spec.js +6 -0
  4. package/components/InputNumber/InputNumber.spec.js.map +1 -1
  5. package/components/InputNumber/InputNumberThousand.js +10 -5
  6. package/components/InputNumber/InputNumberThousand.js.map +1 -1
  7. package/components/Textarea/Textarea.js +1 -1
  8. package/components/Textarea/Textarea.js.map +1 -1
  9. package/components/Textarea/Textarea.spec.js +7 -0
  10. package/components/Textarea/Textarea.spec.js.map +1 -1
  11. package/esm/components/Input/Input.spec.js +6 -0
  12. package/esm/components/Input/Input.spec.js.map +1 -1
  13. package/esm/components/InputNumber/InputNumber.spec.js +6 -0
  14. package/esm/components/InputNumber/InputNumber.spec.js.map +1 -1
  15. package/esm/components/InputNumber/InputNumberThousand.js +10 -5
  16. package/esm/components/InputNumber/InputNumberThousand.js.map +1 -1
  17. package/esm/components/Textarea/Textarea.js +1 -1
  18. package/esm/components/Textarea/Textarea.js.map +1 -1
  19. package/esm/components/Textarea/Textarea.spec.js +7 -0
  20. package/esm/components/Textarea/Textarea.spec.js.map +1 -1
  21. package/esm/hooks/use-track-changes.js +2 -1
  22. package/esm/hooks/use-track-changes.js.map +1 -1
  23. package/esm/stories/overview/sourceWithHierarchy.json +32 -32
  24. package/esm/type.source.d.ts +1 -1
  25. package/esm/use-lunatic/commons/fill-components/fill-component.spec.js +1 -1
  26. package/esm/use-lunatic/commons/fill-components/fill-component.spec.js.map +1 -1
  27. package/esm/use-lunatic/commons/fill-components/fill-components.js +1 -1
  28. package/esm/use-lunatic/commons/fill-components/fill-components.js.map +1 -1
  29. package/esm/use-lunatic/commons/variables/behaviours/resizing-behaviour.js +11 -7
  30. package/esm/use-lunatic/commons/variables/behaviours/resizing-behaviour.js.map +1 -1
  31. package/esm/use-lunatic/commons/variables/get-questionnaire-data.js +1 -0
  32. package/esm/use-lunatic/commons/variables/get-questionnaire-data.js.map +1 -1
  33. package/esm/use-lunatic/commons/variables/lunatic-variables-store.d.ts +11 -1
  34. package/esm/use-lunatic/commons/variables/lunatic-variables-store.js +38 -1
  35. package/esm/use-lunatic/commons/variables/lunatic-variables-store.js.map +1 -1
  36. package/esm/use-lunatic/commons/variables/lunatic-variables-store.spec.js +33 -0
  37. package/esm/use-lunatic/commons/variables/lunatic-variables-store.spec.js.map +1 -1
  38. package/esm/use-lunatic/reducer/reducer.js +9 -0
  39. package/esm/use-lunatic/reducer/reducer.js.map +1 -1
  40. package/esm/use-lunatic/reducer/reducerInitializer.js +1 -1
  41. package/esm/use-lunatic/reducer/reducerInitializer.js.map +1 -1
  42. package/esm/use-lunatic/type.d.ts +2 -0
  43. package/esm/utils/number.d.ts +0 -4
  44. package/esm/utils/number.js +0 -10
  45. package/esm/utils/number.js.map +1 -1
  46. package/esm/utils/number.spec.js +1 -44
  47. package/esm/utils/number.spec.js.map +1 -1
  48. package/hooks/use-track-changes.js +2 -1
  49. package/hooks/use-track-changes.js.map +1 -1
  50. package/package.json +1 -1
  51. package/src/components/Input/Input.spec.tsx +9 -0
  52. package/src/components/InputNumber/InputNumber.spec.tsx +9 -0
  53. package/src/components/InputNumber/InputNumberThousand.tsx +10 -6
  54. package/src/components/InputNumber/__snapshots__/InputNumber.spec.tsx.snap +2 -0
  55. package/src/components/Textarea/Textarea.spec.tsx +10 -0
  56. package/src/components/Textarea/Textarea.tsx +1 -0
  57. package/src/hooks/use-track-changes.ts +2 -1
  58. package/src/stories/behaviour/cleaning/loop.json +4 -4
  59. package/src/stories/behaviour/cleaning/source-loop.json +1 -1
  60. package/src/stories/behaviour/cleaning/source.json +2 -2
  61. package/src/stories/behaviour/controls/boucles-n.json +2 -2
  62. package/src/stories/behaviour/controls/simple-numeric.json +19 -19
  63. package/src/stories/behaviour/controls/simple.json +7 -7
  64. package/src/stories/behaviour/filter/source.json +3 -3
  65. package/src/stories/behaviour/filter/sourceLoop.json +3 -3
  66. package/src/stories/behaviour/missing/source.json +6 -6
  67. package/src/stories/behaviour/others/V2_DeclarationsSimples.json +14 -14
  68. package/src/stories/behaviour/others/V2_MinMaxSum_Boucles.json +5 -5
  69. package/src/stories/behaviour/others/V2_QuestSimple_Boucles.json +28 -28
  70. package/src/stories/behaviour/others/V2_TCMRallyeGames.json +24 -24
  71. package/src/stories/behaviour/others/test-dylan.json +5 -5
  72. package/src/stories/behaviour/resizing/source-resizing-cleaning.json +2 -2
  73. package/src/stories/behaviour/resizing/source.json +5 -5
  74. package/src/stories/checkbox-boolean/source.json +1 -1
  75. package/src/stories/checkbox-one/source.json +1 -1
  76. package/src/stories/checkbox-one/sourceDetail.json +1 -1
  77. package/src/stories/date-picker/source.json +1 -1
  78. package/src/stories/disabled/source.json +5 -5
  79. package/src/stories/dropdown/source.json +2 -2
  80. package/src/stories/duration/mois.json +1 -1
  81. package/src/stories/duration/time.json +1 -1
  82. package/src/stories/input-number/source-big-number.json +1 -1
  83. package/src/stories/input-number/source-euro.json +2 -2
  84. package/src/stories/overview/sourceLoop.json +12 -12
  85. package/src/stories/overview/sourceWithHierarchy.json +32 -32
  86. package/src/stories/question/source.json +2 -2
  87. package/src/stories/questionnaires/logement/source-sequence.json +216 -216
  88. package/src/stories/questionnaires/logement/source-sum.json +189 -189
  89. package/src/stories/questionnaires/logement/source.json +216 -216
  90. package/src/stories/questionnaires/recensement/source.json +85 -85
  91. package/src/stories/questionnaires/rp/source.json +8 -8
  92. package/src/stories/questionnaires/simpsons/source.json +34 -34
  93. package/src/stories/radio/source.json +1 -1
  94. package/src/stories/radio/sourceDetail.json +1 -1
  95. package/src/stories/radio/sourceHorizontal.json +1 -1
  96. package/src/stories/roundabout/source.json +3 -3
  97. package/src/stories/suggester/source-arbitrary-response.json +2 -2
  98. package/src/stories/suggester/source-error.json +2 -2
  99. package/src/stories/suggester/source-multiline.json +2 -2
  100. package/src/stories/suggester/source-option-responses.json +2 -2
  101. package/src/stories/suggester/source.json +5 -5
  102. package/src/stories/summary/source.json +4 -4
  103. package/src/stories/switch/data-forced.json +2 -2
  104. package/src/stories/switch/source.json +2 -2
  105. package/src/stories/table/source-colspan.json +1 -1
  106. package/src/stories/table/source.json +1 -1
  107. package/src/stories/table/table-dynamique.json +1 -1
  108. package/src/stories/text/source-roster.json +1 -1
  109. package/src/stories/text/source-table.json +1 -1
  110. package/src/type.source.ts +1 -1
  111. package/src/use-lunatic/commons/fill-components/fill-component.spec.ts +1 -1
  112. package/src/use-lunatic/commons/fill-components/fill-components.ts +1 -1
  113. package/src/use-lunatic/commons/variables/behaviours/resizing-behaviour.ts +14 -6
  114. package/src/use-lunatic/commons/variables/get-questionnaire-data.ts +1 -0
  115. package/src/use-lunatic/commons/variables/lunatic-variables-store.spec.ts +37 -0
  116. package/src/use-lunatic/commons/variables/lunatic-variables-store.ts +43 -1
  117. package/src/use-lunatic/reducer/reducer.ts +11 -0
  118. package/src/use-lunatic/reducer/reducerInitializer.tsx +2 -1
  119. package/src/use-lunatic/type.ts +2 -0
  120. package/src/use-lunatic/use-lunatic.test.ts +1 -1
  121. package/src/utils/number.spec.ts +1 -45
  122. package/src/utils/number.ts +0 -18
  123. package/stories/overview/sourceWithHierarchy.json +32 -32
  124. package/tsconfig.build.tsbuildinfo +1 -1
  125. package/type.source.d.ts +1 -1
  126. package/use-lunatic/commons/fill-components/fill-component.spec.js +1 -1
  127. package/use-lunatic/commons/fill-components/fill-component.spec.js.map +1 -1
  128. package/use-lunatic/commons/fill-components/fill-components.js +1 -1
  129. package/use-lunatic/commons/fill-components/fill-components.js.map +1 -1
  130. package/use-lunatic/commons/variables/behaviours/resizing-behaviour.js +11 -7
  131. package/use-lunatic/commons/variables/behaviours/resizing-behaviour.js.map +1 -1
  132. package/use-lunatic/commons/variables/get-questionnaire-data.js +1 -0
  133. package/use-lunatic/commons/variables/get-questionnaire-data.js.map +1 -1
  134. package/use-lunatic/commons/variables/lunatic-variables-store.d.ts +11 -1
  135. package/use-lunatic/commons/variables/lunatic-variables-store.js +38 -1
  136. package/use-lunatic/commons/variables/lunatic-variables-store.js.map +1 -1
  137. package/use-lunatic/commons/variables/lunatic-variables-store.spec.js +33 -0
  138. package/use-lunatic/commons/variables/lunatic-variables-store.spec.js.map +1 -1
  139. package/use-lunatic/reducer/reducer.js +9 -0
  140. package/use-lunatic/reducer/reducer.js.map +1 -1
  141. package/use-lunatic/reducer/reducerInitializer.js +1 -1
  142. package/use-lunatic/reducer/reducerInitializer.js.map +1 -1
  143. package/use-lunatic/type.d.ts +2 -0
  144. package/utils/number.d.ts +0 -4
  145. package/utils/number.js +0 -11
  146. package/utils/number.js.map +1 -1
  147. package/utils/number.spec.js +0 -43
  148. package/utils/number.spec.js.map +1 -1
@@ -38,7 +38,7 @@ describe('fillComponents', () => {
38
38
  type: 'VTL|MD',
39
39
  value: '"Input label"',
40
40
  },
41
- mandatory: true,
41
+ isMandatory: true,
42
42
  maxLength: 15,
43
43
  },
44
44
  ];
@@ -49,7 +49,7 @@ export const fillComponent = (
49
49
  goNextPage: state.goNextPage,
50
50
  goPreviousPage: state.goPreviousPage,
51
51
  iteration: state.pager.iteration,
52
- required: 'mandatory' in component ? component.mandatory : false,
52
+ required: 'isMandatory' in component ? component.isMandatory : false,
53
53
  value: value,
54
54
  missingResponse: getMissingResponseProp(component, state),
55
55
  management: state.management,
@@ -41,12 +41,20 @@ export function resizingBehaviour(
41
41
 
42
42
  const newSize = forceInt(store.run(resizingInfo.size));
43
43
  for (const variableName of resizingInfo.variables) {
44
- const value = store.get(variableName);
45
- if (!Array.isArray(value) || value.length !== newSize) {
46
- store.set(variableName, resizeArrayVariable(value, newSize, null), {
44
+ // Since data can change after the resize, we need to pass a callback that will use the last value of the variable for the resize
45
+ store.enqueueSet(
46
+ variableName,
47
+ () => {
48
+ const value = store.get(variableName);
49
+ if (!Array.isArray(value) || value.length !== newSize) {
50
+ return resizeArrayVariable(value, newSize, null);
51
+ }
52
+ return value;
53
+ },
54
+ {
47
55
  cause: 'resizing',
48
- });
49
- }
56
+ }
57
+ );
50
58
  }
51
59
  });
52
60
  }
@@ -81,6 +89,6 @@ function resizePairwise(
81
89
  xSize,
82
90
  new Array(ySize).fill(null)
83
91
  );
84
- store.set(variable, resizedValue);
92
+ store.enqueueSet(variable, resizedValue);
85
93
  });
86
94
  }
@@ -7,6 +7,7 @@ export function getQuestionnaireData(
7
7
  withCalculated: boolean = false,
8
8
  variableNames?: string[]
9
9
  ): LunaticData {
10
+ store.commit();
10
11
  const result = {
11
12
  EXTERNAL: {} as Record<string, unknown>,
12
13
  CALCULATED: {} as Record<string, unknown>,
@@ -115,6 +115,15 @@ describe('lunatic-variables-store', () => {
115
115
  expect(variables.get('AGES_PLUS_NBHAB')).toEqual([4, 5, 6]);
116
116
  });
117
117
 
118
+ it('should handle transaction mode correctly', () => {
119
+ variables.set('FIRSTNAME', 'John');
120
+ expect(variables.get('FIRSTNAME')).toEqual('John');
121
+ variables.enqueueSet('FIRSTNAME', 'Jane');
122
+ expect(variables.get('FIRSTNAME')).toEqual('John');
123
+ variables.commit();
124
+ expect(variables.get('FIRSTNAME')).toEqual('Jane');
125
+ });
126
+
118
127
  describe('event listener', () => {
119
128
  it('should trigger onChange', () => {
120
129
  variables.set('FIRSTNAME', 'John');
@@ -273,6 +282,10 @@ describe('lunatic-variables-store', () => {
273
282
  });
274
283
 
275
284
  describe('resizing', () => {
285
+ beforeEach(() => {
286
+ variables.autoCommit = true;
287
+ });
288
+
276
289
  it('should resize variables', () => {
277
290
  variables.set('PRENOM', ['John', 'Jane']);
278
291
  variables.set('NOM', ['Doe']);
@@ -367,6 +380,10 @@ describe('lunatic-variables-store', () => {
367
380
  });
368
381
 
369
382
  describe('cleaning', () => {
383
+ beforeEach(() => {
384
+ variables.autoCommit = true;
385
+ });
386
+
370
387
  it('should clean variables', () => {
371
388
  variables.set('PRENOM', 'John');
372
389
  variables.set('NOM', 'Doe');
@@ -568,6 +585,25 @@ describe('lunatic-variables-store', () => {
568
585
  });
569
586
  });
570
587
 
588
+ describe('commit', () => {
589
+ it('should handle data change before commit', () => {
590
+ variables.set('PRENOM', []);
591
+ variables.set('NOM', []);
592
+ resizingBehaviour(variables, {
593
+ PRENOM: {
594
+ size: 'count(PRENOM)',
595
+ variables: ['NOM'],
596
+ },
597
+ });
598
+ variables.set('PRENOM', ['John', 'Jane', 'Marc']);
599
+ variables.set('NOM', ['Doe', 'Doe2', 'Doe3']);
600
+ variables.set('PRENOM', ['John', 'Jane']); // Should trigger a delayed resize
601
+ variables.set('NOM', 'New', { iteration: [1] }); // But we change a value inside the resized variable
602
+ variables.commit();
603
+ expect(variables.get('NOM') as string[][]).toEqual(['Doe', 'New']);
604
+ });
605
+ });
606
+
571
607
  describe('makeFromSource', () => {
572
608
  it('should handle initial data correctly', () => {
573
609
  const store = LunaticVariablesStore.makeFromSource(
@@ -606,6 +642,7 @@ describe('lunatic-variables-store', () => {
606
642
  );
607
643
  expect(store.get('PRENOM')).toEqual('Jane');
608
644
  store.set('NOM', 'Doe');
645
+ store.commit();
609
646
  expect(store.get('PRENOM')).toEqual('John');
610
647
  });
611
648
  it('should enable cleaning when disableCleaning = false', () => {
@@ -46,6 +46,8 @@ export type LunaticVariablesStoreEvent<T extends keyof EventArgs> = {
46
46
  export class LunaticVariablesStore {
47
47
  private dictionary = new Map<string, LunaticVariable>();
48
48
  private eventTarget = new EventTarget();
49
+ private queue = new Map<string, () => void>();
50
+ public autoCommit = false; // Commit change instantly (used in tests)
49
51
 
50
52
  constructor() {
51
53
  interpretCount = 0;
@@ -55,12 +57,18 @@ export class LunaticVariablesStore {
55
57
  source: LunaticSource,
56
58
  data: LunaticData,
57
59
  changeHandler: RefObject<LunaticOptions['onVariableChange']>,
58
- disableCleaning?: boolean
60
+ // Disable cleaning
61
+ disableCleaning?: boolean,
62
+ // Do not delay resizing / cleaning
63
+ autoCommit?: boolean
59
64
  ) {
60
65
  const store = new LunaticVariablesStore();
61
66
  if (!source.variables) {
62
67
  return store;
63
68
  }
69
+ if (autoCommit) {
70
+ store.autoCommit = autoCommit;
71
+ }
64
72
  // Source data (picked from "variables" in the source.json)s
65
73
  const sourceValues: Record<string, unknown> = {};
66
74
  // Starting data for the form (merged with data.json or injected data)
@@ -120,6 +128,40 @@ export class LunaticVariablesStore {
120
128
  return this.dictionary.get(name)!.getValue(iteration) as T;
121
129
  }
122
130
 
131
+ /**
132
+ * Transactional setter that will change data only when `commit()` is called
133
+ */
134
+ public enqueueSet(
135
+ name: string,
136
+ value: unknown,
137
+ args: Pick<EventArgs['change'], 'iteration' | 'cause'> = {}
138
+ ) {
139
+ if (this.autoCommit) {
140
+ this.set(name, typeof value === 'function' ? value() : value, args);
141
+ return;
142
+ }
143
+ this.queue.set(name, () => {
144
+ // A function can be enqueued, we need to evaluate it to retrieve the value to set
145
+ // This is used for the resizing, where we want to resize the last version of the variable
146
+ if (typeof value === 'function') {
147
+ value = value();
148
+ }
149
+ this.set(name, value, args);
150
+ });
151
+ }
152
+
153
+ /**
154
+ * Commit all changes in the queue
155
+ */
156
+ public commit() {
157
+ const autoCommitValue = this.autoCommit;
158
+ // Since we can have nested operation, we prevent delayed set while commiting
159
+ this.autoCommit = true;
160
+ Array.from(this.queue.values()).forEach((cb) => cb());
161
+ this.autoCommit = autoCommitValue;
162
+ this.queue.clear();
163
+ }
164
+
123
165
  /**
124
166
  * Set variable value
125
167
  */
@@ -5,10 +5,21 @@ import { reduceHandleChanges } from './reduce-handle-changes';
5
5
  import { reduceGoPreviousPage } from './reduce-go-previous-page';
6
6
  import { reduceGoToPage } from './reduce-go-to-page';
7
7
 
8
+ // Action that trigger a change in the store
9
+ const commitActions: ActionKind[] = [
10
+ ActionKind.GO_PREVIOUS_PAGE,
11
+ ActionKind.GO_NEXT_PAGE,
12
+ ActionKind.GO_TO_PAGE,
13
+ ];
14
+
8
15
  export function reducer(
9
16
  state: LunaticReducerState,
10
17
  action: Action
11
18
  ): LunaticReducerState {
19
+ if (commitActions.includes(action.type)) {
20
+ state.variables.commit();
21
+ }
22
+
12
23
  switch (action.type) {
13
24
  case ActionKind.GO_PREVIOUS_PAGE:
14
25
  return reduceGoPreviousPage(state);
@@ -67,7 +67,8 @@ export function reducerInitializer({
67
67
  source,
68
68
  data,
69
69
  onVariableChange,
70
- disableFilters
70
+ disableFilters,
71
+ source.pagination !== 'question'
71
72
  );
72
73
  const pages = checkLoops(createMapPages(source));
73
74
 
@@ -235,6 +235,8 @@ export type LunaticOptions = {
235
235
  trackChanges?: boolean;
236
236
  logger?: LunaticLogger;
237
237
  componentsOptions?: { detailAlwaysDisplayed?: boolean };
238
+ /** Commit variable change automatically for resizing / cleaning (used for testing) **/
239
+ autoCommit?: boolean;
238
240
  };
239
241
 
240
242
  /**
@@ -230,7 +230,7 @@ describe('use-lunatic()', () => {
230
230
  describe('cleaning', () => {
231
231
  it('should handle cleaning in a loop', () => {
232
232
  const { result } = renderHook(() =>
233
- useLunatic(sourceCleaningLoop as any, undefined, {})
233
+ useLunatic(sourceCleaningLoop as any, undefined)
234
234
  );
235
235
  act(() => {
236
236
  result.current.handleChanges([
@@ -1,5 +1,5 @@
1
1
  import { describe, expect, it } from 'vitest';
2
- import { between, isNumberInInterval } from './number';
2
+ import { between } from './number';
3
3
 
4
4
  describe('between', () => {
5
5
  it('should work', () => {
@@ -8,47 +8,3 @@ describe('between', () => {
8
8
  expect(between(-23.22, -5, 100)).toBe(-5);
9
9
  });
10
10
  });
11
-
12
- describe('isNumberInInterval', () => {
13
- it('allows value within range', () => {
14
- expect(isNumberInInterval(25, 10, 50)).toBe(true);
15
- });
16
- it('disallows value above max', () => {
17
- expect(isNumberInInterval(55, 10, 50)).toBe(false);
18
- });
19
- it('disallows value below min', () => {
20
- expect(isNumberInInterval(5, 10, 50)).toBe(false);
21
- });
22
- it('allows negative within bounds', () => {
23
- expect(isNumberInInterval(-4, -5, 0)).toBe(true);
24
- });
25
- it('disallows negative if min is 0 or positive', () => {
26
- expect(isNumberInInterval(-1, 0, 10)).toBe(false);
27
- expect(isNumberInInterval(-1, 5, 10)).toBe(false);
28
- });
29
- it('allows only value above min when max is undefined', () => {
30
- expect(isNumberInInterval(999, 100)).toBe(true);
31
- expect(isNumberInInterval(50, 100)).toBe(false);
32
- });
33
- it('allows only value below max when min is undefined', () => {
34
- expect(isNumberInInterval(50, undefined, 100)).toBe(true);
35
- // accepts negative values
36
- expect(isNumberInInterval(-50, undefined, 100)).toBe(true);
37
- expect(isNumberInInterval(150, undefined, 100)).toBe(false);
38
- });
39
- it('allows decimal value within range', () => {
40
- expect(isNumberInInterval(9.99, 0, 10)).toBe(true);
41
- });
42
- it('disallows decimal value above max', () => {
43
- expect(isNumberInInterval(10.01, 0, 10)).toBe(false);
44
- });
45
- it('disallows decimal value below min', () => {
46
- expect(isNumberInInterval(-5.01, -5, 5)).toBe(false);
47
- });
48
- it('allows decimal value equal to max', () => {
49
- expect(isNumberInInterval(10.0, 0, 10)).toBe(true);
50
- });
51
- it('allows decimal value equal to min', () => {
52
- expect(isNumberInInterval(-5.0, -5, 5)).toBe(true);
53
- });
54
- });
@@ -31,21 +31,3 @@ export function between(n: number, min: number, max: number): number {
31
31
  export function isNumber(n: unknown): n is number {
32
32
  return typeof n === 'number' && Number.isFinite(n);
33
33
  }
34
-
35
- /** Check if a value is within an interval.
36
- * Both minimum and maximum can be undefined, then we just compare with the defined bounds.
37
- */
38
- export function isNumberInInterval(
39
- value: number,
40
- min?: number,
41
- max?: number
42
- ): boolean {
43
- if (
44
- (min !== undefined && value < min) ||
45
- (max !== undefined && value > max)
46
- ) {
47
- return false;
48
- }
49
-
50
- return true;
51
- }
@@ -38,7 +38,7 @@
38
38
  {
39
39
  "id": "j6p3dkx6",
40
40
  "componentType": "Textarea",
41
- "mandatory": true,
41
+ "isMandatory": true,
42
42
  "page": "2",
43
43
  "maxLength": 500,
44
44
  "label": {
@@ -60,7 +60,7 @@
60
60
  {
61
61
  "id": "j6p0np9q",
62
62
  "componentType": "CheckboxBoolean",
63
- "mandatory": false,
63
+ "isMandatory": false,
64
64
  "page": "3",
65
65
  "label": {
66
66
  "value": "\"➡ \" || \"If you agree to answer this questionnaire, please check the box\"",
@@ -139,7 +139,7 @@
139
139
  {
140
140
  "id": "j3343qhx",
141
141
  "componentType": "Input",
142
- "mandatory": false,
142
+ "isMandatory": false,
143
143
  "page": "4",
144
144
  "maxLength": 30,
145
145
  "label": {
@@ -173,7 +173,7 @@
173
173
  {
174
174
  "id": "j6q9h8tj",
175
175
  "componentType": "InputNumber",
176
- "mandatory": true,
176
+ "isMandatory": true,
177
177
  "page": "5",
178
178
  "min": 0,
179
179
  "max": 99,
@@ -209,7 +209,7 @@
209
209
  {
210
210
  "id": "kiq71eoi",
211
211
  "componentType": "Datepicker",
212
- "mandatory": false,
212
+ "isMandatory": false,
213
213
  "page": "6",
214
214
  "min": "1900-01-01",
215
215
  "max": "format-date(current-date(),'[Y0001]-[M01]-[D01]')",
@@ -256,7 +256,7 @@
256
256
  {
257
257
  "id": "k5nvty2o",
258
258
  "componentType": "Datepicker",
259
- "mandatory": false,
259
+ "isMandatory": false,
260
260
  "page": "7",
261
261
  "min": "1980-05",
262
262
  "label": {
@@ -302,7 +302,7 @@
302
302
  {
303
303
  "id": "k5nw1fir",
304
304
  "componentType": "Datepicker",
305
- "mandatory": false,
305
+ "isMandatory": false,
306
306
  "page": "8",
307
307
  "min": "1900",
308
308
  "max": "year-from-date(current-date())",
@@ -349,7 +349,7 @@
349
349
  {
350
350
  "id": "k5nw0w05",
351
351
  "componentType": "InputNumber",
352
- "mandatory": false,
352
+ "isMandatory": false,
353
353
  "page": "9",
354
354
  "min": 0,
355
355
  "max": 70,
@@ -386,7 +386,7 @@
386
386
  {
387
387
  "id": "k5nvu98z",
388
388
  "componentType": "InputNumber",
389
- "mandatory": false,
389
+ "isMandatory": false,
390
390
  "page": "10",
391
391
  "min": 0,
392
392
  "max": 366,
@@ -423,7 +423,7 @@
423
423
  {
424
424
  "id": "k5nw8ei1",
425
425
  "componentType": "InputNumber",
426
- "mandatory": false,
426
+ "isMandatory": false,
427
427
  "page": "11",
428
428
  "min": 0,
429
429
  "max": 12,
@@ -460,7 +460,7 @@
460
460
  {
461
461
  "id": "k5nw9dk4",
462
462
  "componentType": "InputNumber",
463
- "mandatory": false,
463
+ "isMandatory": false,
464
464
  "page": "12",
465
465
  "min": 0,
466
466
  "max": 100,
@@ -497,7 +497,7 @@
497
497
  {
498
498
  "id": "j6z06z1e",
499
499
  "componentType": "InputNumber",
500
- "mandatory": false,
500
+ "isMandatory": false,
501
501
  "page": "13",
502
502
  "min": 0,
503
503
  "max": 99,
@@ -566,7 +566,7 @@
566
566
  {
567
567
  "id": "j3343clt",
568
568
  "componentType": "Radio",
569
- "mandatory": true,
569
+ "isMandatory": true,
570
570
  "page": "15",
571
571
  "label": {
572
572
  "value": "\"➡ \" || \"In which city do the Simpsons reside?\"",
@@ -616,7 +616,7 @@
616
616
  {
617
617
  "id": "j6qdfhvw",
618
618
  "componentType": "CheckboxOne",
619
- "mandatory": false,
619
+ "isMandatory": false,
620
620
  "page": "16",
621
621
  "label": {
622
622
  "value": "\"➡ \" || \"Who is the Simpsons city mayor?\"",
@@ -670,7 +670,7 @@
670
670
  {
671
671
  "id": "j4nw5cqz",
672
672
  "componentType": "Dropdown",
673
- "mandatory": false,
673
+ "isMandatory": false,
674
674
  "page": "17",
675
675
  "label": {
676
676
  "value": "\"➡ \" || \"In which state do The Simpsons reside?\"",
@@ -811,7 +811,7 @@
811
811
  {
812
812
  "id": "j6p29i81",
813
813
  "componentType": "Table",
814
- "mandatory": false,
814
+ "isMandatory": false,
815
815
  "page": "20",
816
816
  "label": {
817
817
  "value": "\"➡ \" || \"Does Jay like the following ice cream flavours?\"",
@@ -927,7 +927,7 @@
927
927
  {
928
928
  "id": "j6qefnga",
929
929
  "componentType": "Table",
930
- "mandatory": false,
930
+ "isMandatory": false,
931
931
  "page": "21",
932
932
  "label": {
933
933
  "value": "\"➡ \" || \"Which character works in the nuclear power plant?\"",
@@ -1038,7 +1038,7 @@
1038
1038
  {
1039
1039
  "id": "j6yzoc6g",
1040
1040
  "componentType": "Table",
1041
- "mandatory": false,
1041
+ "isMandatory": false,
1042
1042
  "page": "22",
1043
1043
  "label": {
1044
1044
  "value": "\"➡ \" || \"In which city each character was born?\"",
@@ -1291,7 +1291,7 @@
1291
1291
  {
1292
1292
  "id": "j4nwc63q",
1293
1293
  "componentType": "Table",
1294
- "mandatory": false,
1294
+ "isMandatory": false,
1295
1295
  "page": "24",
1296
1296
  "label": {
1297
1297
  "value": "\"➡ \" || \"Please, specify the percentage of Jay’s expenses in the Kwik-E-Mart for each product?\"",
@@ -1473,7 +1473,7 @@
1473
1473
  {
1474
1474
  "id": "k9cg2q5t",
1475
1475
  "componentType": "Table",
1476
- "mandatory": false,
1476
+ "isMandatory": false,
1477
1477
  "page": "25",
1478
1478
  "label": {
1479
1479
  "value": "\"➡ \" || \"Please specify if Jay has bought each product in his last food shopping\"",
@@ -1776,7 +1776,7 @@
1776
1776
  {
1777
1777
  "id": "kbkjvgel",
1778
1778
  "componentType": "Table",
1779
- "mandatory": false,
1779
+ "isMandatory": false,
1780
1780
  "page": "26",
1781
1781
  "label": {
1782
1782
  "value": "\"➡ \" || \"Who did these clownings and tell us what you remember?\"",
@@ -2008,7 +2008,7 @@
2008
2008
  {
2009
2009
  "id": "j6p2lwuj",
2010
2010
  "componentType": "Table",
2011
- "mandatory": false,
2011
+ "isMandatory": false,
2012
2012
  "page": "27",
2013
2013
  "label": {
2014
2014
  "value": "\"➡ \" || \"Which of the following means of transport were used by the hero and in which country?\"",
@@ -2271,7 +2271,7 @@
2271
2271
  {
2272
2272
  "id": "j6qg8rc6",
2273
2273
  "componentType": "Table",
2274
- "mandatory": false,
2274
+ "isMandatory": false,
2275
2275
  "page": "29",
2276
2276
  "label": {
2277
2277
  "value": "\"➡ \" || \"Please, complete the following grid with your favourite characters\"",
@@ -2709,7 +2709,7 @@
2709
2709
  {
2710
2710
  "id": "jvxux0mi",
2711
2711
  "componentType": "Table",
2712
- "mandatory": false,
2712
+ "isMandatory": false,
2713
2713
  "page": "30",
2714
2714
  "label": {
2715
2715
  "value": "\"➡ \" || \"How has your feeling about the following characters evolved over time?\"",
@@ -2839,7 +2839,7 @@
2839
2839
  {
2840
2840
  "id": "jvxwy68n",
2841
2841
  "componentType": "Table",
2842
- "mandatory": false,
2842
+ "isMandatory": false,
2843
2843
  "page": "31",
2844
2844
  "label": {
2845
2845
  "value": "\"➡ \" || \"Can you tell how long Bart Simpson has been on leave for each type and whether there has been another type?\"",
@@ -3067,7 +3067,7 @@
3067
3067
  {
3068
3068
  "id": "kiq612ky",
3069
3069
  "componentType": "InputNumber",
3070
- "mandatory": false,
3070
+ "isMandatory": false,
3071
3071
  "page": "33",
3072
3072
  "min": 0,
3073
3073
  "max": 20,
@@ -3166,7 +3166,7 @@
3166
3166
  {
3167
3167
  "id": "kiq66gtw",
3168
3168
  "componentType": "Input",
3169
- "mandatory": false,
3169
+ "isMandatory": false,
3170
3170
  "page": "34",
3171
3171
  "maxLength": 30,
3172
3172
  "label": {
@@ -3202,7 +3202,7 @@
3202
3202
  {
3203
3203
  "id": "kiq5r8wu",
3204
3204
  "componentType": "InputNumber",
3205
- "mandatory": false,
3205
+ "isMandatory": false,
3206
3206
  "page": "34",
3207
3207
  "min": 0,
3208
3208
  "max": 120,
@@ -3288,7 +3288,7 @@
3288
3288
  {
3289
3289
  "id": "kiq65x3c",
3290
3290
  "componentType": "CheckboxOne",
3291
- "mandatory": false,
3291
+ "isMandatory": false,
3292
3292
  "page": "35.2",
3293
3293
  "label": {
3294
3294
  "value": "\"➡ \" || \"Is character named \" || NAME_CHAR || \" your favourite one ? \"",
@@ -3325,7 +3325,7 @@
3325
3325
  {
3326
3326
  "id": "kiq651zv",
3327
3327
  "componentType": "Textarea",
3328
- "mandatory": false,
3328
+ "isMandatory": false,
3329
3329
  "page": "35.3",
3330
3330
  "maxLength": 255,
3331
3331
  "label": {
@@ -3376,7 +3376,7 @@
3376
3376
  {
3377
3377
  "id": "j6z0z3us",
3378
3378
  "componentType": "Textarea",
3379
- "mandatory": false,
3379
+ "isMandatory": false,
3380
3380
  "page": "37",
3381
3381
  "maxLength": 255,
3382
3382
  "label": {
@@ -3412,7 +3412,7 @@
3412
3412
  {
3413
3413
  "id": "COMMENT-QUESTION",
3414
3414
  "componentType": "Textarea",
3415
- "mandatory": false,
3415
+ "isMandatory": false,
3416
3416
  "page": "39",
3417
3417
  "maxLength": 2000,
3418
3418
  "label": { "value": "\"VIII - \" || \"Comment\"", "type": "VTL|MD" },