@coorpacademy/app-review 0.1.8 → 0.1.10

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 (82) hide show
  1. package/es/actions/api/fetch-skills.d.ts +8 -5
  2. package/es/actions/api/fetch-slide.d.ts +8 -5
  3. package/es/actions/api/post-progression.d.ts +8 -5
  4. package/es/actions/ui/navigation.d.ts +1 -1
  5. package/es/fixtures/qcm-slide.js +1 -1
  6. package/es/helpers/map-api-slide-to-ui.d.ts +8 -0
  7. package/es/helpers/map-api-slide-to-ui.js +175 -0
  8. package/es/helpers/test/fixtures/free-text.d.ts +4 -0
  9. package/es/helpers/test/fixtures/free-text.js +24 -0
  10. package/es/helpers/test/fixtures/qcm-drag.d.ts +4 -0
  11. package/es/helpers/test/fixtures/qcm-drag.js +106 -0
  12. package/es/helpers/test/fixtures/qcm-graphic.d.ts +4 -0
  13. package/es/helpers/test/fixtures/qcm-graphic.js +70 -0
  14. package/es/helpers/test/fixtures/qcm.d.ts +4 -0
  15. package/es/helpers/test/fixtures/qcm.js +99 -0
  16. package/es/helpers/test/fixtures/select-template.d.ts +4 -0
  17. package/es/helpers/test/fixtures/select-template.js +88 -0
  18. package/es/helpers/test/fixtures/slider.d.ts +4 -0
  19. package/es/helpers/test/fixtures/slider.js +27 -0
  20. package/es/helpers/test/fixtures/text-template.d.ts +4 -0
  21. package/es/helpers/test/fixtures/text-template.js +48 -0
  22. package/es/helpers/test/map-api-slide-to-ui.test.d.ts +1 -0
  23. package/es/helpers/test/map-api-slide-to-ui.test.js +32 -0
  24. package/es/index.d.ts +1 -1
  25. package/es/index.js +31 -16
  26. package/es/reducers/ui/navigation.d.ts +1 -1
  27. package/es/test/index.test.js +18 -15
  28. package/es/test/util/services.mock.js +2 -32
  29. package/es/types/common.d.ts +62 -5
  30. package/es/types/slides.d.ts +27 -16
  31. package/lib/actions/api/fetch-skills.d.ts +8 -5
  32. package/lib/actions/api/fetch-slide.d.ts +8 -5
  33. package/lib/actions/api/post-progression.d.ts +8 -5
  34. package/lib/actions/ui/navigation.d.ts +1 -1
  35. package/lib/fixtures/qcm-slide.js +1 -1
  36. package/lib/helpers/map-api-slide-to-ui.d.ts +8 -0
  37. package/lib/helpers/map-api-slide-to-ui.js +181 -0
  38. package/lib/helpers/test/fixtures/free-text.d.ts +4 -0
  39. package/lib/helpers/test/fixtures/free-text.js +24 -0
  40. package/lib/helpers/test/fixtures/qcm-drag.d.ts +4 -0
  41. package/lib/helpers/test/fixtures/qcm-drag.js +106 -0
  42. package/lib/helpers/test/fixtures/qcm-graphic.d.ts +4 -0
  43. package/lib/helpers/test/fixtures/qcm-graphic.js +70 -0
  44. package/lib/helpers/test/fixtures/qcm.d.ts +4 -0
  45. package/lib/helpers/test/fixtures/qcm.js +99 -0
  46. package/lib/helpers/test/fixtures/select-template.d.ts +4 -0
  47. package/lib/helpers/test/fixtures/select-template.js +88 -0
  48. package/lib/helpers/test/fixtures/slider.d.ts +4 -0
  49. package/lib/helpers/test/fixtures/slider.js +27 -0
  50. package/lib/helpers/test/fixtures/text-template.d.ts +4 -0
  51. package/lib/helpers/test/fixtures/text-template.js +48 -0
  52. package/lib/helpers/test/map-api-slide-to-ui.test.d.ts +1 -0
  53. package/lib/helpers/test/map-api-slide-to-ui.test.js +43 -0
  54. package/lib/index.d.ts +1 -1
  55. package/lib/index.js +31 -16
  56. package/lib/reducers/ui/navigation.d.ts +1 -1
  57. package/lib/test/index.test.js +19 -16
  58. package/lib/test/util/services.mock.js +13 -32
  59. package/lib/types/common.d.ts +62 -5
  60. package/lib/types/slides.d.ts +27 -16
  61. package/package.json +3 -3
  62. package/src/actions/api/fetch-skills.ts +8 -4
  63. package/src/actions/api/fetch-slide.ts +8 -4
  64. package/src/actions/api/post-progression.ts +14 -4
  65. package/src/actions/ui/navigation.ts +1 -1
  66. package/src/fixtures/qcm-slide.ts +1 -1
  67. package/src/helpers/map-api-slide-to-ui.ts +253 -0
  68. package/src/helpers/test/fixtures/free-text.ts +28 -0
  69. package/src/helpers/test/fixtures/qcm-drag.ts +110 -0
  70. package/src/helpers/test/fixtures/qcm-graphic.ts +74 -0
  71. package/src/helpers/test/fixtures/qcm.ts +108 -0
  72. package/src/helpers/test/fixtures/select-template.ts +92 -0
  73. package/src/helpers/test/fixtures/slider.ts +31 -0
  74. package/src/helpers/test/fixtures/text-template.ts +52 -0
  75. package/src/helpers/test/map-api-slide-to-ui.test.ts +55 -0
  76. package/src/index.tsx +39 -30
  77. package/src/reducers/ui/navigation.ts +1 -1
  78. package/src/test/index.test.tsx +23 -12
  79. package/src/test/util/services.mock.ts +2 -32
  80. package/src/types/common.ts +74 -5
  81. package/src/types/globals.d.ts +0 -5
  82. package/src/types/slides.ts +29 -12
@@ -0,0 +1,253 @@
1
+ import {
2
+ concat,
3
+ divide,
4
+ get,
5
+ getOr,
6
+ head,
7
+ includes,
8
+ indexOf,
9
+ isEmpty,
10
+ map,
11
+ noop,
12
+ pipe,
13
+ rangeStep,
14
+ size,
15
+ toInteger
16
+ } from 'lodash/fp';
17
+ import {
18
+ AnswerUI,
19
+ FreeText,
20
+ Qcm,
21
+ QcmDrag,
22
+ QcmGraphic,
23
+ QuestionRange,
24
+ SelectionTemplate,
25
+ Template,
26
+ TextTemplate
27
+ } from '../types/slides';
28
+ import {
29
+ ChoiceFromAPI,
30
+ QcmDragQuestion,
31
+ QcmGraphicQuestion,
32
+ QcmQuestion,
33
+ SlideFromAPI,
34
+ SliderQuestion,
35
+ TemplateQuestion
36
+ } from '../types/common';
37
+
38
+ type UiUtils = {translate: (text: string) => string};
39
+
40
+ const qcmProps = (question: QcmQuestion): Qcm => {
41
+ // TODO: EDIT_CHOICES -> getAnswerValues
42
+ const answers: string[] = [];
43
+
44
+ return {
45
+ type: 'qcm',
46
+ answers: map(
47
+ choice => ({
48
+ title: choice.label,
49
+ selected: includes(choice.label, answers),
50
+ // TODO: EDIT_CHOICES
51
+ onClick: noop,
52
+ ariaLabel: choice.label
53
+ }),
54
+ // TODO: EDIT_CHOICES -> getChoices
55
+ question.content.choices
56
+ )
57
+ };
58
+ };
59
+
60
+ const qcmDragProps = (question: QcmDragQuestion): QcmDrag => {
61
+ // mock the answers
62
+ // TODO: EDIT_CHOICES -> getAnswerValues
63
+ const answers: string[] = [];
64
+ return {
65
+ type: 'qcmDrag',
66
+ answers: map(choice => {
67
+ const indexInAnswer = indexOf(choice.label, answers);
68
+ return {
69
+ title: choice.label,
70
+ selected: indexInAnswer !== -1,
71
+ order: indexInAnswer,
72
+ // TODO: EDIT_CHOICES
73
+ onClick: noop
74
+ };
75
+ // TODO: EDIT_CHOICES -> getChoices
76
+ }, question.content.choices)
77
+ };
78
+ };
79
+
80
+ const qcmGraphicProps = (question: QcmGraphicQuestion): QcmGraphic => {
81
+ // mock the answers
82
+ // TODO: EDIT_CHOICES -> getAnswerValues
83
+ const answers: string[] = [];
84
+ return {
85
+ type: 'qcmGraphic',
86
+ answers: map(
87
+ choice => ({
88
+ title: choice.label,
89
+ image: get('media.src.0.url', choice),
90
+ selected: includes(choice.label, answers),
91
+ // TODO: EDIT_CHOICES
92
+ onClick: noop
93
+ }),
94
+ // TODO: EDIT_CHOICES -> getChoices
95
+ question.content.choices
96
+ )
97
+ };
98
+ };
99
+
100
+ const templateTextProps =
101
+ (uiUtils: UiUtils) =>
102
+ (choice: ChoiceFromAPI, index: number): TextTemplate => {
103
+ const {translate} = uiUtils;
104
+ // TODO: EDIT_CHOICES -> getAnswerValues
105
+ const answers: string[] = [];
106
+ return {
107
+ type: 'text',
108
+ name: getOr('', 'name', choice),
109
+ placeholder: translate('Type here'),
110
+ value: get(index, answers),
111
+ // TODO: EDIT_CHOICES
112
+ onChange: noop
113
+ };
114
+ };
115
+
116
+ // const getItemText = (item: ChoiceFromAPI['items'][0]): item['text'] is string =>
117
+
118
+ const templateSelectProps = (uiUtils: UiUtils) => {
119
+ return (choice: ChoiceFromAPI, index: number): SelectionTemplate => {
120
+ const {translate} = uiUtils;
121
+ // TODO: EDIT_CHOICES -> getAnswerValues
122
+ const answers: string[] = [];
123
+ const answer = get(index, answers);
124
+ const temporaryOption = {
125
+ name: translate('Select an answer'),
126
+ value: '',
127
+ validOption: false,
128
+ selected: true
129
+ };
130
+ const selectOptions = choice.items.map(item => {
131
+ const itemText = getOr('', 'text', item);
132
+ return {
133
+ name: itemText,
134
+ value: itemText,
135
+ validOption: true,
136
+ selected: itemText === answer
137
+ };
138
+ });
139
+
140
+ return {
141
+ type: 'select',
142
+ name: getOr('', 'name', choice),
143
+ // TODO: EDIT_CHOICES
144
+ onChange: noop,
145
+ options: isEmpty(answer) ? concat([temporaryOption], selectOptions) : selectOptions
146
+ };
147
+ };
148
+ };
149
+
150
+ const templateProps = (uiUtils: UiUtils): ((question: TemplateQuestion) => Template) => {
151
+ const templateTextProps_ = templateTextProps(uiUtils);
152
+ const templateSelectProps_ = templateSelectProps(uiUtils);
153
+
154
+ return question => {
155
+ // TODO: EDIT_CHOICES -> getChoices
156
+ const choices = question.content.choices;
157
+ return {
158
+ type: 'template',
159
+ template: get('content.template', question),
160
+ answers: choices.map((choice, index) =>
161
+ choice.type === 'text'
162
+ ? templateTextProps_(choice, index)
163
+ : templateSelectProps_(choice, index)
164
+ )
165
+ };
166
+ };
167
+ };
168
+
169
+ const basicProps = (uiUtils: UiUtils): (() => FreeText) => {
170
+ const {translate} = uiUtils;
171
+ // TODO: EDIT_CHOICES -> getAnswerValues
172
+ const answers: string[] = [];
173
+
174
+ return () => {
175
+ return {
176
+ type: 'freeText',
177
+ placeholder: translate('Type here'),
178
+ value: head(answers),
179
+ // TODO: EDIT_CHOICES
180
+ onChange: noop
181
+ };
182
+ };
183
+ };
184
+
185
+ const sliderProps = (question: SliderQuestion): QuestionRange => {
186
+ const values: number[] = rangeStep(
187
+ getOr(1, 'content.step', question),
188
+ getOr(Number.NaN, 'content.min', question),
189
+ getOr(Number.NaN, 'content.max', question) + 1
190
+ // Lodash doesn't infere the type very well here
191
+ ) as unknown as number[];
192
+
193
+ // TODO: EDIT_CHOICES -> getAnswerValues
194
+ const answers: string[] = [];
195
+
196
+ const stateValue = head(answers);
197
+ const currentValue = toInteger(stateValue);
198
+
199
+ const indexValue = indexOf(currentValue, values);
200
+ const sliderPosition = divide(indexValue, size(values) - 1);
201
+
202
+ const unitLabel = get('question.content.unitLabel', question);
203
+
204
+ return {
205
+ type: 'slider',
206
+ placeholder: question.explanation,
207
+ minLabel: `${question.content.min} ${unitLabel}`,
208
+ maxLabel: `${question.content.max} ${unitLabel}`,
209
+ title: `${currentValue} ${question.content.unitLabel}`,
210
+ value: sliderPosition,
211
+ // TODO: EDIT_CHOICES
212
+ onChange: noop
213
+ };
214
+ };
215
+
216
+ export const getQuestionType = (slide: SlideFromAPI): SlideFromAPI['question']['type'] =>
217
+ slide.question.type;
218
+
219
+ export const mapApiSlideToUi = (
220
+ uiUtils: UiUtils
221
+ ): ((slide: SlideFromAPI) => AnswerUI['model'] | void) => {
222
+ const basicProps_ = basicProps(uiUtils);
223
+ const templateProps_ = templateProps(uiUtils);
224
+
225
+ return (slide: SlideFromAPI): AnswerUI['model'] | void => {
226
+ if (!slide) {
227
+ return;
228
+ }
229
+ const type = getQuestionType(slide);
230
+ switch (type) {
231
+ case 'qcm':
232
+ return pipe(get('question'), qcmProps)(slide);
233
+
234
+ case 'qcmGraphic':
235
+ return pipe(get('question'), qcmGraphicProps)(slide);
236
+
237
+ case 'qcmDrag':
238
+ return pipe(get('question'), qcmDragProps)(slide);
239
+
240
+ case 'basic':
241
+ return basicProps_();
242
+
243
+ case 'template':
244
+ return pipe(get('question'), templateProps_)(slide);
245
+
246
+ case 'slider':
247
+ return pipe(get('question'), sliderProps)(slide);
248
+
249
+ default:
250
+ throw new Error(`${type} is not an handled question.type`);
251
+ }
252
+ };
253
+ };
@@ -0,0 +1,28 @@
1
+ import noop from 'lodash/fp/noop';
2
+ import {FreeText} from '../../../types/slides';
3
+ import {SlideFromAPI} from '../../../types/common';
4
+
5
+ export const freeTextSlide: SlideFromAPI = {
6
+ id: 'sli_E1Pcl-XAYbi',
7
+ universalRef: 'sli_E1Pcl-XAYbi',
8
+ question: {
9
+ type: 'basic',
10
+ header: 'sli_E1Pcl-XAYbi.header',
11
+ explanation: 'sli_E1Pcl-XAYbi.explanation',
12
+ content: {
13
+ label: 'sli_E1Pcl-XAYbi.label',
14
+ placeholder: 'sli_E1Pcl-XAYbi.placeholder',
15
+ id: 'sli_E1Pcl-XAYbi.choice_1'
16
+ }
17
+ },
18
+ clue: 'sli_E1Pcl-XAYbi.clue',
19
+ klf: 'sli_E1Pcl-XAYbi.klf',
20
+ tips: 'sli_E1Pcl-XAYbi.tips'
21
+ };
22
+
23
+ export const freeTextUISlide: FreeText = {
24
+ type: 'freeText',
25
+ placeholder: 'Type here',
26
+ value: undefined,
27
+ onChange: noop
28
+ };
@@ -0,0 +1,110 @@
1
+ import noop from 'lodash/fp/noop';
2
+ import {QcmDrag} from '../../../types/slides';
3
+ import {SlideFromAPI} from '../../../types/common';
4
+
5
+ export const qcmDragSlide: SlideFromAPI = {
6
+ id: 'sli_419IlQQnf',
7
+ universalRef: 'sli_419IlQQnf',
8
+ question: {
9
+ type: 'qcmDrag',
10
+ header: 'sli_419IlQQnf.header',
11
+ explanation: 'sli_419IlQQnf.explanation',
12
+ content: {
13
+ choices: [
14
+ {
15
+ media: {
16
+ src: [],
17
+ posters: [],
18
+ subtitles: []
19
+ },
20
+ _id: '62b1ba3ec4f4015504212571',
21
+ label: 'sli_419IlQQnf.choice_4kWwlQXhG',
22
+ value: 'sli_419IlQQnf.choice_4kWwlQXhG',
23
+ items: []
24
+ },
25
+ {
26
+ media: {
27
+ src: [],
28
+ posters: [],
29
+ subtitles: []
30
+ },
31
+ _id: '62b1ba3ec4f4015504212572',
32
+ label: 'sli_419IlQQnf.choice_NJxbwgXm2G',
33
+ value: 'sli_419IlQQnf.choice_NJxbwgXm2G',
34
+ items: []
35
+ },
36
+ {
37
+ media: {
38
+ src: [],
39
+ posters: [],
40
+ subtitles: []
41
+ },
42
+ _id: '62b1ba3ec4f4015504212573',
43
+ label: 'sli_419IlQQnf.choice_41fwgQXnf',
44
+ value: 'sli_419IlQQnf.choice_41fwgQXnf',
45
+ items: []
46
+ },
47
+ {
48
+ media: {
49
+ src: [],
50
+ posters: [],
51
+ subtitles: []
52
+ },
53
+ _id: '62b1ba3ec4f4015504212574',
54
+ label: 'sli_419IlQQnf.choice_VJmweQ7nz',
55
+ value: 'sli_419IlQQnf.choice_VJmweQ7nz',
56
+ items: []
57
+ },
58
+ {
59
+ media: {
60
+ src: [],
61
+ posters: [],
62
+ subtitles: []
63
+ },
64
+ _id: '62b1ba3ec4f4015504212575',
65
+ label: 'sli_419IlQQnf.choice_4kDDgXQhz',
66
+ value: 'sli_419IlQQnf.choice_4kDDgXQhz',
67
+ items: []
68
+ }
69
+ ]
70
+ }
71
+ },
72
+ klf: 'sli_419IlQQnf.klf',
73
+ tips: 'sli_419IlQQnf.tips'
74
+ };
75
+
76
+ export const qcmDragUISlide: QcmDrag = {
77
+ type: 'qcmDrag',
78
+ answers: [
79
+ {
80
+ title: 'sli_419IlQQnf.choice_4kWwlQXhG',
81
+ selected: false,
82
+ order: -1,
83
+ onClick: noop
84
+ },
85
+ {
86
+ title: 'sli_419IlQQnf.choice_NJxbwgXm2G',
87
+ selected: false,
88
+ order: -1,
89
+ onClick: noop
90
+ },
91
+ {
92
+ title: 'sli_419IlQQnf.choice_41fwgQXnf',
93
+ selected: false,
94
+ order: -1,
95
+ onClick: noop
96
+ },
97
+ {
98
+ title: 'sli_419IlQQnf.choice_VJmweQ7nz',
99
+ selected: false,
100
+ order: -1,
101
+ onClick: noop
102
+ },
103
+ {
104
+ title: 'sli_419IlQQnf.choice_4kDDgXQhz',
105
+ selected: false,
106
+ order: -1,
107
+ onClick: noop
108
+ }
109
+ ]
110
+ };
@@ -0,0 +1,74 @@
1
+ import noop from 'lodash/fp/noop';
2
+ import {QcmGraphic} from '../../../types/slides';
3
+ import {SlideFromAPI} from '../../../types/common';
4
+
5
+ export const qcmGraphicSlide: SlideFromAPI = {
6
+ id: 'sli_41~RSVclH',
7
+ universalRef: 'sli_41~RSVclH',
8
+ question: {
9
+ type: 'qcmGraphic',
10
+ header: 'sli_41~RSVclH.header',
11
+ explanation: 'sli_41~RSVclH.explanation',
12
+ content: {
13
+ choices: [
14
+ {
15
+ media: {
16
+ type: 'img',
17
+ src: [
18
+ {
19
+ _id: '5fdce726359bf4003ee66997',
20
+ mimeType: 'image/png',
21
+ url: 'med_4JVRrE5gH.mediaUrl_VkBtUV9gB'
22
+ }
23
+ ],
24
+ posters: [],
25
+ subtitles: []
26
+ },
27
+ _id: '5fdce726359bf4003ee66996',
28
+ label: 'sli_41~RSVclH.choice_V1gN0r4qgS',
29
+ value: 'sli_41~RSVclH.choice_V1gN0r4qgS',
30
+ items: []
31
+ },
32
+ {
33
+ media: {
34
+ type: 'img',
35
+ src: [
36
+ {
37
+ _id: '5fdce726359bf4003ee66999',
38
+ mimeType: 'image/png',
39
+ url: 'med_Ek8gIEqxB.mediaUrl_EkcFUEclH'
40
+ }
41
+ ],
42
+ posters: [],
43
+ subtitles: []
44
+ },
45
+ _id: '5fdce726359bf4003ee66998',
46
+ label: 'sli_41~RSVclH.choice_4JlLeLE5lS',
47
+ value: 'sli_41~RSVclH.choice_4JlLeLE5lS',
48
+ items: []
49
+ }
50
+ ]
51
+ }
52
+ },
53
+ clue: 'sli_41~RSVclH.clue',
54
+ klf: 'sli_41~RSVclH.klf',
55
+ tips: 'sli_41~RSVclH.tips'
56
+ };
57
+
58
+ export const qcmGraphicUISlide: QcmGraphic = {
59
+ type: 'qcmGraphic',
60
+ answers: [
61
+ {
62
+ title: 'sli_41~RSVclH.choice_V1gN0r4qgS',
63
+ image: 'med_4JVRrE5gH.mediaUrl_VkBtUV9gB',
64
+ selected: false,
65
+ onClick: noop
66
+ },
67
+ {
68
+ title: 'sli_41~RSVclH.choice_4JlLeLE5lS',
69
+ image: 'med_Ek8gIEqxB.mediaUrl_EkcFUEclH',
70
+ selected: false,
71
+ onClick: noop
72
+ }
73
+ ]
74
+ };
@@ -0,0 +1,108 @@
1
+ import noop from 'lodash/fp/noop';
2
+ import {Qcm} from '../../../types/slides';
3
+ import {SlideFromAPI} from '../../../types/common';
4
+
5
+ export const qcmSlide: SlideFromAPI = {
6
+ question: {
7
+ content: {
8
+ media: {
9
+ src: [],
10
+ posters: [],
11
+ subtitles: []
12
+ },
13
+ choices: [
14
+ {
15
+ media: {
16
+ src: [],
17
+ posters: [],
18
+ subtitles: []
19
+ },
20
+ items: [],
21
+ _id: '62c853412d0f9b088718e759',
22
+ label: 'Le créateur peut fixer un pourcentage pour chaque transaction future',
23
+ value: 'sli_N1XACJobn.choice_4JjaSesZh',
24
+ id: '62c853412d0f9b088718e759'
25
+ },
26
+ {
27
+ media: {
28
+ src: [],
29
+ posters: [],
30
+ subtitles: []
31
+ },
32
+ items: [],
33
+ _id: '62c853412d0f9b088718e75a',
34
+ label:
35
+ "Pour chaque transaction il existe un pourcentage fixe déterminé par le droit d'auteur du pays où se tient la vente",
36
+ value: 'sli_N1XACJobn.choice_Ny78UlsWh',
37
+ id: '62c853412d0f9b088718e75a'
38
+ },
39
+ {
40
+ media: {
41
+ src: [],
42
+ posters: [],
43
+ subtitles: []
44
+ },
45
+ items: [],
46
+ _id: '62c853412d0f9b088718e75b',
47
+ label:
48
+ "Seule la galerie ou la plateforme peut toucher une commission sur la vente d'un NFT",
49
+ value: 'sli_N1XACJobn.choice_Eypt8esW2',
50
+ id: '62c853412d0f9b088718e75b'
51
+ },
52
+ {
53
+ media: {
54
+ src: [],
55
+ posters: [],
56
+ subtitles: []
57
+ },
58
+ items: [],
59
+ _id: '62c853412d0f9b088718e75c',
60
+ label: "Les NFT payés en ETH ne peuvent pas être soumis au paiement d'une commission",
61
+ value: 'sli_N1XACJobn.choice_VyS3LxjZh',
62
+ id: '62c853412d0f9b088718e75c'
63
+ }
64
+ ]
65
+ },
66
+ type: 'qcm',
67
+ header: "Après la vente d'un NFT, son créateur peut-il toucher de l'argent ?",
68
+ explanation: 'Sélectionnez la bonne réponse.'
69
+ },
70
+ klf: 'Si vous êtes le créateur d’un NFT, vous pouvez choisir le pourcentage de commission pour chaque transaction de votre NFT. Certains choisissent de ne rien toucher pour fluidifier le marché.',
71
+ tips: 'En 2021, le média en ligne Numerama a créé un NFT vendu aux enchères sur OpenSea. Sur cette plateforme, il est obligatoire de mettre un prix de réserve, autrement dit un prix minimum au-dessous duquel la vente ne sera pas automatiquement acceptée. Sur OpenSea il ne peut être inférieur à 1 ETH. Si le prix de réserve est atteint, pas de problème, les "gas fees" (les frais de gaz) sont couverts par OpenSea. Mais, si ce n’est pas le cas, c’est au vendeur de s’en acquitter. <br/>Le NFT en question est parti à 0,021 ETH, soit 40€ au cours de l\'époque, un prix inférieur au prix de réserve. Numerama a dû acquitter des frais de gaz, et payer 190 €. <br/>Avec les NFT, on ne gagne pas à tous les coups.',
72
+ universalRef: 'sli_N1XACJobn',
73
+ hasClue: true,
74
+ id: 'sli_N1XACJobn'
75
+ };
76
+
77
+ export const qcmUISlide: Qcm = {
78
+ type: 'qcm',
79
+ answers: [
80
+ {
81
+ title: 'Le créateur peut fixer un pourcentage pour chaque transaction future',
82
+ selected: false,
83
+ onClick: noop,
84
+ ariaLabel: 'Le créateur peut fixer un pourcentage pour chaque transaction future'
85
+ },
86
+ {
87
+ title:
88
+ "Pour chaque transaction il existe un pourcentage fixe déterminé par le droit d'auteur du pays où se tient la vente",
89
+ selected: false,
90
+ onClick: noop,
91
+ ariaLabel:
92
+ "Pour chaque transaction il existe un pourcentage fixe déterminé par le droit d'auteur du pays où se tient la vente"
93
+ },
94
+ {
95
+ title: "Seule la galerie ou la plateforme peut toucher une commission sur la vente d'un NFT",
96
+ selected: false,
97
+ onClick: noop,
98
+ ariaLabel:
99
+ "Seule la galerie ou la plateforme peut toucher une commission sur la vente d'un NFT"
100
+ },
101
+ {
102
+ title: "Les NFT payés en ETH ne peuvent pas être soumis au paiement d'une commission",
103
+ selected: false,
104
+ onClick: noop,
105
+ ariaLabel: "Les NFT payés en ETH ne peuvent pas être soumis au paiement d'une commission"
106
+ }
107
+ ]
108
+ };
@@ -0,0 +1,92 @@
1
+ import noop from 'lodash/fp/noop';
2
+ import {Template} from '../../../types/slides';
3
+ import {SlideFromAPI} from '../../../types/common';
4
+
5
+ export const selectTemplateSlide: SlideFromAPI = {
6
+ id: 'sli_410xZQxrZ',
7
+ universalRef: 'sli_410xZQxrZ',
8
+ question: {
9
+ type: 'template',
10
+ header: 'sli_410xZQxrZ.header',
11
+ explanation: 'sli_410xZQxrZ.explanation',
12
+ content: {
13
+ template: 'sli_410xZQxrZ.template',
14
+ choices: [
15
+ {
16
+ media: {
17
+ src: [],
18
+ posters: [],
19
+ subtitles: []
20
+ },
21
+ _id: '5fdce726359bf4003ee66967',
22
+ type: 'select',
23
+ name: 'sel36665',
24
+ items: [
25
+ {
26
+ _id: '5fdce726359bf4003ee66968',
27
+ text: 'sli_410xZQxrZ.choice_4yeA4Z7lr~',
28
+ value: 'sli_410xZQxrZ.choice_4yeA4Z7lr~'
29
+ },
30
+ {
31
+ _id: '5fdce726359bf4003ee66969',
32
+ text: 'sli_410xZQxrZ.choice_VJWCN~mgB~',
33
+ value: 'sli_410xZQxrZ.choice_VJWCN~mgB~'
34
+ },
35
+ {
36
+ _id: '5fdce726359bf4003ee6696a',
37
+ text: 'sli_410xZQxrZ.choice_VkaH~XgBb',
38
+ value: 'sli_410xZQxrZ.choice_VkaH~XgBb'
39
+ },
40
+ {
41
+ _id: '5fdce726359bf4003ee6696b',
42
+ text: 'sli_410xZQxrZ.choice_E1uUWXeBb',
43
+ value: 'sli_410xZQxrZ.choice_E1uUWXeBb'
44
+ }
45
+ ]
46
+ }
47
+ ]
48
+ }
49
+ },
50
+ clue: 'sli_410xZQxrZ.clue',
51
+ klf: 'sli_410xZQxrZ.klf',
52
+ tips: 'sli_410xZQxrZ.tips'
53
+ };
54
+
55
+ export const selectTemplateUISlide: Template = {
56
+ type: 'template',
57
+ template: 'sli_410xZQxrZ.template',
58
+ answers: [
59
+ {
60
+ type: 'select',
61
+ name: 'sel36665',
62
+ onChange: noop,
63
+ options: [
64
+ {name: 'Select an answer', value: '', validOption: false, selected: true},
65
+ {
66
+ name: 'sli_410xZQxrZ.choice_4yeA4Z7lr~',
67
+ value: 'sli_410xZQxrZ.choice_4yeA4Z7lr~',
68
+ validOption: true,
69
+ selected: false
70
+ },
71
+ {
72
+ name: 'sli_410xZQxrZ.choice_VJWCN~mgB~',
73
+ value: 'sli_410xZQxrZ.choice_VJWCN~mgB~',
74
+ validOption: true,
75
+ selected: false
76
+ },
77
+ {
78
+ name: 'sli_410xZQxrZ.choice_VkaH~XgBb',
79
+ value: 'sli_410xZQxrZ.choice_VkaH~XgBb',
80
+ validOption: true,
81
+ selected: false
82
+ },
83
+ {
84
+ name: 'sli_410xZQxrZ.choice_E1uUWXeBb',
85
+ value: 'sli_410xZQxrZ.choice_E1uUWXeBb',
86
+ validOption: true,
87
+ selected: false
88
+ }
89
+ ]
90
+ }
91
+ ]
92
+ };
@@ -0,0 +1,31 @@
1
+ import noop from 'lodash/fp/noop';
2
+ import {QuestionRange} from '../../../types/slides';
3
+ import {SlideFromAPI} from '../../../types/common';
4
+
5
+ export const sliderSlide: SlideFromAPI = {
6
+ id: 'sli_41D5AovN~',
7
+ universalRef: 'sli_41D5AovN~',
8
+ question: {
9
+ type: 'slider',
10
+ header: 'sli_41D5AovN~.header',
11
+ explanation: 'sli_41D5AovN~.explanation',
12
+ content: {
13
+ min: 1,
14
+ max: 10,
15
+ unitLabel: 'sli_41D5AovN~.unitLabel'
16
+ }
17
+ },
18
+ clue: 'sli_41D5AovN~.clue',
19
+ klf: 'sli_41D5AovN~.klf',
20
+ tips: 'sli_41D5AovN~.tips'
21
+ };
22
+
23
+ export const sliderUISlide: QuestionRange = {
24
+ type: 'slider',
25
+ placeholder: 'sli_41D5AovN~.explanation',
26
+ minLabel: '1 undefined',
27
+ maxLabel: '10 undefined',
28
+ title: '0 sli_41D5AovN~.unitLabel',
29
+ value: -0.1111111111111111,
30
+ onChange: noop
31
+ };