@coorpacademy/app-review 0.1.15 → 0.1.16
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/es/actions/api/fetch-skills.d.ts +4 -6
- package/es/actions/api/fetch-skills.js +7 -4
- package/es/actions/api/fetch-slide.d.ts +14 -7
- package/es/actions/api/fetch-slide.js +22 -19
- package/es/actions/api/post-progression.d.ts +4 -6
- package/es/actions/api/post-progression.js +13 -8
- package/es/actions/api/test/create-test-store.d.ts +5 -0
- package/es/actions/api/test/create-test-store.js +16 -0
- package/es/actions/api/test/fetch-skills.test.js +54 -0
- package/es/actions/api/test/fetch-slide.test.js +61 -0
- package/es/actions/api/test/post-progression.test.d.ts +1 -0
- package/es/actions/api/test/post-progression.test.js +102 -0
- package/es/actions/ui/answers.d.ts +7 -0
- package/es/actions/ui/answers.js +7 -0
- package/es/fixtures/temp-fixture.d.ts +1 -1
- package/es/index.js +10 -16
- package/es/reducers/data/index.d.ts +1 -1
- package/es/reducers/data/slides.d.ts +2 -2
- package/es/reducers/data/slides.js +5 -1
- package/es/reducers/data/test/progression.test.d.ts +1 -0
- package/es/reducers/data/test/progression.test.js +38 -0
- package/es/reducers/data/test/skills.test.d.ts +1 -0
- package/es/reducers/data/test/skills.test.js +12 -0
- package/es/reducers/data/test/slides.test.d.ts +1 -0
- package/es/reducers/data/test/slides.test.js +20 -0
- package/es/reducers/data/test/token.test.d.ts +1 -0
- package/es/reducers/data/test/token.test.js +11 -0
- package/es/reducers/index.d.ts +2 -2
- package/es/reducers/ui/answers.d.ts +4 -0
- package/es/reducers/ui/answers.js +13 -0
- package/es/reducers/ui/index.d.ts +4 -4
- package/es/reducers/ui/index.js +2 -2
- package/es/reducers/ui/test/answers.test.d.ts +1 -0
- package/es/reducers/ui/test/answers.test.js +11 -0
- package/es/reducers/ui/test/current-slide-ref.test.d.ts +1 -0
- package/es/reducers/ui/test/current-slide-ref.test.js +12 -0
- package/es/reducers/ui/test/navigation.test.d.ts +1 -0
- package/es/reducers/ui/test/navigation.test.js +15 -0
- package/es/services/fetch-slide.js +1 -1
- package/es/services/index.js +3 -1
- package/es/services/post-answer.d.ts +2 -0
- package/es/services/post-answer.js +18 -0
- package/es/services/test/fetch-slide.test.d.ts +1 -0
- package/es/services/test/fetch-slide.test.js +22 -0
- package/es/services/test/post-answer.test.d.ts +1 -0
- package/es/services/test/post-answer.test.js +57 -0
- package/es/services/test/post-progression.test.js +9 -1
- package/es/test/util/services.mock.js +37 -7
- package/es/types/common.d.ts +22 -8
- package/es/views/slides/index.d.ts +78 -2
- package/es/views/slides/index.js +70 -4
- package/es/views/slides/map-api-slide-to-ui.d.ts +8 -0
- package/es/views/slides/map-api-slide-to-ui.js +172 -0
- package/{lib/helpers → es/views/slides}/test/fixtures/free-text.d.ts +1 -1
- package/es/views/slides/test/fixtures/free-text.js +38 -0
- package/es/{helpers → views/slides}/test/fixtures/qcm-drag.d.ts +1 -1
- package/es/views/slides/test/fixtures/qcm-drag.js +108 -0
- package/es/{helpers → views/slides}/test/fixtures/qcm-graphic.d.ts +1 -1
- package/es/views/slides/test/fixtures/qcm-graphic.js +88 -0
- package/es/{helpers → views/slides}/test/fixtures/qcm.d.ts +1 -1
- package/es/{helpers → views/slides}/test/fixtures/qcm.js +5 -1
- package/es/{helpers → views/slides}/test/fixtures/select-template.d.ts +1 -1
- package/es/views/slides/test/fixtures/select-template.js +92 -0
- package/es/{helpers → views/slides}/test/fixtures/slider.d.ts +1 -1
- package/es/views/slides/test/fixtures/slider.js +36 -0
- package/es/{helpers → views/slides}/test/fixtures/text-template.d.ts +1 -1
- package/es/{helpers → views/slides}/test/fixtures/text-template.js +5 -1
- package/es/views/slides/test/map-api-slide-to-ui.test.d.ts +1 -0
- package/es/{helpers → views/slides}/test/map-api-slide-to-ui.test.js +19 -9
- package/lib/actions/api/fetch-skills.d.ts +4 -6
- package/lib/actions/api/fetch-skills.js +55 -7
- package/lib/actions/api/fetch-slide.d.ts +14 -7
- package/lib/actions/api/fetch-slide.js +70 -20
- package/lib/actions/api/post-progression.d.ts +4 -6
- package/lib/actions/api/post-progression.js +63 -9
- package/lib/actions/api/test/create-test-store.d.ts +5 -0
- package/lib/actions/api/test/create-test-store.js +18 -0
- package/lib/actions/api/test/fetch-skills.test.d.ts +1 -0
- package/lib/actions/api/test/fetch-skills.test.js +113 -0
- package/lib/actions/api/test/fetch-slide.test.d.ts +1 -0
- package/lib/actions/api/test/fetch-slide.test.js +120 -0
- package/lib/actions/api/test/post-progression.test.d.ts +1 -0
- package/lib/actions/api/test/post-progression.test.js +160 -0
- package/lib/actions/ui/answers.d.ts +7 -0
- package/lib/actions/ui/answers.js +9 -0
- package/lib/fixtures/temp-fixture.d.ts +1 -1
- package/lib/index.js +21 -18
- package/lib/reducers/data/index.d.ts +1 -1
- package/lib/reducers/data/slides.d.ts +2 -2
- package/lib/reducers/data/slides.js +5 -1
- package/lib/reducers/data/test/progression.test.d.ts +1 -0
- package/lib/reducers/data/test/progression.test.js +38 -0
- package/lib/reducers/data/test/skills.test.d.ts +1 -0
- package/lib/reducers/data/test/skills.test.js +12 -0
- package/lib/reducers/data/test/slides.test.d.ts +1 -0
- package/lib/reducers/data/test/slides.test.js +20 -0
- package/lib/reducers/data/test/token.test.d.ts +1 -0
- package/lib/reducers/data/test/token.test.js +11 -0
- package/lib/reducers/index.d.ts +2 -2
- package/lib/reducers/ui/answers.d.ts +4 -0
- package/lib/reducers/ui/answers.js +14 -0
- package/lib/reducers/ui/index.d.ts +4 -4
- package/lib/reducers/ui/index.js +2 -2
- package/lib/reducers/ui/test/answers.test.d.ts +1 -0
- package/lib/reducers/ui/test/answers.test.js +11 -0
- package/lib/reducers/ui/test/current-slide-ref.test.d.ts +1 -0
- package/lib/reducers/ui/test/current-slide-ref.test.js +12 -0
- package/lib/reducers/ui/test/navigation.test.d.ts +1 -0
- package/lib/reducers/ui/test/navigation.test.js +15 -0
- package/lib/services/fetch-slide.js +1 -1
- package/lib/services/index.js +3 -1
- package/lib/services/post-answer.d.ts +2 -0
- package/lib/services/post-answer.js +62 -0
- package/lib/services/test/fetch-slide.test.d.ts +1 -0
- package/lib/services/test/fetch-slide.test.js +76 -0
- package/lib/services/test/post-answer.test.d.ts +1 -0
- package/lib/services/test/post-answer.test.js +111 -0
- package/lib/services/test/post-progression.test.js +9 -1
- package/lib/test/util/services.mock.js +37 -7
- package/lib/types/common.d.ts +22 -8
- package/lib/views/slides/index.d.ts +78 -2
- package/lib/views/slides/index.js +70 -4
- package/lib/views/slides/map-api-slide-to-ui.d.ts +8 -0
- package/lib/views/slides/map-api-slide-to-ui.js +178 -0
- package/{es/helpers → lib/views/slides}/test/fixtures/free-text.d.ts +1 -1
- package/lib/views/slides/test/fixtures/free-text.js +38 -0
- package/lib/{helpers → views/slides}/test/fixtures/qcm-drag.d.ts +1 -1
- package/lib/views/slides/test/fixtures/qcm-drag.js +108 -0
- package/lib/{helpers → views/slides}/test/fixtures/qcm-graphic.d.ts +1 -1
- package/lib/views/slides/test/fixtures/qcm-graphic.js +88 -0
- package/lib/{helpers → views/slides}/test/fixtures/qcm.d.ts +1 -1
- package/lib/{helpers → views/slides}/test/fixtures/qcm.js +5 -1
- package/lib/{helpers → views/slides}/test/fixtures/select-template.d.ts +1 -1
- package/lib/views/slides/test/fixtures/select-template.js +92 -0
- package/lib/{helpers → views/slides}/test/fixtures/slider.d.ts +1 -1
- package/lib/views/slides/test/fixtures/slider.js +36 -0
- package/lib/{helpers → views/slides}/test/fixtures/text-template.d.ts +1 -1
- package/lib/{helpers → views/slides}/test/fixtures/text-template.js +5 -1
- package/lib/views/slides/test/map-api-slide-to-ui.test.d.ts +1 -0
- package/lib/{helpers → views/slides}/test/map-api-slide-to-ui.test.js +19 -9
- package/package.json +3 -3
- package/src/actions/api/fetch-skills.ts +12 -12
- package/src/actions/api/fetch-slide.ts +33 -29
- package/src/actions/api/post-progression.ts +18 -21
- package/src/actions/api/test/create-test-store.ts +25 -0
- package/src/actions/api/test/fetch-skills.test.ts +70 -0
- package/src/actions/api/test/fetch-slide.test.ts +77 -0
- package/src/actions/api/test/post-progression.test.ts +119 -0
- package/src/actions/ui/answers.ts +16 -0
- package/src/fixtures/temp-fixture.ts +1 -1
- package/src/index.tsx +14 -29
- package/src/reducers/data/index.ts +1 -1
- package/src/reducers/data/slides.ts +11 -2
- package/src/reducers/data/test/progression.test.ts +42 -0
- package/src/reducers/data/test/skills.test.ts +14 -0
- package/src/reducers/data/test/slides.test.ts +26 -0
- package/src/reducers/data/test/token.test.ts +13 -0
- package/src/reducers/ui/answers.ts +19 -0
- package/src/reducers/ui/index.ts +3 -3
- package/src/reducers/ui/test/answers.test.ts +13 -0
- package/src/reducers/ui/test/current-slide-ref.test.ts +14 -0
- package/src/reducers/ui/test/navigation.test.ts +19 -0
- package/src/services/fetch-slide.ts +1 -1
- package/src/services/index.ts +3 -1
- package/src/services/post-answer.ts +27 -0
- package/src/services/test/fetch-slide.test.ts +30 -0
- package/src/services/test/post-answer.test.ts +68 -0
- package/src/services/test/post-progression.test.ts +9 -1
- package/src/test/util/services.mock.ts +37 -7
- package/src/types/common.ts +34 -14
- package/src/views/slides/index.ts +164 -5
- package/src/views/slides/map-api-slide-to-ui.ts +251 -0
- package/src/views/slides/test/fixtures/free-text.ts +43 -0
- package/src/views/slides/test/fixtures/qcm-drag.ts +111 -0
- package/src/views/slides/test/fixtures/qcm-graphic.ts +94 -0
- package/src/{helpers → views/slides}/test/fixtures/qcm.ts +6 -2
- package/src/views/slides/test/fixtures/select-template.ts +98 -0
- package/src/views/slides/test/fixtures/slider.ts +41 -0
- package/src/{helpers → views/slides}/test/fixtures/text-template.ts +6 -2
- package/src/{helpers → views/slides}/test/map-api-slide-to-ui.test.ts +21 -10
- package/es/helpers/map-api-slide-to-ui.d.ts +0 -11
- package/es/helpers/map-api-slide-to-ui.js +0 -193
- package/es/helpers/test/fixtures/free-text.js +0 -30
- package/es/helpers/test/fixtures/qcm-drag.js +0 -112
- package/es/helpers/test/fixtures/qcm-graphic.js +0 -76
- package/es/helpers/test/fixtures/select-template.js +0 -94
- package/es/helpers/test/fixtures/slider.js +0 -33
- package/es/reducers/ui/slides.d.ts +0 -9
- package/es/reducers/ui/slides.js +0 -42
- package/es/types/views/slides.d.ts +0 -74
- package/es/types/views/slides.js +0 -6
- package/lib/helpers/map-api-slide-to-ui.d.ts +0 -11
- package/lib/helpers/map-api-slide-to-ui.js +0 -201
- package/lib/helpers/test/fixtures/free-text.js +0 -30
- package/lib/helpers/test/fixtures/qcm-drag.js +0 -112
- package/lib/helpers/test/fixtures/qcm-graphic.js +0 -76
- package/lib/helpers/test/fixtures/select-template.js +0 -94
- package/lib/helpers/test/fixtures/slider.js +0 -33
- package/lib/reducers/ui/slides.d.ts +0 -9
- package/lib/reducers/ui/slides.js +0 -43
- package/lib/types/views/slides.d.ts +0 -74
- package/lib/types/views/slides.js +0 -6
- package/src/helpers/map-api-slide-to-ui.ts +0 -279
- package/src/helpers/test/fixtures/free-text.ts +0 -33
- package/src/helpers/test/fixtures/qcm-drag.ts +0 -115
- package/src/helpers/test/fixtures/qcm-graphic.ts +0 -79
- package/src/helpers/test/fixtures/select-template.ts +0 -97
- package/src/helpers/test/fixtures/slider.ts +0 -36
- package/src/reducers/ui/slides.ts +0 -58
- package/src/types/views/slides.ts +0 -90
- /package/es/{helpers/test/map-api-slide-to-ui.test.d.ts → actions/api/test/fetch-skills.test.d.ts} +0 -0
- /package/{lib/helpers/test/map-api-slide-to-ui.test.d.ts → es/actions/api/test/fetch-slide.test.d.ts} +0 -0
|
@@ -1,76 +0,0 @@
|
|
|
1
|
-
import noop from 'lodash/fp/noop';
|
|
2
|
-
export var qcmGraphicSlide = {
|
|
3
|
-
id: 'sli_41~RSVclH',
|
|
4
|
-
universalRef: 'sli_41~RSVclH',
|
|
5
|
-
question: {
|
|
6
|
-
type: 'qcmGraphic',
|
|
7
|
-
header: 'sli_41~RSVclH.header',
|
|
8
|
-
explanation: 'sli_41~RSVclH.explanation',
|
|
9
|
-
content: {
|
|
10
|
-
choices: [
|
|
11
|
-
{
|
|
12
|
-
media: {
|
|
13
|
-
type: 'img',
|
|
14
|
-
src: [
|
|
15
|
-
{
|
|
16
|
-
_id: '5fdce726359bf4003ee66997',
|
|
17
|
-
mimeType: 'image/png',
|
|
18
|
-
url: 'med_4JVRrE5gH.mediaUrl_VkBtUV9gB'
|
|
19
|
-
}
|
|
20
|
-
],
|
|
21
|
-
posters: [],
|
|
22
|
-
subtitles: []
|
|
23
|
-
},
|
|
24
|
-
_id: '5fdce726359bf4003ee66996',
|
|
25
|
-
label: 'sli_41~RSVclH.choice_V1gN0r4qgS',
|
|
26
|
-
value: 'sli_41~RSVclH.choice_V1gN0r4qgS',
|
|
27
|
-
items: []
|
|
28
|
-
},
|
|
29
|
-
{
|
|
30
|
-
media: {
|
|
31
|
-
type: 'img',
|
|
32
|
-
src: [
|
|
33
|
-
{
|
|
34
|
-
_id: '5fdce726359bf4003ee66999',
|
|
35
|
-
mimeType: 'image/png',
|
|
36
|
-
url: 'med_Ek8gIEqxB.mediaUrl_EkcFUEclH'
|
|
37
|
-
}
|
|
38
|
-
],
|
|
39
|
-
posters: [],
|
|
40
|
-
subtitles: []
|
|
41
|
-
},
|
|
42
|
-
_id: '5fdce726359bf4003ee66998',
|
|
43
|
-
label: 'sli_41~RSVclH.choice_4JlLeLE5lS',
|
|
44
|
-
value: 'sli_41~RSVclH.choice_4JlLeLE5lS',
|
|
45
|
-
items: []
|
|
46
|
-
}
|
|
47
|
-
]
|
|
48
|
-
}
|
|
49
|
-
},
|
|
50
|
-
clue: 'sli_41~RSVclH.clue',
|
|
51
|
-
klf: 'sli_41~RSVclH.klf',
|
|
52
|
-
tips: 'sli_41~RSVclH.tips'
|
|
53
|
-
};
|
|
54
|
-
export var qcmGraphicUISlide = {
|
|
55
|
-
questionText: 'sli_41~RSVclH.header',
|
|
56
|
-
answerUI: {
|
|
57
|
-
help: 'sli_41~RSVclH.explanation',
|
|
58
|
-
model: {
|
|
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
|
-
}
|
|
75
|
-
}
|
|
76
|
-
};
|
|
@@ -1,94 +0,0 @@
|
|
|
1
|
-
import noop from 'lodash/fp/noop';
|
|
2
|
-
export var selectTemplateSlide = {
|
|
3
|
-
id: 'sli_410xZQxrZ',
|
|
4
|
-
universalRef: 'sli_410xZQxrZ',
|
|
5
|
-
question: {
|
|
6
|
-
type: 'template',
|
|
7
|
-
header: 'sli_410xZQxrZ.header',
|
|
8
|
-
explanation: 'sli_410xZQxrZ.explanation',
|
|
9
|
-
content: {
|
|
10
|
-
template: 'sli_410xZQxrZ.template',
|
|
11
|
-
choices: [
|
|
12
|
-
{
|
|
13
|
-
media: {
|
|
14
|
-
src: [],
|
|
15
|
-
posters: [],
|
|
16
|
-
subtitles: []
|
|
17
|
-
},
|
|
18
|
-
_id: '5fdce726359bf4003ee66967',
|
|
19
|
-
type: 'select',
|
|
20
|
-
name: 'sel36665',
|
|
21
|
-
items: [
|
|
22
|
-
{
|
|
23
|
-
_id: '5fdce726359bf4003ee66968',
|
|
24
|
-
text: 'sli_410xZQxrZ.choice_4yeA4Z7lr~',
|
|
25
|
-
value: 'sli_410xZQxrZ.choice_4yeA4Z7lr~'
|
|
26
|
-
},
|
|
27
|
-
{
|
|
28
|
-
_id: '5fdce726359bf4003ee66969',
|
|
29
|
-
text: 'sli_410xZQxrZ.choice_VJWCN~mgB~',
|
|
30
|
-
value: 'sli_410xZQxrZ.choice_VJWCN~mgB~'
|
|
31
|
-
},
|
|
32
|
-
{
|
|
33
|
-
_id: '5fdce726359bf4003ee6696a',
|
|
34
|
-
text: 'sli_410xZQxrZ.choice_VkaH~XgBb',
|
|
35
|
-
value: 'sli_410xZQxrZ.choice_VkaH~XgBb'
|
|
36
|
-
},
|
|
37
|
-
{
|
|
38
|
-
_id: '5fdce726359bf4003ee6696b',
|
|
39
|
-
text: 'sli_410xZQxrZ.choice_E1uUWXeBb',
|
|
40
|
-
value: 'sli_410xZQxrZ.choice_E1uUWXeBb'
|
|
41
|
-
}
|
|
42
|
-
]
|
|
43
|
-
}
|
|
44
|
-
]
|
|
45
|
-
}
|
|
46
|
-
},
|
|
47
|
-
clue: 'sli_410xZQxrZ.clue',
|
|
48
|
-
klf: 'sli_410xZQxrZ.klf',
|
|
49
|
-
tips: 'sli_410xZQxrZ.tips'
|
|
50
|
-
};
|
|
51
|
-
export var selectTemplateUISlide = {
|
|
52
|
-
questionText: 'sli_410xZQxrZ.header',
|
|
53
|
-
answerUI: {
|
|
54
|
-
help: 'sli_410xZQxrZ.explanation',
|
|
55
|
-
model: {
|
|
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
|
-
}
|
|
93
|
-
}
|
|
94
|
-
};
|
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
import noop from 'lodash/fp/noop';
|
|
2
|
-
export var sliderSlide = {
|
|
3
|
-
id: 'sli_41D5AovN~',
|
|
4
|
-
universalRef: 'sli_41D5AovN~',
|
|
5
|
-
question: {
|
|
6
|
-
type: 'slider',
|
|
7
|
-
header: 'sli_41D5AovN~.header',
|
|
8
|
-
explanation: 'sli_41D5AovN~.explanation',
|
|
9
|
-
content: {
|
|
10
|
-
min: 1,
|
|
11
|
-
max: 10,
|
|
12
|
-
unitLabel: 'sli_41D5AovN~.unitLabel'
|
|
13
|
-
}
|
|
14
|
-
},
|
|
15
|
-
clue: 'sli_41D5AovN~.clue',
|
|
16
|
-
klf: 'sli_41D5AovN~.klf',
|
|
17
|
-
tips: 'sli_41D5AovN~.tips'
|
|
18
|
-
};
|
|
19
|
-
export var sliderUISlide = {
|
|
20
|
-
questionText: 'sli_41D5AovN~.header',
|
|
21
|
-
answerUI: {
|
|
22
|
-
help: 'sli_41D5AovN~.explanation',
|
|
23
|
-
model: {
|
|
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
|
-
}
|
|
32
|
-
}
|
|
33
|
-
};
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import type { UISlide } from '../../types/common';
|
|
2
|
-
import { SlideIndexes } from '../../common';
|
|
3
|
-
import { UISlidesAction } from '../../actions/ui/slides';
|
|
4
|
-
export declare type UISlidesState = {
|
|
5
|
-
[key in SlideIndexes]: UISlide;
|
|
6
|
-
};
|
|
7
|
-
export declare const initialState: UISlidesState;
|
|
8
|
-
declare const reducer: (state: UISlidesState | undefined, action: UISlidesAction) => UISlidesState;
|
|
9
|
-
export default reducer;
|
|
@@ -1,43 +0,0 @@
|
|
|
1
|
-
import pipe from 'lodash/fp/pipe';
|
|
2
|
-
import set from 'lodash/fp/set';
|
|
3
|
-
import { mapApiSlideToUi } from '../../helpers/map-api-slide-to-ui';
|
|
4
|
-
import { SET_CURRENT_SLIDE } from '../../actions/ui/slides';
|
|
5
|
-
export var initialState = {
|
|
6
|
-
'0': {
|
|
7
|
-
hidden: false,
|
|
8
|
-
position: 0
|
|
9
|
-
},
|
|
10
|
-
'1': {
|
|
11
|
-
hidden: false,
|
|
12
|
-
position: 1
|
|
13
|
-
},
|
|
14
|
-
'2': {
|
|
15
|
-
hidden: false,
|
|
16
|
-
position: 2
|
|
17
|
-
},
|
|
18
|
-
'3': {
|
|
19
|
-
hidden: false,
|
|
20
|
-
position: 3
|
|
21
|
-
},
|
|
22
|
-
'4': {
|
|
23
|
-
hidden: false,
|
|
24
|
-
position: 4
|
|
25
|
-
}
|
|
26
|
-
};
|
|
27
|
-
var setFirstSlide = function (state, slideFromAPI) {
|
|
28
|
-
var _a = mapApiSlideToUi({ translate: function (text) { return text; } })(slideFromAPI), questionText = _a.questionText, answerUI = _a.answerUI;
|
|
29
|
-
return pipe(set(['0', 'questionText'], questionText), set(['0', 'answerUI'], answerUI), set(['0', 'parentContentTitle'], 'Parent Title') // TODO parentContentTitle + translate
|
|
30
|
-
)(state);
|
|
31
|
-
};
|
|
32
|
-
// eslint-disable-next-line default-param-last
|
|
33
|
-
var reducer = function (state, action) {
|
|
34
|
-
if (state === void 0) { state = initialState; }
|
|
35
|
-
switch (action.type) {
|
|
36
|
-
case SET_CURRENT_SLIDE: {
|
|
37
|
-
return setFirstSlide(state, action.payload);
|
|
38
|
-
}
|
|
39
|
-
default:
|
|
40
|
-
return state;
|
|
41
|
-
}
|
|
42
|
-
};
|
|
43
|
-
export default reducer;
|
|
@@ -1,74 +0,0 @@
|
|
|
1
|
-
import type { StoreState } from '../../reducers';
|
|
2
|
-
import { Dispatchers } from '../../actions';
|
|
3
|
-
declare const ICON_VALUES: {
|
|
4
|
-
readonly right: "right";
|
|
5
|
-
readonly wrong: "wrong";
|
|
6
|
-
readonly 'no-answer': "no-answer";
|
|
7
|
-
};
|
|
8
|
-
declare type IconValue = keyof typeof ICON_VALUES;
|
|
9
|
-
declare type StepItem = {
|
|
10
|
-
current: boolean;
|
|
11
|
-
icon: IconValue;
|
|
12
|
-
value: string;
|
|
13
|
-
};
|
|
14
|
-
declare type CorrectionPopinProps = {
|
|
15
|
-
klf: {
|
|
16
|
-
label: string;
|
|
17
|
-
onClick: Function;
|
|
18
|
-
tooltip: string;
|
|
19
|
-
};
|
|
20
|
-
information: {
|
|
21
|
-
label: string;
|
|
22
|
-
message: string;
|
|
23
|
-
};
|
|
24
|
-
next: {
|
|
25
|
-
label: string;
|
|
26
|
-
ariaLabel: string;
|
|
27
|
-
};
|
|
28
|
-
successLabel: string;
|
|
29
|
-
failureLabel: string;
|
|
30
|
-
};
|
|
31
|
-
declare type SlidesViewStaticProps = {
|
|
32
|
-
header: {
|
|
33
|
-
mode: string;
|
|
34
|
-
skillName: string;
|
|
35
|
-
onQuitClick: Function;
|
|
36
|
-
'aria-label'?: string;
|
|
37
|
-
closeButtonAriaLabel: string;
|
|
38
|
-
steps: StepItem[];
|
|
39
|
-
};
|
|
40
|
-
stack: {
|
|
41
|
-
slides: StoreState['ui']['slides'];
|
|
42
|
-
validateButton: {
|
|
43
|
-
label: string;
|
|
44
|
-
disabled: boolean;
|
|
45
|
-
onClick: Function;
|
|
46
|
-
};
|
|
47
|
-
correctionPopinProps?: CorrectionPopinProps;
|
|
48
|
-
endReview: boolean;
|
|
49
|
-
};
|
|
50
|
-
reviewBackgroundAriaLabel?: string;
|
|
51
|
-
congratsProps?: {
|
|
52
|
-
'aria-label'?: string;
|
|
53
|
-
'data-name'?: string;
|
|
54
|
-
animationLottie: any;
|
|
55
|
-
title: string;
|
|
56
|
-
cardCongratsStar: any;
|
|
57
|
-
cardCongratsRank: any;
|
|
58
|
-
buttonRevising: {
|
|
59
|
-
'aria-label'?: string;
|
|
60
|
-
label: string;
|
|
61
|
-
onClick: Function;
|
|
62
|
-
type: string;
|
|
63
|
-
};
|
|
64
|
-
buttonRevisingSkill: {
|
|
65
|
-
'aria-label'?: string;
|
|
66
|
-
label: string;
|
|
67
|
-
onClick: Function;
|
|
68
|
-
type: string;
|
|
69
|
-
};
|
|
70
|
-
};
|
|
71
|
-
};
|
|
72
|
-
declare type SlidesViewDispatcherProps = Omit<Dispatchers, 'navigateTo' | 'navigateBack'>;
|
|
73
|
-
declare type SlidesViewProps = SlidesViewStaticProps & SlidesViewDispatcherProps;
|
|
74
|
-
export { CorrectionPopinProps, IconValue, SlidesViewStaticProps, SlidesViewDispatcherProps, SlidesViewProps, StepItem };
|
|
@@ -1,279 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
concat,
|
|
3
|
-
divide,
|
|
4
|
-
get,
|
|
5
|
-
getOr,
|
|
6
|
-
head,
|
|
7
|
-
includes,
|
|
8
|
-
indexOf,
|
|
9
|
-
isEmpty,
|
|
10
|
-
map,
|
|
11
|
-
pipe,
|
|
12
|
-
rangeStep,
|
|
13
|
-
size,
|
|
14
|
-
toInteger
|
|
15
|
-
} from 'lodash/fp';
|
|
16
|
-
import {
|
|
17
|
-
AnswerUI,
|
|
18
|
-
FreeText,
|
|
19
|
-
Qcm,
|
|
20
|
-
QcmDrag,
|
|
21
|
-
QcmGraphic,
|
|
22
|
-
QuestionRange,
|
|
23
|
-
SelectionTemplate,
|
|
24
|
-
Template,
|
|
25
|
-
TextTemplate
|
|
26
|
-
} from '../types/slides';
|
|
27
|
-
import {
|
|
28
|
-
ChoiceFromAPI,
|
|
29
|
-
QcmDragQuestion,
|
|
30
|
-
QcmGraphicQuestion,
|
|
31
|
-
QcmQuestion,
|
|
32
|
-
SlideFromAPI,
|
|
33
|
-
SliderQuestion,
|
|
34
|
-
TemplateQuestion
|
|
35
|
-
} from '../types/common';
|
|
36
|
-
|
|
37
|
-
type UiUtils = {translate: (text: string) => string};
|
|
38
|
-
|
|
39
|
-
const qcmProps = (question: QcmQuestion): Qcm => {
|
|
40
|
-
// TODO: EDIT_CHOICES -> getAnswerValues
|
|
41
|
-
const answers: string[] = [];
|
|
42
|
-
|
|
43
|
-
return {
|
|
44
|
-
type: 'qcm',
|
|
45
|
-
answers: map(
|
|
46
|
-
choice => ({
|
|
47
|
-
title: choice.label,
|
|
48
|
-
selected: includes(choice.label, answers),
|
|
49
|
-
// TODO: EDIT_CHOICES
|
|
50
|
-
// eslint-disable-next-line no-console
|
|
51
|
-
onClick: () => console.log('TODO: on choice click'),
|
|
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
|
-
// TODO: EDIT_CHOICES -> getAnswerValues
|
|
62
|
-
const answers: string[] = [];
|
|
63
|
-
return {
|
|
64
|
-
type: 'qcmDrag',
|
|
65
|
-
answers: map(choice => {
|
|
66
|
-
const indexInAnswer = indexOf(choice.label, answers);
|
|
67
|
-
return {
|
|
68
|
-
title: choice.label,
|
|
69
|
-
selected: indexInAnswer !== -1,
|
|
70
|
-
order: indexInAnswer,
|
|
71
|
-
// TODO: EDIT_CHOICES
|
|
72
|
-
// eslint-disable-next-line no-console
|
|
73
|
-
onClick: () => console.log('TODO: on choice click')
|
|
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
|
-
// eslint-disable-next-line no-console
|
|
93
|
-
onClick: () => console.log('TODO: on choice click')
|
|
94
|
-
}),
|
|
95
|
-
// TODO: EDIT_CHOICES -> getChoices
|
|
96
|
-
question.content.choices
|
|
97
|
-
)
|
|
98
|
-
};
|
|
99
|
-
};
|
|
100
|
-
|
|
101
|
-
const templateTextProps =
|
|
102
|
-
(uiUtils: UiUtils) =>
|
|
103
|
-
(choice: ChoiceFromAPI, index: number): TextTemplate => {
|
|
104
|
-
const {translate} = uiUtils;
|
|
105
|
-
// TODO: EDIT_CHOICES -> getAnswerValues
|
|
106
|
-
const answers: string[] = [];
|
|
107
|
-
return {
|
|
108
|
-
type: 'text',
|
|
109
|
-
name: getOr('', 'name', choice),
|
|
110
|
-
placeholder: translate('Type here'),
|
|
111
|
-
value: get(index, answers),
|
|
112
|
-
// TODO: EDIT_CHOICES
|
|
113
|
-
// eslint-disable-next-line no-console
|
|
114
|
-
onChange: () => console.log('TODO: on choice change')
|
|
115
|
-
};
|
|
116
|
-
};
|
|
117
|
-
|
|
118
|
-
// const getItemText = (item: ChoiceFromAPI['items'][0]): item['text'] is string =>
|
|
119
|
-
|
|
120
|
-
const templateSelectProps = (uiUtils: UiUtils) => {
|
|
121
|
-
return (choice: ChoiceFromAPI, index: number): SelectionTemplate => {
|
|
122
|
-
const {translate} = uiUtils;
|
|
123
|
-
// TODO: EDIT_CHOICES -> getAnswerValues
|
|
124
|
-
const answers: string[] = [];
|
|
125
|
-
const answer = get(index, answers);
|
|
126
|
-
const temporaryOption = {
|
|
127
|
-
name: translate('Select an answer'),
|
|
128
|
-
value: '',
|
|
129
|
-
validOption: false,
|
|
130
|
-
selected: true
|
|
131
|
-
};
|
|
132
|
-
const selectOptions = choice.items.map(item => {
|
|
133
|
-
const itemText = getOr('', 'text', item);
|
|
134
|
-
return {
|
|
135
|
-
name: itemText,
|
|
136
|
-
value: itemText,
|
|
137
|
-
validOption: true,
|
|
138
|
-
selected: itemText === answer
|
|
139
|
-
};
|
|
140
|
-
});
|
|
141
|
-
|
|
142
|
-
return {
|
|
143
|
-
type: 'select',
|
|
144
|
-
name: getOr('', 'name', choice),
|
|
145
|
-
// TODO: EDIT_CHOICES
|
|
146
|
-
// eslint-disable-next-line no-console
|
|
147
|
-
onChange: () => console.log('TODO: on choice change'),
|
|
148
|
-
options: isEmpty(answer) ? concat([temporaryOption], selectOptions) : selectOptions
|
|
149
|
-
};
|
|
150
|
-
};
|
|
151
|
-
};
|
|
152
|
-
|
|
153
|
-
const templateProps = (uiUtils: UiUtils): ((question: TemplateQuestion) => Template) => {
|
|
154
|
-
const templateTextProps_ = templateTextProps(uiUtils);
|
|
155
|
-
const templateSelectProps_ = templateSelectProps(uiUtils);
|
|
156
|
-
|
|
157
|
-
return question => {
|
|
158
|
-
// TODO: EDIT_CHOICES -> getChoices
|
|
159
|
-
const choices = question.content.choices;
|
|
160
|
-
return {
|
|
161
|
-
type: 'template',
|
|
162
|
-
template: get('content.template', question),
|
|
163
|
-
answers: choices.map((choice, index) =>
|
|
164
|
-
choice.type === 'text'
|
|
165
|
-
? templateTextProps_(choice, index)
|
|
166
|
-
: templateSelectProps_(choice, index)
|
|
167
|
-
)
|
|
168
|
-
};
|
|
169
|
-
};
|
|
170
|
-
};
|
|
171
|
-
|
|
172
|
-
const basicProps = (uiUtils: UiUtils): (() => FreeText) => {
|
|
173
|
-
const {translate} = uiUtils;
|
|
174
|
-
// TODO: EDIT_CHOICES -> getAnswerValues
|
|
175
|
-
const answers: string[] = [];
|
|
176
|
-
|
|
177
|
-
return () => {
|
|
178
|
-
return {
|
|
179
|
-
type: 'freeText',
|
|
180
|
-
placeholder: translate('Type here'),
|
|
181
|
-
value: head(answers),
|
|
182
|
-
// TODO: EDIT_CHOICES
|
|
183
|
-
// eslint-disable-next-line no-console
|
|
184
|
-
onChange: () => console.log('TODO: on choice change')
|
|
185
|
-
};
|
|
186
|
-
};
|
|
187
|
-
};
|
|
188
|
-
|
|
189
|
-
const sliderProps = (question: SliderQuestion): QuestionRange => {
|
|
190
|
-
const values: number[] = rangeStep(
|
|
191
|
-
getOr(1, 'content.step', question),
|
|
192
|
-
getOr(Number.NaN, 'content.min', question),
|
|
193
|
-
getOr(Number.NaN, 'content.max', question) + 1
|
|
194
|
-
// Lodash doesn't infer the type very well here
|
|
195
|
-
) as unknown as number[];
|
|
196
|
-
|
|
197
|
-
// TODO: EDIT_CHOICES -> getAnswerValues
|
|
198
|
-
const answers: string[] = [];
|
|
199
|
-
|
|
200
|
-
const stateValue = head(answers);
|
|
201
|
-
const currentValue = toInteger(stateValue);
|
|
202
|
-
|
|
203
|
-
const indexValue = indexOf(currentValue, values);
|
|
204
|
-
const sliderPosition = divide(indexValue, size(values) - 1);
|
|
205
|
-
|
|
206
|
-
const unitLabel = get('question.content.unitLabel', question);
|
|
207
|
-
|
|
208
|
-
return {
|
|
209
|
-
type: 'slider',
|
|
210
|
-
placeholder: question.explanation,
|
|
211
|
-
minLabel: `${question.content.min} ${unitLabel}`,
|
|
212
|
-
maxLabel: `${question.content.max} ${unitLabel}`,
|
|
213
|
-
title: `${currentValue} ${question.content.unitLabel}`,
|
|
214
|
-
value: sliderPosition,
|
|
215
|
-
// TODO: EDIT_CHOICES
|
|
216
|
-
// eslint-disable-next-line no-console
|
|
217
|
-
onChange: () => console.log('TODO: on choice change')
|
|
218
|
-
};
|
|
219
|
-
};
|
|
220
|
-
|
|
221
|
-
export const getQuestionType = (slide: SlideFromAPI): SlideFromAPI['question']['type'] =>
|
|
222
|
-
slide.question.type;
|
|
223
|
-
|
|
224
|
-
const getHelp =
|
|
225
|
-
(uiUtils: UiUtils) =>
|
|
226
|
-
(slide: SlideFromAPI): string => {
|
|
227
|
-
const {translate} = uiUtils;
|
|
228
|
-
return get('question.explanation', slide) || translate('Select something below');
|
|
229
|
-
};
|
|
230
|
-
|
|
231
|
-
const getAnswerUIModel = (uiUtils: UiUtils): ((slide: SlideFromAPI) => AnswerUI['model']) => {
|
|
232
|
-
const basicProps_ = basicProps(uiUtils);
|
|
233
|
-
const templateProps_ = templateProps(uiUtils);
|
|
234
|
-
|
|
235
|
-
return slide => {
|
|
236
|
-
const type = getQuestionType(slide);
|
|
237
|
-
switch (type) {
|
|
238
|
-
case 'qcm':
|
|
239
|
-
return pipe(get('question'), qcmProps)(slide);
|
|
240
|
-
|
|
241
|
-
case 'qcmGraphic':
|
|
242
|
-
return pipe(get('question'), qcmGraphicProps)(slide);
|
|
243
|
-
|
|
244
|
-
case 'qcmDrag':
|
|
245
|
-
return pipe(get('question'), qcmDragProps)(slide);
|
|
246
|
-
|
|
247
|
-
case 'basic':
|
|
248
|
-
return basicProps_();
|
|
249
|
-
|
|
250
|
-
case 'template':
|
|
251
|
-
return pipe(get('question'), templateProps_)(slide);
|
|
252
|
-
|
|
253
|
-
case 'slider':
|
|
254
|
-
return pipe(get('question'), sliderProps)(slide);
|
|
255
|
-
|
|
256
|
-
default:
|
|
257
|
-
throw new Error(`${type} is not an handled question.type`);
|
|
258
|
-
}
|
|
259
|
-
};
|
|
260
|
-
};
|
|
261
|
-
|
|
262
|
-
export const mapApiSlideToUi = (
|
|
263
|
-
uiUtils: UiUtils
|
|
264
|
-
): ((slide: SlideFromAPI) => {questionText: string; answerUI: AnswerUI}) => {
|
|
265
|
-
const getAnswerUIModel_ = getAnswerUIModel(uiUtils);
|
|
266
|
-
const getHelp_ = getHelp(uiUtils);
|
|
267
|
-
|
|
268
|
-
return slide => {
|
|
269
|
-
if (!slide) {
|
|
270
|
-
throw new Error('no slide was found');
|
|
271
|
-
}
|
|
272
|
-
const questionText = pipe<[SlideFromAPI], string, string>(
|
|
273
|
-
getOr('', 'question.header') as unknown as (_slide: SlideFromAPI) => string,
|
|
274
|
-
uiUtils.translate
|
|
275
|
-
)(slide);
|
|
276
|
-
|
|
277
|
-
return {questionText, answerUI: {model: getAnswerUIModel_(slide), help: getHelp_(slide)}};
|
|
278
|
-
};
|
|
279
|
-
};
|
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
import noop from 'lodash/fp/noop';
|
|
2
|
-
import {SlideFromAPI, UISlide} from '../../../types/common';
|
|
3
|
-
|
|
4
|
-
export const freeTextSlide: SlideFromAPI = {
|
|
5
|
-
id: 'sli_E1Pcl-XAYbi',
|
|
6
|
-
universalRef: 'sli_E1Pcl-XAYbi',
|
|
7
|
-
question: {
|
|
8
|
-
type: 'basic',
|
|
9
|
-
header: 'sli_E1Pcl-XAYbi.header',
|
|
10
|
-
explanation: 'sli_E1Pcl-XAYbi.explanation',
|
|
11
|
-
content: {
|
|
12
|
-
label: 'sli_E1Pcl-XAYbi.label',
|
|
13
|
-
placeholder: 'sli_E1Pcl-XAYbi.placeholder',
|
|
14
|
-
id: 'sli_E1Pcl-XAYbi.choice_1'
|
|
15
|
-
}
|
|
16
|
-
},
|
|
17
|
-
clue: 'sli_E1Pcl-XAYbi.clue',
|
|
18
|
-
klf: 'sli_E1Pcl-XAYbi.klf',
|
|
19
|
-
tips: 'sli_E1Pcl-XAYbi.tips'
|
|
20
|
-
};
|
|
21
|
-
|
|
22
|
-
export const freeTextUISlide: Partial<UISlide> = {
|
|
23
|
-
answerUI: {
|
|
24
|
-
help: 'sli_E1Pcl-XAYbi.explanation',
|
|
25
|
-
model: {
|
|
26
|
-
type: 'freeText',
|
|
27
|
-
placeholder: 'Type here',
|
|
28
|
-
value: undefined,
|
|
29
|
-
onChange: noop
|
|
30
|
-
}
|
|
31
|
-
},
|
|
32
|
-
questionText: 'sli_E1Pcl-XAYbi.header'
|
|
33
|
-
};
|