@coorpacademy/app-review 0.1.15 → 0.1.17
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 +5 -7
- package/es/actions/api/fetch-skills.js +12 -4
- package/es/actions/api/fetch-slide.d.ts +14 -7
- package/es/actions/api/fetch-slide.js +23 -18
- package/es/actions/api/post-answer.d.ts +10 -0
- package/es/actions/api/post-answer.js +25 -0
- package/es/actions/api/post-progression.d.ts +5 -7
- package/es/actions/api/post-progression.js +16 -8
- package/es/actions/api/test/fetch-skills.test.js +57 -0
- package/es/actions/api/test/fetch-slide.test.js +64 -0
- package/es/actions/api/test/post-answer.test.d.ts +1 -0
- package/es/actions/api/test/post-answer.test.js +82 -0
- package/es/actions/api/test/post-progression.test.d.ts +1 -0
- package/es/actions/api/test/post-progression.test.js +105 -0
- package/es/actions/data/test/token.test.d.ts +1 -0
- package/es/actions/data/test/token.test.js +25 -0
- package/es/actions/index.d.ts +1 -8
- package/es/actions/test/create-test-store.d.ts +5 -0
- package/es/actions/test/create-test-store.js +16 -0
- package/es/actions/ui/answers.d.ts +21 -0
- package/es/actions/ui/answers.js +43 -0
- package/es/actions/ui/slides.d.ts +0 -5
- package/es/actions/ui/slides.js +0 -4
- package/es/actions/ui/test/answers.test.d.ts +1 -0
- package/es/actions/ui/test/answers.test.js +90 -0
- package/es/actions/ui/test/slides.test.d.ts +1 -0
- package/es/actions/ui/test/slides.test.js +26 -0
- package/es/common/index.d.ts +0 -3
- package/es/common/index.js +0 -4
- package/es/index.js +11 -19
- package/es/reducers/data/index.d.ts +2 -2
- package/es/reducers/data/progression.d.ts +2 -3
- package/es/reducers/data/progression.js +0 -5
- package/es/reducers/data/slides.d.ts +3 -4
- 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 +3 -2
- package/es/reducers/ui/answers.d.ts +4 -0
- package/es/reducers/ui/answers.js +9 -0
- package/es/reducers/ui/index.d.ts +7 -4
- package/es/reducers/ui/index.js +4 -2
- package/es/reducers/ui/slide.d.ts +8 -0
- package/es/reducers/ui/slide.js +26 -0
- package/es/reducers/ui/test/answers.test.d.ts +1 -0
- package/es/reducers/ui/test/answers.test.js +27 -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/reducers/ui/test/slide.test.d.ts +1 -0
- package/es/reducers/ui/test/slide.test.js +12 -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.d.ts +2 -1
- package/es/test/util/services.mock.js +88 -44
- package/es/types/common.d.ts +22 -33
- package/es/views/skills/index.d.ts +1 -1
- package/es/views/skills/index.js +0 -3
- package/es/views/skills/test/skills.test.d.ts +1 -0
- package/es/views/skills/test/skills.test.js +94 -0
- package/es/views/slides/index.d.ts +89 -2
- package/es/views/slides/index.js +80 -10
- package/es/views/slides/map-api-slide-to-ui.d.ts +8 -0
- package/es/views/slides/map-api-slide-to-ui.js +165 -0
- package/es/{helpers → views/slides}/test/fixtures/free-text.d.ts +2 -1
- package/es/views/slides/test/fixtures/free-text.js +38 -0
- package/es/{helpers → views/slides}/test/fixtures/qcm-drag.d.ts +2 -1
- package/es/views/slides/test/fixtures/qcm-drag.js +108 -0
- package/es/{helpers → views/slides}/test/fixtures/qcm-graphic.d.ts +2 -1
- package/es/views/slides/test/fixtures/qcm-graphic.js +88 -0
- package/es/{helpers → views/slides}/test/fixtures/qcm.d.ts +2 -1
- package/es/{helpers → views/slides}/test/fixtures/qcm.js +5 -1
- package/es/{helpers → views/slides}/test/fixtures/select-template.d.ts +2 -1
- package/es/views/slides/test/fixtures/select-template.js +92 -0
- package/es/{helpers → views/slides}/test/fixtures/slider.d.ts +2 -1
- package/es/views/slides/test/fixtures/slider.js +36 -0
- package/es/{helpers → views/slides}/test/fixtures/text-template.d.ts +2 -1
- package/es/{helpers → views/slides}/test/fixtures/text-template.js +5 -1
- package/es/views/slides/test/index.test.d.ts +1 -0
- package/es/views/slides/test/index.test.js +234 -0
- 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 +5 -7
- package/lib/actions/api/fetch-skills.js +58 -7
- package/lib/actions/api/fetch-slide.d.ts +14 -7
- package/lib/actions/api/fetch-slide.js +72 -20
- package/lib/actions/api/post-answer.d.ts +10 -0
- package/lib/actions/api/post-answer.js +75 -0
- package/lib/actions/api/post-progression.d.ts +5 -7
- package/lib/actions/api/post-progression.js +67 -10
- package/lib/actions/api/test/fetch-skills.test.d.ts +1 -0
- package/lib/actions/api/test/fetch-skills.test.js +116 -0
- package/lib/actions/api/test/fetch-slide.test.d.ts +1 -0
- package/lib/actions/api/test/fetch-slide.test.js +123 -0
- package/lib/actions/api/test/post-answer.test.d.ts +1 -0
- package/lib/actions/api/test/post-answer.test.js +145 -0
- package/lib/actions/api/test/post-progression.test.d.ts +1 -0
- package/lib/actions/api/test/post-progression.test.js +163 -0
- package/lib/actions/data/test/token.test.d.ts +1 -0
- package/lib/actions/data/test/token.test.js +70 -0
- package/lib/actions/index.d.ts +1 -8
- package/lib/actions/test/create-test-store.d.ts +5 -0
- package/lib/actions/test/create-test-store.js +18 -0
- package/lib/actions/ui/answers.d.ts +21 -0
- package/lib/actions/ui/answers.js +54 -0
- package/lib/actions/ui/slides.d.ts +0 -5
- package/lib/actions/ui/slides.js +0 -4
- package/lib/actions/ui/test/answers.test.d.ts +1 -0
- package/lib/actions/ui/test/answers.test.js +171 -0
- package/lib/actions/ui/test/slides.test.d.ts +1 -0
- package/lib/actions/ui/test/slides.test.js +71 -0
- package/lib/common/index.d.ts +0 -3
- package/lib/common/index.js +0 -4
- package/lib/index.js +22 -21
- package/lib/reducers/data/index.d.ts +2 -2
- package/lib/reducers/data/progression.d.ts +2 -3
- package/lib/reducers/data/progression.js +0 -5
- package/lib/reducers/data/slides.d.ts +3 -4
- 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 +3 -2
- package/lib/reducers/ui/answers.d.ts +4 -0
- package/lib/reducers/ui/answers.js +10 -0
- package/lib/reducers/ui/index.d.ts +7 -4
- package/lib/reducers/ui/index.js +4 -2
- package/lib/reducers/ui/slide.d.ts +8 -0
- package/lib/reducers/ui/slide.js +27 -0
- package/lib/reducers/ui/test/answers.test.d.ts +1 -0
- package/lib/reducers/ui/test/answers.test.js +27 -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/reducers/ui/test/slide.test.d.ts +1 -0
- package/lib/reducers/ui/test/slide.test.js +12 -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.d.ts +2 -1
- package/lib/test/util/services.mock.js +88 -44
- package/lib/types/common.d.ts +22 -33
- package/lib/views/skills/index.d.ts +1 -1
- package/lib/views/skills/index.js +0 -3
- package/lib/views/skills/test/skills.test.d.ts +1 -0
- package/lib/views/skills/test/skills.test.js +94 -0
- package/lib/views/slides/index.d.ts +89 -2
- package/lib/views/slides/index.js +80 -10
- package/lib/views/slides/map-api-slide-to-ui.d.ts +8 -0
- package/lib/views/slides/map-api-slide-to-ui.js +179 -0
- package/lib/{helpers → views/slides}/test/fixtures/free-text.d.ts +2 -1
- package/lib/views/slides/test/fixtures/free-text.js +38 -0
- package/lib/{helpers → views/slides}/test/fixtures/qcm-drag.d.ts +2 -1
- package/lib/views/slides/test/fixtures/qcm-drag.js +108 -0
- package/lib/{helpers → views/slides}/test/fixtures/qcm-graphic.d.ts +2 -1
- package/lib/views/slides/test/fixtures/qcm-graphic.js +88 -0
- package/lib/{helpers → views/slides}/test/fixtures/qcm.d.ts +2 -1
- package/lib/{helpers → views/slides}/test/fixtures/qcm.js +5 -1
- package/lib/{helpers → views/slides}/test/fixtures/select-template.d.ts +2 -1
- package/lib/views/slides/test/fixtures/select-template.js +92 -0
- package/lib/{helpers → views/slides}/test/fixtures/slider.d.ts +2 -1
- package/lib/views/slides/test/fixtures/slider.js +36 -0
- package/lib/{helpers → views/slides}/test/fixtures/text-template.d.ts +2 -1
- package/lib/{helpers → views/slides}/test/fixtures/text-template.js +5 -1
- package/lib/views/slides/test/index.test.d.ts +1 -0
- package/lib/views/slides/test/index.test.js +234 -0
- 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 +6 -5
- package/src/actions/api/fetch-skills.ts +19 -12
- package/src/actions/api/fetch-slide.ts +35 -29
- package/src/actions/api/post-answer.ts +39 -0
- package/src/actions/api/post-progression.ts +22 -22
- package/src/actions/api/test/fetch-skills.test.ts +73 -0
- package/src/actions/api/test/fetch-slide.test.ts +80 -0
- package/src/actions/api/test/post-answer.test.ts +101 -0
- package/src/actions/api/test/post-progression.test.ts +122 -0
- package/src/actions/data/test/token.test.ts +29 -0
- package/src/actions/index.ts +1 -17
- package/src/actions/test/create-test-store.ts +25 -0
- package/src/actions/ui/answers.ts +63 -0
- package/src/actions/ui/slides.ts +1 -8
- package/src/actions/ui/test/answers.test.ts +103 -0
- package/src/actions/ui/test/slides.test.ts +30 -0
- package/src/common/index.ts +0 -7
- package/src/index.tsx +15 -32
- package/src/reducers/data/index.ts +1 -1
- package/src/reducers/data/progression.ts +2 -7
- package/src/reducers/data/slides.ts +12 -4
- 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 +15 -0
- package/src/reducers/ui/index.ts +6 -3
- package/src/reducers/ui/slide.ts +43 -0
- package/src/reducers/ui/test/answers.test.ts +33 -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/reducers/ui/test/slide.test.ts +15 -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 +93 -45
- package/src/types/common.ts +34 -44
- package/src/views/skills/index.ts +1 -5
- package/src/views/skills/test/skills.test.ts +101 -0
- package/src/views/slides/index.ts +186 -12
- package/src/views/slides/map-api-slide-to-ui.ts +251 -0
- package/src/views/slides/test/fixtures/free-text.ts +44 -0
- package/src/views/slides/test/fixtures/qcm-drag.ts +112 -0
- package/src/views/slides/test/fixtures/qcm-graphic.ts +95 -0
- package/src/{helpers → views/slides}/test/fixtures/qcm.ts +7 -2
- package/src/views/slides/test/fixtures/select-template.ts +99 -0
- package/src/views/slides/test/fixtures/slider.ts +42 -0
- package/src/{helpers → views/slides}/test/fixtures/text-template.ts +7 -2
- package/src/views/slides/test/index.test.ts +240 -0
- package/src/{helpers → views/slides}/test/map-api-slide-to-ui.test.ts +22 -10
- package/es/fixtures/qcm-slide.d.ts +0 -2
- package/es/fixtures/qcm-slide.js +0 -33
- package/es/fixtures/temp-fixture.d.ts +0 -3
- package/es/fixtures/temp-fixture.js +0 -84
- 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/fixtures/qcm-slide.d.ts +0 -2
- package/lib/fixtures/qcm-slide.js +0 -33
- package/lib/fixtures/temp-fixture.d.ts +0 -3
- package/lib/fixtures/temp-fixture.js +0 -84
- 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/fixtures/qcm-slide.ts +0 -35
- package/src/fixtures/temp-fixture.ts +0 -94
- 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
package/src/index.tsx
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React, {useEffect, useState} from 'react';
|
|
2
2
|
import type {} from 'redux-thunk/extend-redux'; // https://github.com/reduxjs/redux-thunk/issues/333
|
|
3
3
|
import {AnyAction, Store} from 'redux';
|
|
4
|
-
import {
|
|
4
|
+
import {useSelector, useDispatch, Provider} from 'react-redux';
|
|
5
5
|
import AppReviewTemplate from '@coorpacademy/components/es/template/app-review';
|
|
6
6
|
import {TemplateContext} from '@coorpacademy/components/es/template/app-review/template-context';
|
|
7
7
|
|
|
@@ -11,43 +11,28 @@ import configureStore from './configure-store';
|
|
|
11
11
|
|
|
12
12
|
import type {AppOptions} from './types/common';
|
|
13
13
|
import type {StoreState} from './reducers';
|
|
14
|
-
import type {SlidesViewStaticProps} from './types/views/slides';
|
|
15
14
|
|
|
16
|
-
import {
|
|
17
|
-
import {validateSlide} from './actions/ui/slides';
|
|
18
|
-
|
|
19
|
-
import {navigateTo, navigateBack, ViewPath} from './actions/ui/navigation';
|
|
15
|
+
import {navigateTo, ViewPath} from './actions/ui/navigation';
|
|
20
16
|
import {storeToken} from './actions/data/token';
|
|
21
17
|
import {fetchSkills} from './actions/api/fetch-skills';
|
|
22
18
|
import {postProgression} from './actions/api/post-progression';
|
|
23
19
|
import {VIEWS} from './common';
|
|
24
20
|
import {mapStateToSlidesProps} from './views/slides';
|
|
25
|
-
import {mapStateToSkillsProps
|
|
26
|
-
|
|
27
|
-
type StaticProps = {
|
|
28
|
-
viewName: 'skills' | 'onboarding' | 'slides' | 'loader';
|
|
29
|
-
slides: SlidesViewStaticProps | null;
|
|
30
|
-
skills: SkillsProps | null;
|
|
31
|
-
};
|
|
21
|
+
import {mapStateToSkillsProps} from './views/skills';
|
|
32
22
|
|
|
33
|
-
const
|
|
34
|
-
|
|
35
|
-
navigateBack,
|
|
36
|
-
validateSlide
|
|
37
|
-
};
|
|
23
|
+
const ConnectedApp = (): JSX.Element => {
|
|
24
|
+
const dispatch = useDispatch();
|
|
38
25
|
|
|
39
|
-
const
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
slides: mapStateToSlidesProps(state),
|
|
46
|
-
skills: mapStateToSkillsProps(state)
|
|
26
|
+
const props = {
|
|
27
|
+
viewName: useSelector(
|
|
28
|
+
(state: StoreState) => state.ui.navigation[state.ui.navigation.length - 1]
|
|
29
|
+
),
|
|
30
|
+
slides: useSelector((state: StoreState) => mapStateToSlidesProps(state, dispatch)),
|
|
31
|
+
skills: useSelector((state: StoreState) => mapStateToSkillsProps(state))
|
|
47
32
|
};
|
|
48
|
-
};
|
|
49
33
|
|
|
50
|
-
|
|
34
|
+
return <AppReviewTemplate {...props} />;
|
|
35
|
+
};
|
|
51
36
|
|
|
52
37
|
const AppReview = ({options}: {options: AppOptions}): JSX.Element | null => {
|
|
53
38
|
const [store, setStore] = useState<Store<StoreState, AnyAction> | null>(null);
|
|
@@ -83,9 +68,7 @@ const AppReview = ({options}: {options: AppOptions}): JSX.Element | null => {
|
|
|
83
68
|
|
|
84
69
|
/* ThunkAction is not assignable to parameter of type 'AnyAction'
|
|
85
70
|
ts problem is described here = https://github.com/reduxjs/redux-thunk/issues/333 */
|
|
86
|
-
skillRef
|
|
87
|
-
? store.dispatch(postProgression(skillRef, token))
|
|
88
|
-
: store.dispatch(fetchSkills(token));
|
|
71
|
+
skillRef ? store.dispatch(postProgression(skillRef)) : store.dispatch(fetchSkills);
|
|
89
72
|
}, [options, store]);
|
|
90
73
|
|
|
91
74
|
useEffect(() => {
|
|
@@ -109,7 +92,7 @@ const AppReview = ({options}: {options: AppOptions}): JSX.Element | null => {
|
|
|
109
92
|
return (
|
|
110
93
|
<Provider store={store}>
|
|
111
94
|
<TemplateContext values={values}>
|
|
112
|
-
<
|
|
95
|
+
<ConnectedApp />
|
|
113
96
|
</TemplateContext>
|
|
114
97
|
</Provider>
|
|
115
98
|
);
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {POST_PROGRESSION_SUCCESS, ReceiveProgression} from '../../actions/api/post-progression';
|
|
1
|
+
import {POST_PROGRESSION_SUCCESS, ReceivedProgression} from '../../actions/api/post-progression';
|
|
3
2
|
import {ProgressionFromAPI} from '../../types/common';
|
|
4
3
|
|
|
5
4
|
export type ProgressionState = ProgressionFromAPI | null;
|
|
@@ -7,13 +6,9 @@ export type ProgressionState = ProgressionFromAPI | null;
|
|
|
7
6
|
const reducer = (
|
|
8
7
|
// eslint-disable-next-line default-param-last
|
|
9
8
|
state: ProgressionState = null,
|
|
10
|
-
action:
|
|
9
|
+
action: ReceivedProgression
|
|
11
10
|
): ProgressionState => {
|
|
12
11
|
switch (action.type) {
|
|
13
|
-
case VALIDATE_SLIDE: {
|
|
14
|
-
// TODO: fix on VALIDATE ticket -> launch a POST PROGRESSION
|
|
15
|
-
return state;
|
|
16
|
-
}
|
|
17
12
|
case POST_PROGRESSION_SUCCESS: {
|
|
18
13
|
const progression = action.payload;
|
|
19
14
|
return progression;
|
|
@@ -1,16 +1,24 @@
|
|
|
1
1
|
import set from 'lodash/fp/set';
|
|
2
|
-
import {
|
|
3
|
-
|
|
2
|
+
import {
|
|
3
|
+
ReceivedSlide,
|
|
4
|
+
FetchSlide,
|
|
5
|
+
SLIDE_FETCH_REQUEST,
|
|
6
|
+
SLIDE_FETCH_SUCCESS
|
|
7
|
+
} from '../../actions/api/fetch-slide';
|
|
4
8
|
import {SlideFromAPI} from '../../types/common';
|
|
5
9
|
|
|
6
|
-
export type SlidesAction =
|
|
10
|
+
export type SlidesAction = FetchSlide | ReceivedSlide;
|
|
7
11
|
|
|
8
|
-
export type SlidesState = Record<string, SlideFromAPI>;
|
|
12
|
+
export type SlidesState = Record<string, SlideFromAPI | null>;
|
|
9
13
|
export const initialState: SlidesState = {};
|
|
10
14
|
|
|
11
15
|
// eslint-disable-next-line default-param-last
|
|
12
16
|
const reducer = (state: SlidesState = initialState, action: SlidesAction): SlidesState => {
|
|
13
17
|
switch (action.type) {
|
|
18
|
+
case SLIDE_FETCH_REQUEST: {
|
|
19
|
+
const {meta} = action;
|
|
20
|
+
return set(meta.slideRef, null, state);
|
|
21
|
+
}
|
|
14
22
|
case SLIDE_FETCH_SUCCESS: {
|
|
15
23
|
const slide = action.payload;
|
|
16
24
|
return set(slide.id, slide, state);
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import test from 'ava';
|
|
2
|
+
import reducer from '../progression';
|
|
3
|
+
import {POST_PROGRESSION_SUCCESS, ReceivedProgression} from '../../../actions/api/post-progression';
|
|
4
|
+
import {ProgressionFromAPI} from '../../../types/common';
|
|
5
|
+
|
|
6
|
+
test('should have initial value', t => {
|
|
7
|
+
const state = reducer(undefined, {} as ReceivedProgression);
|
|
8
|
+
t.is(state, null);
|
|
9
|
+
});
|
|
10
|
+
|
|
11
|
+
test('should set the value of POST_PROGRESSION_SUCCESS action', t => {
|
|
12
|
+
const progression: ProgressionFromAPI = {
|
|
13
|
+
_id: '62b1d1087aa12f00253f40ee',
|
|
14
|
+
content: {
|
|
15
|
+
ref: '_skill-ref',
|
|
16
|
+
type: 'skill'
|
|
17
|
+
},
|
|
18
|
+
engine: {
|
|
19
|
+
ref: 'review'
|
|
20
|
+
},
|
|
21
|
+
state: {
|
|
22
|
+
allAnswers: [],
|
|
23
|
+
isCorrect: true,
|
|
24
|
+
nextContent: {
|
|
25
|
+
ref: 'sli_N1XACJobn',
|
|
26
|
+
type: 'slide'
|
|
27
|
+
},
|
|
28
|
+
pendingSlides: [],
|
|
29
|
+
slides: [],
|
|
30
|
+
step: {
|
|
31
|
+
current: 1
|
|
32
|
+
},
|
|
33
|
+
stars: 0
|
|
34
|
+
}
|
|
35
|
+
};
|
|
36
|
+
|
|
37
|
+
const state = reducer(null, {
|
|
38
|
+
type: POST_PROGRESSION_SUCCESS,
|
|
39
|
+
payload: progression
|
|
40
|
+
});
|
|
41
|
+
t.deepEqual(state, progression);
|
|
42
|
+
});
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import test from 'ava';
|
|
2
|
+
import reducer from '../skills';
|
|
3
|
+
import {ReceivedSkills, SKILLS_FETCH_SUCCESS} from '../../../actions/api/fetch-skills';
|
|
4
|
+
|
|
5
|
+
test('should have inital value', t => {
|
|
6
|
+
const state = reducer(undefined, {} as ReceivedSkills);
|
|
7
|
+
t.deepEqual(state, []);
|
|
8
|
+
});
|
|
9
|
+
|
|
10
|
+
test('should set the value of SKILLS_FETCH_SUCCESS action', t => {
|
|
11
|
+
const skills = [{skillRef: 'skill', name: 'skill name', slidesToReview: 5, custom: false}];
|
|
12
|
+
const state = reducer([], {type: SKILLS_FETCH_SUCCESS, payload: skills});
|
|
13
|
+
t.deepEqual(state, skills);
|
|
14
|
+
});
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import test from 'ava';
|
|
2
|
+
import reducer, {type SlidesAction} from '../slides';
|
|
3
|
+
import {SLIDE_FETCH_REQUEST, SLIDE_FETCH_SUCCESS} from '../../../actions/api/fetch-slide';
|
|
4
|
+
import {freeTextSlide} from '../../../views/slides/test/fixtures/free-text';
|
|
5
|
+
|
|
6
|
+
test('should have inital value', t => {
|
|
7
|
+
const state = reducer(undefined, {} as SlidesAction);
|
|
8
|
+
t.deepEqual(state, {});
|
|
9
|
+
});
|
|
10
|
+
|
|
11
|
+
test('should set the value of SLIDE_FETCH_REQUEST action', t => {
|
|
12
|
+
const state = reducer({}, {type: SLIDE_FETCH_REQUEST, meta: {slideRef: 'slideRef'}});
|
|
13
|
+
t.deepEqual(state, {
|
|
14
|
+
slideRef: null
|
|
15
|
+
});
|
|
16
|
+
});
|
|
17
|
+
|
|
18
|
+
test('should set the value of SLIDE_FETCH_SUCCESS action', t => {
|
|
19
|
+
const state = reducer(
|
|
20
|
+
{},
|
|
21
|
+
{type: SLIDE_FETCH_SUCCESS, payload: freeTextSlide, meta: {slideRef: 'sli_VJYjJnJhg'}}
|
|
22
|
+
);
|
|
23
|
+
t.deepEqual(state, {
|
|
24
|
+
sli_VJYjJnJhg: freeTextSlide
|
|
25
|
+
});
|
|
26
|
+
});
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import test from 'ava';
|
|
2
|
+
import reducer from '../token';
|
|
3
|
+
import {StoreToken, STORE_TOKEN} from '../../../actions/data/token';
|
|
4
|
+
|
|
5
|
+
test('should have inital value', t => {
|
|
6
|
+
const state = reducer(undefined, {} as StoreToken);
|
|
7
|
+
t.is(state, null);
|
|
8
|
+
});
|
|
9
|
+
|
|
10
|
+
test('should set the value of STORE_TOKEN action', t => {
|
|
11
|
+
const state = reducer(null, {type: STORE_TOKEN, payload: 'token'});
|
|
12
|
+
t.is(state, 'token');
|
|
13
|
+
});
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import {includes, values} from 'lodash/fp';
|
|
2
|
+
import {EditAnswerAction, ANSWER_EDIT} from '../../actions/ui/answers';
|
|
3
|
+
|
|
4
|
+
export type AnswerState = string[];
|
|
5
|
+
const ANSWER_EDIT_ACTIONS = values(ANSWER_EDIT);
|
|
6
|
+
|
|
7
|
+
const reducer = (
|
|
8
|
+
// eslint-disable-next-line default-param-last
|
|
9
|
+
state: AnswerState = [],
|
|
10
|
+
action: EditAnswerAction
|
|
11
|
+
): AnswerState => {
|
|
12
|
+
return includes(action.type, ANSWER_EDIT_ACTIONS) ? action.payload : state;
|
|
13
|
+
};
|
|
14
|
+
|
|
15
|
+
export default reducer;
|
package/src/reducers/ui/index.ts
CHANGED
|
@@ -2,16 +2,19 @@ import {combineReducers} from 'redux';
|
|
|
2
2
|
|
|
3
3
|
import currentSlideRef, {CurrentSlideRefState} from './current-slide-ref';
|
|
4
4
|
import navigation, {NavigationState} from './navigation';
|
|
5
|
-
import
|
|
5
|
+
import answers, {AnswerState} from './answers';
|
|
6
|
+
import slide, {UISlideState} from './slide';
|
|
6
7
|
|
|
7
8
|
export type UIState = {
|
|
8
9
|
currentSlideRef: CurrentSlideRefState;
|
|
9
10
|
navigation: NavigationState;
|
|
10
|
-
|
|
11
|
+
answers: AnswerState;
|
|
12
|
+
slide: UISlideState;
|
|
11
13
|
};
|
|
12
14
|
|
|
13
15
|
export default combineReducers({
|
|
14
16
|
currentSlideRef,
|
|
15
17
|
navigation,
|
|
16
|
-
|
|
18
|
+
answers,
|
|
19
|
+
slide
|
|
17
20
|
});
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import compact from 'lodash/fp/compact';
|
|
2
|
+
import isEmpty from 'lodash/fp/isEmpty';
|
|
3
|
+
import pipe from 'lodash/fp/pipe';
|
|
4
|
+
import {
|
|
5
|
+
EditAnswerAction,
|
|
6
|
+
EDIT_BASIC,
|
|
7
|
+
EDIT_QCM,
|
|
8
|
+
EDIT_QCM_DRAG,
|
|
9
|
+
EDIT_QCM_GRAPHIC,
|
|
10
|
+
EDIT_SLIDER,
|
|
11
|
+
EDIT_TEMPLATE
|
|
12
|
+
} from '../../actions/ui/answers';
|
|
13
|
+
import {PostAnswerRequestAction, POST_ANSWER_REQUEST} from '../../actions/api/post-answer';
|
|
14
|
+
|
|
15
|
+
export type UISlideState = {
|
|
16
|
+
validateButton: boolean;
|
|
17
|
+
};
|
|
18
|
+
|
|
19
|
+
export const initialState: UISlideState = {validateButton: false};
|
|
20
|
+
|
|
21
|
+
const reducer = (
|
|
22
|
+
// eslint-disable-next-line default-param-last
|
|
23
|
+
state: UISlideState = initialState,
|
|
24
|
+
action: PostAnswerRequestAction | EditAnswerAction
|
|
25
|
+
): UISlideState => {
|
|
26
|
+
switch (action.type) {
|
|
27
|
+
case EDIT_QCM:
|
|
28
|
+
case EDIT_QCM_GRAPHIC:
|
|
29
|
+
case EDIT_QCM_DRAG:
|
|
30
|
+
case EDIT_TEMPLATE:
|
|
31
|
+
case EDIT_BASIC:
|
|
32
|
+
case EDIT_SLIDER: {
|
|
33
|
+
return pipe(compact, isEmpty)(action.payload) ? initialState : {validateButton: true};
|
|
34
|
+
}
|
|
35
|
+
case POST_ANSWER_REQUEST: {
|
|
36
|
+
return initialState;
|
|
37
|
+
}
|
|
38
|
+
default:
|
|
39
|
+
return state;
|
|
40
|
+
}
|
|
41
|
+
};
|
|
42
|
+
|
|
43
|
+
export default reducer;
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import test from 'ava';
|
|
2
|
+
import reducer from '../answers';
|
|
3
|
+
import {EditAnswerAction, ANSWER_EDIT} from '../../../actions/ui/answers';
|
|
4
|
+
|
|
5
|
+
test('should have initial value', t => {
|
|
6
|
+
const state = reducer(undefined, {} as EditAnswerAction);
|
|
7
|
+
t.deepEqual(state, []);
|
|
8
|
+
});
|
|
9
|
+
|
|
10
|
+
test('should set the value of EDIT_BASIC action', t => {
|
|
11
|
+
const state = reducer([], {type: ANSWER_EDIT.basic, payload: ['value']});
|
|
12
|
+
t.deepEqual(state, ['value']);
|
|
13
|
+
});
|
|
14
|
+
|
|
15
|
+
test('should set the value of EDIT_QCM action', t => {
|
|
16
|
+
const state = reducer([], {type: ANSWER_EDIT.qcm, payload: ['value1', 'value2']});
|
|
17
|
+
t.deepEqual(state, ['value1', 'value2']);
|
|
18
|
+
});
|
|
19
|
+
|
|
20
|
+
test('should set the value of EDIT_QCM_GRAPHIC action', t => {
|
|
21
|
+
const state = reducer([], {type: ANSWER_EDIT.qcmGraphic, payload: ['True', 'False']});
|
|
22
|
+
t.deepEqual(state, ['True', 'False']);
|
|
23
|
+
});
|
|
24
|
+
|
|
25
|
+
test('should set the value of EDIT_QCM_DRAG action', t => {
|
|
26
|
+
const state = reducer([], {type: ANSWER_EDIT.qcmDrag, payload: ['value1', 'value2']});
|
|
27
|
+
t.deepEqual(state, ['value1', 'value2']);
|
|
28
|
+
});
|
|
29
|
+
|
|
30
|
+
test('should set the value of EDIT_SLIDER action', t => {
|
|
31
|
+
const state = reducer([], {type: ANSWER_EDIT.slider, payload: ['5']});
|
|
32
|
+
t.deepEqual(state, ['5']);
|
|
33
|
+
});
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import test from 'ava';
|
|
2
|
+
import reducer from '../current-slide-ref';
|
|
3
|
+
import {SetCurrentSlide, SET_CURRENT_SLIDE} from '../../../actions/ui/slides';
|
|
4
|
+
import {freeTextSlide} from '../../../views/slides/test/fixtures/free-text';
|
|
5
|
+
|
|
6
|
+
test('should have initial value', t => {
|
|
7
|
+
const state = reducer(undefined, {} as SetCurrentSlide);
|
|
8
|
+
t.is(state, '');
|
|
9
|
+
});
|
|
10
|
+
|
|
11
|
+
test('should set the value of SET_CURRENT_SLIDE action', t => {
|
|
12
|
+
const state = reducer('', {type: SET_CURRENT_SLIDE, payload: freeTextSlide});
|
|
13
|
+
t.is(state, 'sli_VJYjJnJhg');
|
|
14
|
+
});
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import test from 'ava';
|
|
2
|
+
import reducer from '../navigation';
|
|
3
|
+
import {NavigateTo, navigateBack, navigateTo} from '../../../actions/ui/navigation';
|
|
4
|
+
|
|
5
|
+
test('should have initial value', t => {
|
|
6
|
+
const state = reducer(undefined, {} as NavigateTo);
|
|
7
|
+
t.deepEqual(state, []);
|
|
8
|
+
});
|
|
9
|
+
|
|
10
|
+
test('should set the value of NAVIGATE_TO and NAVIGATE_BACK action', t => {
|
|
11
|
+
const state = reducer([], navigateTo('loader'));
|
|
12
|
+
t.deepEqual(state, ['loader']);
|
|
13
|
+
|
|
14
|
+
const updatedState = reducer(state, navigateTo('skills'));
|
|
15
|
+
t.deepEqual(updatedState, ['loader', 'skills']);
|
|
16
|
+
|
|
17
|
+
const _updatedState = reducer(updatedState, navigateBack());
|
|
18
|
+
t.deepEqual(_updatedState, ['loader']);
|
|
19
|
+
});
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import test from 'ava';
|
|
2
|
+
import reducer, {initialState} from '../slide';
|
|
3
|
+
import {EDIT_BASIC} from '../../../actions/ui/answers';
|
|
4
|
+
import {PostAnswerRequestAction} from '../../../actions/api/post-answer';
|
|
5
|
+
|
|
6
|
+
test('should use initial state if no answers are found when an EditAnswerAction is received', t => {
|
|
7
|
+
const state = reducer(undefined, {type: EDIT_BASIC, payload: ['']});
|
|
8
|
+
t.truthy(state);
|
|
9
|
+
t.false(state.validateButton);
|
|
10
|
+
});
|
|
11
|
+
|
|
12
|
+
test('should return state directly when there is no corresponding action handler + have an initial state', t => {
|
|
13
|
+
const state = reducer(undefined, {type: 'NOPE'} as unknown as PostAnswerRequestAction);
|
|
14
|
+
t.deepEqual(state, initialState);
|
|
15
|
+
});
|
|
@@ -6,7 +6,7 @@ import {toJSON} from './tools/fetch-responses';
|
|
|
6
6
|
|
|
7
7
|
export const fetchSlide = async (slideRef: string, token: string): Promise<SlideFromAPI | void> => {
|
|
8
8
|
const {host}: JWT = decode(token);
|
|
9
|
-
const response = await crossFetch(`${host}/api/v2/slide/${slideRef}`, {
|
|
9
|
+
const response = await crossFetch(`${host}/api/v2/slide/${slideRef}/parentContentTitle`, {
|
|
10
10
|
headers: {authorization: token}
|
|
11
11
|
});
|
|
12
12
|
|
package/src/services/index.ts
CHANGED
|
@@ -2,9 +2,11 @@ import {Services} from '../types/common';
|
|
|
2
2
|
import {fetchSkills} from './fetch-skills';
|
|
3
3
|
import {postProgression} from './post-progression';
|
|
4
4
|
import {fetchSlide} from './fetch-slide';
|
|
5
|
+
import {postAnswer} from './post-answer';
|
|
5
6
|
|
|
6
7
|
export const getServices = (): Services => ({
|
|
7
8
|
fetchSkills,
|
|
8
9
|
fetchSlide,
|
|
9
|
-
postProgression
|
|
10
|
+
postProgression,
|
|
11
|
+
postAnswer
|
|
10
12
|
});
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import crossFetch from 'cross-fetch';
|
|
2
|
+
import decode from 'jwt-decode';
|
|
3
|
+
|
|
4
|
+
import {JWT, ProgressionFromAPI} from '../types/common';
|
|
5
|
+
import {toJSON} from './tools/fetch-responses';
|
|
6
|
+
|
|
7
|
+
export const postAnswer = async (
|
|
8
|
+
skillRef: string,
|
|
9
|
+
token: string,
|
|
10
|
+
progressionId: string,
|
|
11
|
+
answer: string[]
|
|
12
|
+
): Promise<ProgressionFromAPI> => {
|
|
13
|
+
const {host}: JWT = decode(token);
|
|
14
|
+
const response = await crossFetch(`${host}/api/v2/progressions/${progressionId}/answers`, {
|
|
15
|
+
method: 'post',
|
|
16
|
+
headers: {authorization: token},
|
|
17
|
+
body: JSON.stringify({
|
|
18
|
+
content: {
|
|
19
|
+
ref: skillRef,
|
|
20
|
+
type: 'slide'
|
|
21
|
+
},
|
|
22
|
+
answer
|
|
23
|
+
})
|
|
24
|
+
});
|
|
25
|
+
|
|
26
|
+
return toJSON<ProgressionFromAPI>(response);
|
|
27
|
+
};
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import test from 'ava';
|
|
2
|
+
import nock from 'nock';
|
|
3
|
+
import {qcmDragSlide} from '../../views/slides/test/fixtures/qcm-drag';
|
|
4
|
+
import {fetchSlide} from '../fetch-slide';
|
|
5
|
+
|
|
6
|
+
test.before(() => {
|
|
7
|
+
nock('http://localhost:3000')
|
|
8
|
+
.get('/api/v2/slide/sli_123546/parentContentTitle')
|
|
9
|
+
.reply(200, qcmDragSlide);
|
|
10
|
+
});
|
|
11
|
+
|
|
12
|
+
test.after(() => {
|
|
13
|
+
nock.cleanAll();
|
|
14
|
+
});
|
|
15
|
+
|
|
16
|
+
test('should fetch a slide with the parentTitleContent info successfully', async t => {
|
|
17
|
+
const token = process.env.API_TEST_TOKEN || '';
|
|
18
|
+
const slide = await fetchSlide('sli_123546', token);
|
|
19
|
+
t.deepEqual(qcmDragSlide, slide);
|
|
20
|
+
});
|
|
21
|
+
|
|
22
|
+
test('should reject if a bad token is passed', async t => {
|
|
23
|
+
const badToken = 'token is not a jwt';
|
|
24
|
+
const error = await t.throwsAsync(() => fetchSlide('sli_123546', badToken));
|
|
25
|
+
|
|
26
|
+
t.is(
|
|
27
|
+
error?.message,
|
|
28
|
+
"Invalid token specified: Cannot read properties of undefined (reading 'replace')"
|
|
29
|
+
);
|
|
30
|
+
});
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
import test from 'ava';
|
|
2
|
+
import nock from 'nock';
|
|
3
|
+
import type {ProgressionFromAPI} from '../../types/common';
|
|
4
|
+
import {postAnswer} from '../post-answer';
|
|
5
|
+
|
|
6
|
+
const progressionId = '123456789123';
|
|
7
|
+
const skillRef = '_skill-ref';
|
|
8
|
+
const answer = ['Lister vos tâches pour vous libérer l’esprit', 'Vous isoler dans un lieu calme'];
|
|
9
|
+
|
|
10
|
+
const result: ProgressionFromAPI = {
|
|
11
|
+
content: {
|
|
12
|
+
type: 'skill',
|
|
13
|
+
ref: skillRef
|
|
14
|
+
},
|
|
15
|
+
engine: {
|
|
16
|
+
ref: 'review'
|
|
17
|
+
},
|
|
18
|
+
_id: '123456123456',
|
|
19
|
+
state: {
|
|
20
|
+
allAnswers: [
|
|
21
|
+
{
|
|
22
|
+
slideRef: 'sli_NkvrWPFF2',
|
|
23
|
+
isCorrect: true,
|
|
24
|
+
answer
|
|
25
|
+
}
|
|
26
|
+
],
|
|
27
|
+
isCorrect: true,
|
|
28
|
+
nextContent: {
|
|
29
|
+
type: 'slide',
|
|
30
|
+
ref: 'sli_NJ3m5KtWh'
|
|
31
|
+
},
|
|
32
|
+
pendingSlides: [],
|
|
33
|
+
slides: ['sli_NkvrWPFF2'],
|
|
34
|
+
content: {
|
|
35
|
+
ref: 'sli_NkvrWPFF2',
|
|
36
|
+
type: 'slide'
|
|
37
|
+
},
|
|
38
|
+
step: {
|
|
39
|
+
current: 2
|
|
40
|
+
},
|
|
41
|
+
stars: 4
|
|
42
|
+
}
|
|
43
|
+
};
|
|
44
|
+
|
|
45
|
+
test.before(() => {
|
|
46
|
+
const moocApi = nock('http://localhost:3000');
|
|
47
|
+
moocApi.post(`/api/v2/progressions/${progressionId}/answers`).reply(200, result);
|
|
48
|
+
});
|
|
49
|
+
|
|
50
|
+
test.after(() => {
|
|
51
|
+
nock.cleanAll();
|
|
52
|
+
});
|
|
53
|
+
|
|
54
|
+
test('should post the answers successfully', async t => {
|
|
55
|
+
const token = process.env.API_TEST_TOKEN || '';
|
|
56
|
+
const progression = await postAnswer(skillRef, token, progressionId, answer);
|
|
57
|
+
t.deepEqual(result, progression);
|
|
58
|
+
});
|
|
59
|
+
|
|
60
|
+
test('should reject bad token', async t => {
|
|
61
|
+
const badToken = 'token is not a jwt';
|
|
62
|
+
const error = await t.throwsAsync(() => postAnswer(skillRef, badToken, progressionId, answer));
|
|
63
|
+
|
|
64
|
+
t.is(
|
|
65
|
+
error?.message,
|
|
66
|
+
"Invalid token specified: Cannot read properties of undefined (reading 'replace')"
|
|
67
|
+
);
|
|
68
|
+
});
|
|
@@ -6,6 +6,13 @@ import {postProgression} from '../post-progression';
|
|
|
6
6
|
const skillRef = '_skill-ref';
|
|
7
7
|
const result: ProgressionFromAPI = {
|
|
8
8
|
_id: '123456123456',
|
|
9
|
+
content: {
|
|
10
|
+
ref: '_skill-ref',
|
|
11
|
+
type: 'skill'
|
|
12
|
+
},
|
|
13
|
+
engine: {
|
|
14
|
+
ref: 'review'
|
|
15
|
+
},
|
|
9
16
|
state: {
|
|
10
17
|
allAnswers: [],
|
|
11
18
|
isCorrect: true,
|
|
@@ -17,7 +24,8 @@ const result: ProgressionFromAPI = {
|
|
|
17
24
|
slides: [],
|
|
18
25
|
step: {
|
|
19
26
|
current: 1
|
|
20
|
-
}
|
|
27
|
+
},
|
|
28
|
+
stars: 0
|
|
21
29
|
}
|
|
22
30
|
};
|
|
23
31
|
|