@coorpacademy/app-review 0.6.0 → 0.6.1-alpha.0
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/lib/actions/api/fetch-correction.js +25 -0
- package/lib/actions/api/fetch-rank.js +43 -0
- package/lib/actions/api/fetch-skills.js +23 -0
- package/lib/actions/api/fetch-slide.js +38 -0
- package/lib/actions/api/post-answer.js +43 -0
- package/lib/actions/api/post-progression.js +27 -0
- package/lib/actions/data/token.js +9 -0
- package/lib/actions/ui/answers.js +61 -0
- package/lib/actions/ui/navigation.js +31 -0
- package/lib/actions/ui/next-slide.js +28 -0
- package/lib/actions/ui/quit-popin.js +11 -0
- package/lib/actions/ui/slides.js +9 -0
- package/lib/common/index.js +17 -0
- package/lib/configure-store.js +27 -0
- package/lib/helpers/css-register.js +7 -0
- package/lib/index.js +101 -0
- package/lib/reducers/data/corrections.js +26 -0
- package/lib/reducers/data/index.js +13 -0
- package/lib/reducers/data/progression.js +18 -0
- package/lib/reducers/data/rank.js +32 -0
- package/lib/reducers/data/skills.js +13 -0
- package/lib/reducers/data/slides.js +25 -0
- package/lib/reducers/data/token.js +13 -0
- package/lib/reducers/index.js +12 -0
- package/lib/reducers/ui/answers.js +27 -0
- package/lib/reducers/ui/current-slide-ref.js +18 -0
- package/lib/reducers/ui/index.js +22 -0
- package/lib/reducers/ui/navigation.js +20 -0
- package/lib/reducers/ui/positions.js +32 -0
- package/lib/reducers/ui/quit-popin.js +18 -0
- package/lib/reducers/ui/show-congrats.js +22 -0
- package/lib/reducers/ui/slide.js +53 -0
- package/lib/services/fetch-correction.js +21 -0
- package/lib/services/fetch-rank.js +17 -0
- package/lib/services/fetch-skills.js +17 -0
- package/lib/services/fetch-slide.js +17 -0
- package/lib/services/fetch-slides-to-review-by-skill-ref.js +15 -0
- package/lib/services/index.js +20 -0
- package/lib/services/post-answer.js +27 -0
- package/lib/services/post-progression.js +28 -0
- package/lib/services/tools/fetch-responses.js +40 -0
- package/lib/services/tools/sleep.js +7 -0
- package/lib/types/common.js +2 -0
- package/lib/types/slides.js +2 -0
- package/lib/{src/views → views}/skills/index.js +8 -4
- package/lib/views/slides/index.js +325 -0
- package/lib/views/slides/map-api-slide-to-ui.js +177 -0
- package/package.json +5 -13
- package/es/sandbox/index.d.ts +0 -9
- package/es/sandbox/index.js +0 -41
- package/es/src/actions/test/create-test-store.d.ts +0 -5
- package/es/src/actions/test/create-test-store.js +0 -16
- package/es/src/test/index.test.d.ts +0 -1
- package/es/src/test/index.test.js +0 -66
- package/es/src/test/util/services.mock.d.ts +0 -7
- package/es/src/test/util/services.mock.js +0 -444
- package/es/src/views/slides/test/fixtures/free-text.d.ts +0 -4
- package/es/src/views/slides/test/fixtures/free-text.js +0 -38
- package/es/src/views/slides/test/fixtures/qcm-drag.d.ts +0 -4
- package/es/src/views/slides/test/fixtures/qcm-drag.js +0 -108
- package/es/src/views/slides/test/fixtures/qcm-graphic.d.ts +0 -4
- package/es/src/views/slides/test/fixtures/qcm-graphic.js +0 -252
- package/es/src/views/slides/test/fixtures/qcm.d.ts +0 -4
- package/es/src/views/slides/test/fixtures/qcm.js +0 -109
- package/es/src/views/slides/test/fixtures/slider.d.ts +0 -4
- package/es/src/views/slides/test/fixtures/slider.js +0 -37
- package/es/src/views/slides/test/fixtures/template.d.ts +0 -4
- package/es/src/views/slides/test/fixtures/template.js +0 -170
- package/lib/sandbox/index.d.ts +0 -9
- package/lib/sandbox/index.js +0 -43
- package/lib/src/actions/api/fetch-correction.js +0 -19
- package/lib/src/actions/api/fetch-rank.js +0 -38
- package/lib/src/actions/api/fetch-skills.js +0 -17
- package/lib/src/actions/api/fetch-slide.js +0 -81
- package/lib/src/actions/api/post-answer.js +0 -92
- package/lib/src/actions/api/post-progression.js +0 -72
- package/lib/src/actions/data/token.js +0 -5
- package/lib/src/actions/test/create-test-store.d.ts +0 -5
- package/lib/src/actions/test/create-test-store.js +0 -18
- package/lib/src/actions/ui/answers.js +0 -65
- package/lib/src/actions/ui/navigation.js +0 -86
- package/lib/src/actions/ui/next-slide.js +0 -21
- package/lib/src/actions/ui/quit-popin.js +0 -8
- package/lib/src/actions/ui/slides.js +0 -5
- package/lib/src/common/index.js +0 -10
- package/lib/src/configure-store.js +0 -21
- package/lib/src/helpers/css-register.js +0 -2
- package/lib/src/index.js +0 -86
- package/lib/src/reducers/data/corrections.js +0 -22
- package/lib/src/reducers/data/index.js +0 -8
- package/lib/src/reducers/data/progression.js +0 -17
- package/lib/src/reducers/data/rank.js +0 -28
- package/lib/src/reducers/data/skills.js +0 -12
- package/lib/src/reducers/data/slides.js +0 -20
- package/lib/src/reducers/data/token.js +0 -12
- package/lib/src/reducers/index.js +0 -7
- package/lib/src/reducers/ui/answers.js +0 -25
- package/lib/src/reducers/ui/current-slide-ref.js +0 -17
- package/lib/src/reducers/ui/index.js +0 -17
- package/lib/src/reducers/ui/navigation.js +0 -28
- package/lib/src/reducers/ui/positions.js +0 -28
- package/lib/src/reducers/ui/quit-popin.js +0 -17
- package/lib/src/reducers/ui/show-congrats.js +0 -21
- package/lib/src/reducers/ui/slide.js +0 -48
- package/lib/src/services/fetch-correction.js +0 -58
- package/lib/src/services/fetch-rank.js +0 -54
- package/lib/src/services/fetch-skills.js +0 -54
- package/lib/src/services/fetch-slide.js +0 -54
- package/lib/src/services/fetch-slides-to-review-by-skill-ref.js +0 -52
- package/lib/src/services/index.js +0 -16
- package/lib/src/services/post-answer.js +0 -64
- package/lib/src/services/post-progression.js +0 -65
- package/lib/src/services/tools/fetch-responses.js +0 -112
- package/lib/src/services/tools/sleep.js +0 -5
- package/lib/src/test/index.test.d.ts +0 -1
- package/lib/src/test/index.test.js +0 -170
- package/lib/src/test/util/services.mock.d.ts +0 -7
- package/lib/src/test/util/services.mock.js +0 -448
- package/lib/src/types/common.js +0 -1
- package/lib/src/types/slides.js +0 -1
- package/lib/src/views/slides/index.js +0 -315
- package/lib/src/views/slides/map-api-slide-to-ui.js +0 -188
- package/lib/src/views/slides/test/fixtures/free-text.d.ts +0 -4
- package/lib/src/views/slides/test/fixtures/free-text.js +0 -38
- package/lib/src/views/slides/test/fixtures/qcm-drag.d.ts +0 -4
- package/lib/src/views/slides/test/fixtures/qcm-drag.js +0 -108
- package/lib/src/views/slides/test/fixtures/qcm-graphic.d.ts +0 -4
- package/lib/src/views/slides/test/fixtures/qcm-graphic.js +0 -252
- package/lib/src/views/slides/test/fixtures/qcm.d.ts +0 -4
- package/lib/src/views/slides/test/fixtures/qcm.js +0 -109
- package/lib/src/views/slides/test/fixtures/slider.d.ts +0 -4
- package/lib/src/views/slides/test/fixtures/slider.js +0 -37
- package/lib/src/views/slides/test/fixtures/template.d.ts +0 -4
- package/lib/src/views/slides/test/fixtures/template.js +0 -170
- package/src/actions/api/fetch-correction.ts +0 -39
- package/src/actions/api/fetch-rank.ts +0 -91
- package/src/actions/api/fetch-skills.ts +0 -31
- package/src/actions/api/fetch-slide.ts +0 -54
- package/src/actions/api/post-answer.ts +0 -55
- package/src/actions/api/post-progression.ts +0 -37
- package/src/actions/api/test/fetch-correction.test.ts +0 -119
- package/src/actions/api/test/fetch-rank.test.ts +0 -138
- package/src/actions/api/test/fetch-skills.test.ts +0 -78
- package/src/actions/api/test/fetch-slide.test.ts +0 -85
- package/src/actions/api/test/post-answer.test.ts +0 -266
- package/src/actions/api/test/post-progression.test.ts +0 -127
- package/src/actions/data/test/token.test.ts +0 -32
- package/src/actions/data/token.ts +0 -11
- package/src/actions/test/create-test-store.ts +0 -25
- package/src/actions/ui/answers.ts +0 -77
- package/src/actions/ui/navigation.ts +0 -62
- package/src/actions/ui/next-slide.ts +0 -44
- package/src/actions/ui/quit-popin.ts +0 -10
- package/src/actions/ui/slides.ts +0 -26
- package/src/actions/ui/test/answers.test.ts +0 -174
- package/src/actions/ui/test/navigation.test.ts +0 -95
- package/src/actions/ui/test/next-slide.test.ts +0 -87
- package/src/actions/ui/test/quit-popin.test.ts +0 -39
- package/src/actions/ui/test/slides.test.ts +0 -33
- package/src/common/index.ts +0 -15
- package/src/common/test/get-progression-slide-ref.test.ts +0 -35
- package/src/configure-store.ts +0 -28
- package/src/helpers/css-modules-require-hook.d.ts +0 -4
- package/src/helpers/css-register.ts +0 -3
- package/src/index.tsx +0 -107
- package/src/reducers/data/corrections.ts +0 -36
- package/src/reducers/data/index.ts +0 -19
- package/src/reducers/data/progression.ts +0 -23
- package/src/reducers/data/rank.ts +0 -44
- package/src/reducers/data/skills.ts +0 -16
- package/src/reducers/data/slides.ts +0 -31
- package/src/reducers/data/test/corrections.test.ts +0 -36
- package/src/reducers/data/test/progression.test.ts +0 -28
- package/src/reducers/data/test/rank.test.ts +0 -59
- package/src/reducers/data/test/skills.test.ts +0 -14
- package/src/reducers/data/test/slides.test.ts +0 -27
- package/src/reducers/data/test/token.test.ts +0 -13
- package/src/reducers/data/token.ts +0 -15
- package/src/reducers/index.ts +0 -14
- package/src/reducers/ui/answers.ts +0 -41
- package/src/reducers/ui/current-slide-ref.ts +0 -22
- package/src/reducers/ui/index.ts +0 -29
- package/src/reducers/ui/navigation.ts +0 -29
- package/src/reducers/ui/positions.ts +0 -34
- package/src/reducers/ui/quit-popin.ts +0 -22
- package/src/reducers/ui/show-congrats.ts +0 -26
- package/src/reducers/ui/slide.ts +0 -87
- package/src/reducers/ui/test/answers.test.ts +0 -105
- package/src/reducers/ui/test/current-slide-ref.test.ts +0 -14
- package/src/reducers/ui/test/navigation.test.ts +0 -19
- package/src/reducers/ui/test/positions.test.ts +0 -82
- package/src/reducers/ui/test/quit-popin.test.ts +0 -24
- package/src/reducers/ui/test/show-congrats.test.ts +0 -40
- package/src/reducers/ui/test/slide.test.ts +0 -110
- package/src/services/fetch-correction.ts +0 -26
- package/src/services/fetch-rank.ts +0 -14
- package/src/services/fetch-skills.ts +0 -14
- package/src/services/fetch-slide.ts +0 -14
- package/src/services/fetch-slides-to-review-by-skill-ref.ts +0 -18
- package/src/services/index.ts +0 -18
- package/src/services/post-answer.ts +0 -28
- package/src/services/post-progression.ts +0 -28
- package/src/services/test/fetch-correction.test.ts +0 -55
- package/src/services/test/fetch-rank.test.ts +0 -34
- package/src/services/test/fetch-skills.test.ts +0 -39
- package/src/services/test/fetch-slide.test.ts +0 -30
- package/src/services/test/fetch-slides-to-review-by-skill-ref.test.ts +0 -51
- package/src/services/test/post-answer.test.ts +0 -100
- package/src/services/test/post-progression.test.ts +0 -66
- package/src/services/tools/fetch-responses.ts +0 -40
- package/src/services/tools/sleep.ts +0 -4
- package/src/test/index.test.tsx +0 -99
- package/src/test/util/services.mock.ts +0 -465
- package/src/types/common.ts +0 -207
- package/src/types/globals.d.ts +0 -4
- package/src/types/slides.ts +0 -98
- package/src/views/skills/index.ts +0 -48
- package/src/views/skills/test/skills.test.ts +0 -104
- package/src/views/slides/index.ts +0 -398
- package/src/views/slides/map-api-slide-to-ui.ts +0 -287
- package/src/views/slides/test/fixtures/free-text.ts +0 -44
- package/src/views/slides/test/fixtures/qcm-drag.ts +0 -112
- package/src/views/slides/test/fixtures/qcm-graphic.ts +0 -264
- package/src/views/slides/test/fixtures/qcm.ts +0 -120
- package/src/views/slides/test/fixtures/slider.ts +0 -43
- package/src/views/slides/test/fixtures/template.ts +0 -177
- package/src/views/slides/test/header.on-click.test.ts +0 -46
- package/src/views/slides/test/index.test.ts +0 -1515
- package/src/views/slides/test/map-api-slide-to-ui.test.ts +0 -52
- package/src/views/slides/test/on-quit-popin.on-click.test.ts +0 -66
- package/src/views/slides/test/slide.free-text.on-change.test.ts +0 -116
- package/src/views/slides/test/slide.next-slide.on-click.test.ts +0 -178
- package/src/views/slides/test/slide.qcm-drag.on-click.test.ts +0 -90
- package/src/views/slides/test/slide.qcm-graphic.on-click.test.ts +0 -90
- package/src/views/slides/test/slide.qcm.on-click.test.ts +0 -92
- package/src/views/slides/test/slide.slider.on-change.test.ts +0 -92
- package/src/views/slides/test/slide.slider.on-slider-change.test.ts +0 -91
- package/src/views/slides/test/slide.template.on-change.test.ts +0 -126
- /package/es/{src/actions → actions}/api/fetch-correction.d.ts +0 -0
- /package/es/{src/actions → actions}/api/fetch-correction.js +0 -0
- /package/es/{src/actions → actions}/api/fetch-rank.d.ts +0 -0
- /package/es/{src/actions → actions}/api/fetch-rank.js +0 -0
- /package/es/{src/actions → actions}/api/fetch-skills.d.ts +0 -0
- /package/es/{src/actions → actions}/api/fetch-skills.js +0 -0
- /package/es/{src/actions → actions}/api/fetch-slide.d.ts +0 -0
- /package/es/{src/actions → actions}/api/fetch-slide.js +0 -0
- /package/es/{src/actions → actions}/api/post-answer.d.ts +0 -0
- /package/es/{src/actions → actions}/api/post-answer.js +0 -0
- /package/es/{src/actions → actions}/api/post-progression.d.ts +0 -0
- /package/es/{src/actions → actions}/api/post-progression.js +0 -0
- /package/es/{src/actions → actions}/data/token.d.ts +0 -0
- /package/es/{src/actions → actions}/data/token.js +0 -0
- /package/es/{src/actions → actions}/ui/answers.d.ts +0 -0
- /package/es/{src/actions → actions}/ui/answers.js +0 -0
- /package/es/{src/actions → actions}/ui/navigation.d.ts +0 -0
- /package/es/{src/actions → actions}/ui/navigation.js +0 -0
- /package/es/{src/actions → actions}/ui/next-slide.d.ts +0 -0
- /package/es/{src/actions → actions}/ui/next-slide.js +0 -0
- /package/es/{src/actions → actions}/ui/quit-popin.d.ts +0 -0
- /package/es/{src/actions → actions}/ui/quit-popin.js +0 -0
- /package/es/{src/actions → actions}/ui/slides.d.ts +0 -0
- /package/es/{src/actions → actions}/ui/slides.js +0 -0
- /package/es/{src/common → common}/index.d.ts +0 -0
- /package/es/{src/common → common}/index.js +0 -0
- /package/es/{src/configure-store.d.ts → configure-store.d.ts} +0 -0
- /package/es/{src/configure-store.js → configure-store.js} +0 -0
- /package/es/{src/helpers → helpers}/css-register.d.ts +0 -0
- /package/es/{src/helpers → helpers}/css-register.js +0 -0
- /package/es/{src/index.d.ts → index.d.ts} +0 -0
- /package/es/{src/index.js → index.js} +0 -0
- /package/es/{src/reducers → reducers}/data/corrections.d.ts +0 -0
- /package/es/{src/reducers → reducers}/data/corrections.js +0 -0
- /package/es/{src/reducers → reducers}/data/index.d.ts +0 -0
- /package/es/{src/reducers → reducers}/data/index.js +0 -0
- /package/es/{src/reducers → reducers}/data/progression.d.ts +0 -0
- /package/es/{src/reducers → reducers}/data/progression.js +0 -0
- /package/es/{src/reducers → reducers}/data/rank.d.ts +0 -0
- /package/es/{src/reducers → reducers}/data/rank.js +0 -0
- /package/es/{src/reducers → reducers}/data/skills.d.ts +0 -0
- /package/es/{src/reducers → reducers}/data/skills.js +0 -0
- /package/es/{src/reducers → reducers}/data/slides.d.ts +0 -0
- /package/es/{src/reducers → reducers}/data/slides.js +0 -0
- /package/es/{src/reducers → reducers}/data/token.d.ts +0 -0
- /package/es/{src/reducers → reducers}/data/token.js +0 -0
- /package/es/{src/reducers → reducers}/index.d.ts +0 -0
- /package/es/{src/reducers → reducers}/index.js +0 -0
- /package/es/{src/reducers → reducers}/ui/answers.d.ts +0 -0
- /package/es/{src/reducers → reducers}/ui/answers.js +0 -0
- /package/es/{src/reducers → reducers}/ui/current-slide-ref.d.ts +0 -0
- /package/es/{src/reducers → reducers}/ui/current-slide-ref.js +0 -0
- /package/es/{src/reducers → reducers}/ui/index.d.ts +0 -0
- /package/es/{src/reducers → reducers}/ui/index.js +0 -0
- /package/es/{src/reducers → reducers}/ui/navigation.d.ts +0 -0
- /package/es/{src/reducers → reducers}/ui/navigation.js +0 -0
- /package/es/{src/reducers → reducers}/ui/positions.d.ts +0 -0
- /package/es/{src/reducers → reducers}/ui/positions.js +0 -0
- /package/es/{src/reducers → reducers}/ui/quit-popin.d.ts +0 -0
- /package/es/{src/reducers → reducers}/ui/quit-popin.js +0 -0
- /package/es/{src/reducers → reducers}/ui/show-congrats.d.ts +0 -0
- /package/es/{src/reducers → reducers}/ui/show-congrats.js +0 -0
- /package/es/{src/reducers → reducers}/ui/slide.d.ts +0 -0
- /package/es/{src/reducers → reducers}/ui/slide.js +0 -0
- /package/es/{src/services → services}/fetch-correction.d.ts +0 -0
- /package/es/{src/services → services}/fetch-correction.js +0 -0
- /package/es/{src/services → services}/fetch-rank.d.ts +0 -0
- /package/es/{src/services → services}/fetch-rank.js +0 -0
- /package/es/{src/services → services}/fetch-skills.d.ts +0 -0
- /package/es/{src/services → services}/fetch-skills.js +0 -0
- /package/es/{src/services → services}/fetch-slide.d.ts +0 -0
- /package/es/{src/services → services}/fetch-slide.js +0 -0
- /package/es/{src/services → services}/fetch-slides-to-review-by-skill-ref.d.ts +0 -0
- /package/es/{src/services → services}/fetch-slides-to-review-by-skill-ref.js +0 -0
- /package/es/{src/services → services}/index.d.ts +0 -0
- /package/es/{src/services → services}/index.js +0 -0
- /package/es/{src/services → services}/post-answer.d.ts +0 -0
- /package/es/{src/services → services}/post-answer.js +0 -0
- /package/es/{src/services → services}/post-progression.d.ts +0 -0
- /package/es/{src/services → services}/post-progression.js +0 -0
- /package/es/{src/services → services}/tools/fetch-responses.d.ts +0 -0
- /package/es/{src/services → services}/tools/fetch-responses.js +0 -0
- /package/es/{src/services → services}/tools/sleep.d.ts +0 -0
- /package/es/{src/services → services}/tools/sleep.js +0 -0
- /package/es/{src/types → types}/common.d.ts +0 -0
- /package/es/{src/types → types}/common.js +0 -0
- /package/es/{src/types → types}/slides.d.ts +0 -0
- /package/es/{src/types → types}/slides.js +0 -0
- /package/es/{src/views → views}/skills/index.d.ts +0 -0
- /package/es/{src/views → views}/skills/index.js +0 -0
- /package/es/{src/views → views}/slides/index.d.ts +0 -0
- /package/es/{src/views → views}/slides/index.js +0 -0
- /package/es/{src/views → views}/slides/map-api-slide-to-ui.d.ts +0 -0
- /package/es/{src/views → views}/slides/map-api-slide-to-ui.js +0 -0
- /package/lib/{src/actions → actions}/api/fetch-correction.d.ts +0 -0
- /package/lib/{src/actions → actions}/api/fetch-rank.d.ts +0 -0
- /package/lib/{src/actions → actions}/api/fetch-skills.d.ts +0 -0
- /package/lib/{src/actions → actions}/api/fetch-slide.d.ts +0 -0
- /package/lib/{src/actions → actions}/api/post-answer.d.ts +0 -0
- /package/lib/{src/actions → actions}/api/post-progression.d.ts +0 -0
- /package/lib/{src/actions → actions}/data/token.d.ts +0 -0
- /package/lib/{src/actions → actions}/ui/answers.d.ts +0 -0
- /package/lib/{src/actions → actions}/ui/navigation.d.ts +0 -0
- /package/lib/{src/actions → actions}/ui/next-slide.d.ts +0 -0
- /package/lib/{src/actions → actions}/ui/quit-popin.d.ts +0 -0
- /package/lib/{src/actions → actions}/ui/slides.d.ts +0 -0
- /package/lib/{src/common → common}/index.d.ts +0 -0
- /package/lib/{src/configure-store.d.ts → configure-store.d.ts} +0 -0
- /package/lib/{src/helpers → helpers}/css-register.d.ts +0 -0
- /package/lib/{src/index.d.ts → index.d.ts} +0 -0
- /package/lib/{src/reducers → reducers}/data/corrections.d.ts +0 -0
- /package/lib/{src/reducers → reducers}/data/index.d.ts +0 -0
- /package/lib/{src/reducers → reducers}/data/progression.d.ts +0 -0
- /package/lib/{src/reducers → reducers}/data/rank.d.ts +0 -0
- /package/lib/{src/reducers → reducers}/data/skills.d.ts +0 -0
- /package/lib/{src/reducers → reducers}/data/slides.d.ts +0 -0
- /package/lib/{src/reducers → reducers}/data/token.d.ts +0 -0
- /package/lib/{src/reducers → reducers}/index.d.ts +0 -0
- /package/lib/{src/reducers → reducers}/ui/answers.d.ts +0 -0
- /package/lib/{src/reducers → reducers}/ui/current-slide-ref.d.ts +0 -0
- /package/lib/{src/reducers → reducers}/ui/index.d.ts +0 -0
- /package/lib/{src/reducers → reducers}/ui/navigation.d.ts +0 -0
- /package/lib/{src/reducers → reducers}/ui/positions.d.ts +0 -0
- /package/lib/{src/reducers → reducers}/ui/quit-popin.d.ts +0 -0
- /package/lib/{src/reducers → reducers}/ui/show-congrats.d.ts +0 -0
- /package/lib/{src/reducers → reducers}/ui/slide.d.ts +0 -0
- /package/lib/{src/services → services}/fetch-correction.d.ts +0 -0
- /package/lib/{src/services → services}/fetch-rank.d.ts +0 -0
- /package/lib/{src/services → services}/fetch-skills.d.ts +0 -0
- /package/lib/{src/services → services}/fetch-slide.d.ts +0 -0
- /package/lib/{src/services → services}/fetch-slides-to-review-by-skill-ref.d.ts +0 -0
- /package/lib/{src/services → services}/index.d.ts +0 -0
- /package/lib/{src/services → services}/post-answer.d.ts +0 -0
- /package/lib/{src/services → services}/post-progression.d.ts +0 -0
- /package/lib/{src/services → services}/tools/fetch-responses.d.ts +0 -0
- /package/lib/{src/services → services}/tools/sleep.d.ts +0 -0
- /package/lib/{src/types → types}/common.d.ts +0 -0
- /package/lib/{src/types → types}/slides.d.ts +0 -0
- /package/lib/{src/views → views}/skills/index.d.ts +0 -0
- /package/lib/{src/views → views}/slides/index.d.ts +0 -0
- /package/lib/{src/views → views}/slides/map-api-slide-to-ui.d.ts +0 -0
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
import set from 'lodash/fp/set';
|
|
2
|
-
import { CORRECTION_FETCH_SUCCESS, CORRECTION_FETCH_REQUEST } from '../../actions/api/fetch-correction';
|
|
3
|
-
var initialState = {};
|
|
4
|
-
var reducer = function (
|
|
5
|
-
// eslint-disable-next-line default-param-last
|
|
6
|
-
state, action) {
|
|
7
|
-
if (state === void 0) { state = initialState; }
|
|
8
|
-
switch (action.type) {
|
|
9
|
-
case CORRECTION_FETCH_REQUEST: {
|
|
10
|
-
var meta = action.meta;
|
|
11
|
-
return set([meta.slideRef], null, state);
|
|
12
|
-
}
|
|
13
|
-
case CORRECTION_FETCH_SUCCESS: {
|
|
14
|
-
var meta = action.meta;
|
|
15
|
-
var correction = action.payload;
|
|
16
|
-
return set([meta.slideRef], correction, state);
|
|
17
|
-
}
|
|
18
|
-
default:
|
|
19
|
-
return state;
|
|
20
|
-
}
|
|
21
|
-
};
|
|
22
|
-
export default reducer;
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import { combineReducers } from 'redux';
|
|
2
|
-
import corrections from './corrections';
|
|
3
|
-
import progression from './progression';
|
|
4
|
-
import skills from './skills';
|
|
5
|
-
import slides from './slides';
|
|
6
|
-
import token from './token';
|
|
7
|
-
import rank from './rank';
|
|
8
|
-
export default combineReducers({ corrections: corrections, progression: progression, skills: skills, slides: slides, token: token, rank: rank });
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import { POST_ANSWER_SUCCESS } from '../../actions/api/post-answer';
|
|
2
|
-
import { POST_PROGRESSION_SUCCESS } from '../../actions/api/post-progression';
|
|
3
|
-
var reducer = function (
|
|
4
|
-
// eslint-disable-next-line default-param-last
|
|
5
|
-
state, action) {
|
|
6
|
-
if (state === void 0) { state = null; }
|
|
7
|
-
switch (action.type) {
|
|
8
|
-
case POST_ANSWER_SUCCESS:
|
|
9
|
-
case POST_PROGRESSION_SUCCESS: {
|
|
10
|
-
var progression = action.payload;
|
|
11
|
-
return progression;
|
|
12
|
-
}
|
|
13
|
-
default:
|
|
14
|
-
return state;
|
|
15
|
-
}
|
|
16
|
-
};
|
|
17
|
-
export default reducer;
|
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
import set from 'lodash/fp/set';
|
|
2
|
-
import { POST_PROGRESSION_SUCCESS } from '../../actions/api/post-progression';
|
|
3
|
-
import { RANK_FETCH_START_SUCCESS, RANK_FETCH_END_SUCCESS } from '../../actions/api/fetch-rank';
|
|
4
|
-
var initialState = {
|
|
5
|
-
start: Number.NaN,
|
|
6
|
-
end: Number.NaN
|
|
7
|
-
};
|
|
8
|
-
var reducer = function (
|
|
9
|
-
// eslint-disable-next-line default-param-last
|
|
10
|
-
state, action) {
|
|
11
|
-
if (state === void 0) { state = initialState; }
|
|
12
|
-
switch (action.type) {
|
|
13
|
-
case POST_PROGRESSION_SUCCESS: {
|
|
14
|
-
return initialState;
|
|
15
|
-
}
|
|
16
|
-
case RANK_FETCH_START_SUCCESS: {
|
|
17
|
-
var payload = action.payload;
|
|
18
|
-
return set('start', payload.rank, state);
|
|
19
|
-
}
|
|
20
|
-
case RANK_FETCH_END_SUCCESS: {
|
|
21
|
-
var payload = action.payload;
|
|
22
|
-
return set('end', payload.rank, state);
|
|
23
|
-
}
|
|
24
|
-
default:
|
|
25
|
-
return state;
|
|
26
|
-
}
|
|
27
|
-
};
|
|
28
|
-
export default reducer;
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import { SKILLS_FETCH_SUCCESS } from '../../actions/api/fetch-skills';
|
|
2
|
-
// eslint-disable-next-line default-param-last
|
|
3
|
-
var reducer = function (state, action) {
|
|
4
|
-
if (state === void 0) { state = []; }
|
|
5
|
-
switch (action.type) {
|
|
6
|
-
case SKILLS_FETCH_SUCCESS:
|
|
7
|
-
return action.payload;
|
|
8
|
-
default:
|
|
9
|
-
return state;
|
|
10
|
-
}
|
|
11
|
-
};
|
|
12
|
-
export default reducer;
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
import set from 'lodash/fp/set';
|
|
2
|
-
import { SLIDE_FETCH_REQUEST, SLIDE_FETCH_SUCCESS } from '../../actions/api/fetch-slide';
|
|
3
|
-
export var initialState = {};
|
|
4
|
-
// eslint-disable-next-line default-param-last
|
|
5
|
-
var reducer = function (state, action) {
|
|
6
|
-
if (state === void 0) { state = initialState; }
|
|
7
|
-
switch (action.type) {
|
|
8
|
-
case SLIDE_FETCH_REQUEST: {
|
|
9
|
-
var meta = action.meta;
|
|
10
|
-
return set([meta.slideRef], null, state);
|
|
11
|
-
}
|
|
12
|
-
case SLIDE_FETCH_SUCCESS: {
|
|
13
|
-
var slide = action.payload;
|
|
14
|
-
return set([slide._id], slide, state);
|
|
15
|
-
}
|
|
16
|
-
default:
|
|
17
|
-
return state;
|
|
18
|
-
}
|
|
19
|
-
};
|
|
20
|
-
export default reducer;
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import { STORE_TOKEN } from '../../actions/data/token';
|
|
2
|
-
// eslint-disable-next-line default-param-last
|
|
3
|
-
var reducer = function (state, action) {
|
|
4
|
-
if (state === void 0) { state = ''; }
|
|
5
|
-
switch (action.type) {
|
|
6
|
-
case STORE_TOKEN:
|
|
7
|
-
return action.payload;
|
|
8
|
-
default:
|
|
9
|
-
return state;
|
|
10
|
-
}
|
|
11
|
-
};
|
|
12
|
-
export default reducer;
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
import { set } from 'lodash/fp';
|
|
2
|
-
import { EDIT_BASIC, EDIT_QCM, EDIT_QCM_DRAG, EDIT_QCM_GRAPHIC, EDIT_SLIDER, EDIT_TEMPLATE } from '../../actions/ui/answers';
|
|
3
|
-
import { NEXT_SLIDE } from '../../actions/ui/next-slide';
|
|
4
|
-
export var initialState = {};
|
|
5
|
-
var reducer = function (
|
|
6
|
-
// eslint-disable-next-line default-param-last
|
|
7
|
-
state, action) {
|
|
8
|
-
if (state === void 0) { state = initialState; }
|
|
9
|
-
switch (action.type) {
|
|
10
|
-
case EDIT_QCM:
|
|
11
|
-
case EDIT_QCM_GRAPHIC:
|
|
12
|
-
case EDIT_QCM_DRAG:
|
|
13
|
-
case EDIT_TEMPLATE:
|
|
14
|
-
case EDIT_BASIC:
|
|
15
|
-
case EDIT_SLIDER: {
|
|
16
|
-
return set([action.meta.slideRef], action.payload, initialState);
|
|
17
|
-
}
|
|
18
|
-
case NEXT_SLIDE: {
|
|
19
|
-
return set([action.payload.nextSlideRef], [], state);
|
|
20
|
-
}
|
|
21
|
-
default:
|
|
22
|
-
return state;
|
|
23
|
-
}
|
|
24
|
-
};
|
|
25
|
-
export default reducer;
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import { NEXT_SLIDE } from '../../actions/ui/next-slide';
|
|
2
|
-
import { SET_CURRENT_SLIDE } from '../../actions/ui/slides';
|
|
3
|
-
var reducer = function (
|
|
4
|
-
// eslint-disable-next-line default-param-last
|
|
5
|
-
state, action) {
|
|
6
|
-
if (state === void 0) { state = ''; }
|
|
7
|
-
switch (action.type) {
|
|
8
|
-
case NEXT_SLIDE:
|
|
9
|
-
return action.payload.nextSlideRef;
|
|
10
|
-
case SET_CURRENT_SLIDE: {
|
|
11
|
-
return action.payload._id;
|
|
12
|
-
}
|
|
13
|
-
default:
|
|
14
|
-
return state;
|
|
15
|
-
}
|
|
16
|
-
};
|
|
17
|
-
export default reducer;
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import { combineReducers } from 'redux';
|
|
2
|
-
import currentSlideRef from './current-slide-ref';
|
|
3
|
-
import navigation from './navigation';
|
|
4
|
-
import answers from './answers';
|
|
5
|
-
import positions from './positions';
|
|
6
|
-
import slide from './slide';
|
|
7
|
-
import showQuitPopin from './quit-popin';
|
|
8
|
-
import showCongrats from './show-congrats';
|
|
9
|
-
export default combineReducers({
|
|
10
|
-
currentSlideRef: currentSlideRef,
|
|
11
|
-
navigation: navigation,
|
|
12
|
-
answers: answers,
|
|
13
|
-
slide: slide,
|
|
14
|
-
positions: positions,
|
|
15
|
-
showQuitPopin: showQuitPopin,
|
|
16
|
-
showCongrats: showCongrats
|
|
17
|
-
});
|
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
|
|
2
|
-
if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
|
|
3
|
-
if (ar || !(i in from)) {
|
|
4
|
-
if (!ar) ar = Array.prototype.slice.call(from, 0, i);
|
|
5
|
-
ar[i] = from[i];
|
|
6
|
-
}
|
|
7
|
-
}
|
|
8
|
-
return to.concat(ar || Array.prototype.slice.call(from));
|
|
9
|
-
};
|
|
10
|
-
import { NAVIGATE_TO, NAVIGATE_BACK } from '../../actions/ui/navigation';
|
|
11
|
-
var reducer = function (
|
|
12
|
-
// eslint-disable-next-line default-param-last
|
|
13
|
-
state, action) {
|
|
14
|
-
if (state === void 0) { state = []; }
|
|
15
|
-
switch (action.type) {
|
|
16
|
-
case NAVIGATE_TO: {
|
|
17
|
-
return __spreadArray(__spreadArray([], state, true), [action.payload], false);
|
|
18
|
-
}
|
|
19
|
-
case NAVIGATE_BACK: {
|
|
20
|
-
var newState = __spreadArray([], state, true);
|
|
21
|
-
newState.pop();
|
|
22
|
-
return newState;
|
|
23
|
-
}
|
|
24
|
-
default:
|
|
25
|
-
return state;
|
|
26
|
-
}
|
|
27
|
-
};
|
|
28
|
-
export default reducer;
|
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
import findIndex from 'lodash/fp/findIndex';
|
|
2
|
-
import map from 'lodash/fp/map';
|
|
3
|
-
import set from 'lodash/fp/set';
|
|
4
|
-
import { POST_PROGRESSION_SUCCESS } from '../../actions/api/post-progression';
|
|
5
|
-
import { NEXT_SLIDE } from '../../actions/ui/next-slide';
|
|
6
|
-
var initialState = [0, 1, 2, 3, 4];
|
|
7
|
-
var reducer = function (
|
|
8
|
-
// eslint-disable-next-line default-param-last
|
|
9
|
-
state, action) {
|
|
10
|
-
if (state === void 0) { state = initialState; }
|
|
11
|
-
switch (action.type) {
|
|
12
|
-
case POST_PROGRESSION_SUCCESS: {
|
|
13
|
-
return initialState;
|
|
14
|
-
}
|
|
15
|
-
case NEXT_SLIDE: {
|
|
16
|
-
var _a = action.payload, totalCorrectAnswers = _a.totalCorrectAnswers, answeredSlides = _a.answeredSlides, currentSlideRef_1 = _a.currentSlideRef, animationType = _a.animationType, nextSlideRef = _a.nextSlideRef;
|
|
17
|
-
if (nextSlideRef === 'successExitNode')
|
|
18
|
-
return state;
|
|
19
|
-
var nextCurrentSlidePosition = animationType === 'unstack' ? -1 : 4 - totalCorrectAnswers;
|
|
20
|
-
var currentSlideIndex = findIndex(function (ref) { return ref === currentSlideRef_1; }, answeredSlides);
|
|
21
|
-
var newState = map(function (position) { return (position === -1 ? position : position - 1); }, state);
|
|
22
|
-
return set(["".concat(currentSlideIndex)], nextCurrentSlidePosition)(newState);
|
|
23
|
-
}
|
|
24
|
-
default:
|
|
25
|
-
return state;
|
|
26
|
-
}
|
|
27
|
-
};
|
|
28
|
-
export default reducer;
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import { CLOSE_POPIN, OPEN_POPIN } from '../../actions/ui/quit-popin';
|
|
2
|
-
var reducer = function (
|
|
3
|
-
// eslint-disable-next-line default-param-last
|
|
4
|
-
state, action) {
|
|
5
|
-
if (state === void 0) { state = false; }
|
|
6
|
-
switch (action.type) {
|
|
7
|
-
case OPEN_POPIN: {
|
|
8
|
-
return true;
|
|
9
|
-
}
|
|
10
|
-
case CLOSE_POPIN: {
|
|
11
|
-
return false;
|
|
12
|
-
}
|
|
13
|
-
default:
|
|
14
|
-
return state;
|
|
15
|
-
}
|
|
16
|
-
};
|
|
17
|
-
export default reducer;
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
import { NEXT_SLIDE } from '../../actions/ui/next-slide';
|
|
2
|
-
import { POST_PROGRESSION_SUCCESS } from '../../actions/api/post-progression';
|
|
3
|
-
var reducer = function (
|
|
4
|
-
// eslint-disable-next-line default-param-last
|
|
5
|
-
state, action) {
|
|
6
|
-
if (state === void 0) { state = false; }
|
|
7
|
-
switch (action.type) {
|
|
8
|
-
case POST_PROGRESSION_SUCCESS: {
|
|
9
|
-
return false;
|
|
10
|
-
}
|
|
11
|
-
case NEXT_SLIDE: {
|
|
12
|
-
var nextSlideRef = action.payload.nextSlideRef;
|
|
13
|
-
if (nextSlideRef === 'successExitNode')
|
|
14
|
-
return true;
|
|
15
|
-
return false;
|
|
16
|
-
}
|
|
17
|
-
default:
|
|
18
|
-
return state;
|
|
19
|
-
}
|
|
20
|
-
};
|
|
21
|
-
export default reducer;
|
|
@@ -1,48 +0,0 @@
|
|
|
1
|
-
import compact from 'lodash/fp/compact';
|
|
2
|
-
import isEmpty from 'lodash/fp/isEmpty';
|
|
3
|
-
import pipe from 'lodash/fp/pipe';
|
|
4
|
-
import set from 'lodash/fp/set';
|
|
5
|
-
import unset from 'lodash/fp/unset';
|
|
6
|
-
import { EDIT_BASIC, EDIT_QCM, EDIT_QCM_DRAG, EDIT_QCM_GRAPHIC, EDIT_SLIDER, EDIT_TEMPLATE } from '../../actions/ui/answers';
|
|
7
|
-
import { POST_ANSWER_REQUEST } from '../../actions/api/post-answer';
|
|
8
|
-
import { CORRECTION_FETCH_SUCCESS } from '../../actions/api/fetch-correction';
|
|
9
|
-
import { SLIDE_FETCH_REQUEST } from '../../actions/api/fetch-slide';
|
|
10
|
-
import { NEXT_SLIDE } from '../../actions/ui/next-slide';
|
|
11
|
-
export var initialState = {};
|
|
12
|
-
var reducer = function (
|
|
13
|
-
// eslint-disable-next-line default-param-last
|
|
14
|
-
state, action) {
|
|
15
|
-
if (state === void 0) { state = initialState; }
|
|
16
|
-
switch (action.type) {
|
|
17
|
-
case SLIDE_FETCH_REQUEST: {
|
|
18
|
-
return pipe(unset([action.meta.slideRef, 'animationType']), set([action.meta.slideRef], {
|
|
19
|
-
validateButton: false,
|
|
20
|
-
animateCorrectionPopin: false,
|
|
21
|
-
showCorrectionPopin: false
|
|
22
|
-
}))(state);
|
|
23
|
-
}
|
|
24
|
-
case EDIT_QCM:
|
|
25
|
-
case EDIT_QCM_GRAPHIC:
|
|
26
|
-
case EDIT_QCM_DRAG:
|
|
27
|
-
case EDIT_TEMPLATE:
|
|
28
|
-
case EDIT_BASIC:
|
|
29
|
-
case EDIT_SLIDER: {
|
|
30
|
-
return set([action.meta.slideRef, 'validateButton'], !pipe(compact, isEmpty)(action.payload), state);
|
|
31
|
-
}
|
|
32
|
-
case POST_ANSWER_REQUEST: {
|
|
33
|
-
return set([action.meta.slideRef, 'validateButton'], false, state);
|
|
34
|
-
}
|
|
35
|
-
case CORRECTION_FETCH_SUCCESS: {
|
|
36
|
-
return pipe(set([action.meta.slideRef, 'animateCorrectionPopin'], true), set([action.meta.slideRef, 'showCorrectionPopin'], true))(state);
|
|
37
|
-
}
|
|
38
|
-
case NEXT_SLIDE: {
|
|
39
|
-
var _a = action.payload, currentSlideRef = _a.currentSlideRef, nextSlideRef = _a.nextSlideRef;
|
|
40
|
-
if (nextSlideRef === 'successExitNode')
|
|
41
|
-
return state;
|
|
42
|
-
return pipe(set([currentSlideRef, 'animateCorrectionPopin'], false), set([currentSlideRef, 'animationType'], action.payload.animationType))(state);
|
|
43
|
-
}
|
|
44
|
-
default:
|
|
45
|
-
return state;
|
|
46
|
-
}
|
|
47
|
-
};
|
|
48
|
-
export default reducer;
|
|
@@ -1,58 +0,0 @@
|
|
|
1
|
-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
2
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
3
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
4
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
5
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
6
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
7
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
8
|
-
});
|
|
9
|
-
};
|
|
10
|
-
var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
11
|
-
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
|
12
|
-
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
13
|
-
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
14
|
-
function step(op) {
|
|
15
|
-
if (f) throw new TypeError("Generator is already executing.");
|
|
16
|
-
while (_) try {
|
|
17
|
-
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
18
|
-
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
19
|
-
switch (op[0]) {
|
|
20
|
-
case 0: case 1: t = op; break;
|
|
21
|
-
case 4: _.label++; return { value: op[1], done: false };
|
|
22
|
-
case 5: _.label++; y = op[1]; op = [0]; continue;
|
|
23
|
-
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
|
24
|
-
default:
|
|
25
|
-
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
|
26
|
-
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
|
27
|
-
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
|
28
|
-
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
|
29
|
-
if (t[2]) _.ops.pop();
|
|
30
|
-
_.trys.pop(); continue;
|
|
31
|
-
}
|
|
32
|
-
op = body.call(thisArg, _);
|
|
33
|
-
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
|
34
|
-
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
35
|
-
}
|
|
36
|
-
};
|
|
37
|
-
import crossFetch from 'cross-fetch';
|
|
38
|
-
import decode from 'jwt-decode';
|
|
39
|
-
import { toJSON } from './tools/fetch-responses';
|
|
40
|
-
export var fetchCorrection = function (slideRef, token, progressionId, answer) { return __awaiter(void 0, void 0, void 0, function () {
|
|
41
|
-
var host, response;
|
|
42
|
-
return __generator(this, function (_a) {
|
|
43
|
-
switch (_a.label) {
|
|
44
|
-
case 0:
|
|
45
|
-
host = decode(token).host;
|
|
46
|
-
return [4 /*yield*/, crossFetch("".concat(host, "/api/v2/progressions/").concat(progressionId, "/answers/").concat(slideRef), {
|
|
47
|
-
method: 'post',
|
|
48
|
-
headers: { authorization: token },
|
|
49
|
-
body: JSON.stringify({
|
|
50
|
-
answer: answer
|
|
51
|
-
})
|
|
52
|
-
})];
|
|
53
|
-
case 1:
|
|
54
|
-
response = _a.sent();
|
|
55
|
-
return [2 /*return*/, toJSON(response)];
|
|
56
|
-
}
|
|
57
|
-
});
|
|
58
|
-
}); };
|
|
@@ -1,54 +0,0 @@
|
|
|
1
|
-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
2
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
3
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
4
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
5
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
6
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
7
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
8
|
-
});
|
|
9
|
-
};
|
|
10
|
-
var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
11
|
-
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
|
12
|
-
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
13
|
-
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
14
|
-
function step(op) {
|
|
15
|
-
if (f) throw new TypeError("Generator is already executing.");
|
|
16
|
-
while (_) try {
|
|
17
|
-
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
18
|
-
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
19
|
-
switch (op[0]) {
|
|
20
|
-
case 0: case 1: t = op; break;
|
|
21
|
-
case 4: _.label++; return { value: op[1], done: false };
|
|
22
|
-
case 5: _.label++; y = op[1]; op = [0]; continue;
|
|
23
|
-
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
|
24
|
-
default:
|
|
25
|
-
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
|
26
|
-
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
|
27
|
-
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
|
28
|
-
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
|
29
|
-
if (t[2]) _.ops.pop();
|
|
30
|
-
_.trys.pop(); continue;
|
|
31
|
-
}
|
|
32
|
-
op = body.call(thisArg, _);
|
|
33
|
-
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
|
34
|
-
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
35
|
-
}
|
|
36
|
-
};
|
|
37
|
-
import crossFetch from 'cross-fetch';
|
|
38
|
-
import decode from 'jwt-decode';
|
|
39
|
-
import { toJSON } from './tools/fetch-responses';
|
|
40
|
-
export var fetchRank = function (token) { return __awaiter(void 0, void 0, void 0, function () {
|
|
41
|
-
var _a, userId, host, response;
|
|
42
|
-
return __generator(this, function (_b) {
|
|
43
|
-
switch (_b.label) {
|
|
44
|
-
case 0:
|
|
45
|
-
_a = decode(token), userId = _a.user, host = _a.host;
|
|
46
|
-
return [4 /*yield*/, crossFetch("".concat(host, "/api/v1/leaderboard/rank/").concat(userId, "?group=ALL"), {
|
|
47
|
-
headers: { authorization: token }
|
|
48
|
-
})];
|
|
49
|
-
case 1:
|
|
50
|
-
response = _b.sent();
|
|
51
|
-
return [2 /*return*/, toJSON(response)];
|
|
52
|
-
}
|
|
53
|
-
});
|
|
54
|
-
}); };
|
|
@@ -1,54 +0,0 @@
|
|
|
1
|
-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
2
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
3
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
4
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
5
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
6
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
7
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
8
|
-
});
|
|
9
|
-
};
|
|
10
|
-
var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
11
|
-
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
|
12
|
-
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
13
|
-
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
14
|
-
function step(op) {
|
|
15
|
-
if (f) throw new TypeError("Generator is already executing.");
|
|
16
|
-
while (_) try {
|
|
17
|
-
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
18
|
-
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
19
|
-
switch (op[0]) {
|
|
20
|
-
case 0: case 1: t = op; break;
|
|
21
|
-
case 4: _.label++; return { value: op[1], done: false };
|
|
22
|
-
case 5: _.label++; y = op[1]; op = [0]; continue;
|
|
23
|
-
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
|
24
|
-
default:
|
|
25
|
-
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
|
26
|
-
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
|
27
|
-
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
|
28
|
-
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
|
29
|
-
if (t[2]) _.ops.pop();
|
|
30
|
-
_.trys.pop(); continue;
|
|
31
|
-
}
|
|
32
|
-
op = body.call(thisArg, _);
|
|
33
|
-
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
|
34
|
-
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
35
|
-
}
|
|
36
|
-
};
|
|
37
|
-
import crossFetch from 'cross-fetch';
|
|
38
|
-
import decode from 'jwt-decode';
|
|
39
|
-
import { toJSON } from './tools/fetch-responses';
|
|
40
|
-
export var fetchSkills = function (token) { return __awaiter(void 0, void 0, void 0, function () {
|
|
41
|
-
var _a, userId, host, response;
|
|
42
|
-
return __generator(this, function (_b) {
|
|
43
|
-
switch (_b.label) {
|
|
44
|
-
case 0:
|
|
45
|
-
_a = decode(token), userId = _a.user, host = _a.host;
|
|
46
|
-
return [4 /*yield*/, crossFetch("".concat(host, "/api/v2/skills/review/user/").concat(userId), {
|
|
47
|
-
headers: { authorization: token }
|
|
48
|
-
})];
|
|
49
|
-
case 1:
|
|
50
|
-
response = _b.sent();
|
|
51
|
-
return [2 /*return*/, toJSON(response)];
|
|
52
|
-
}
|
|
53
|
-
});
|
|
54
|
-
}); };
|
|
@@ -1,54 +0,0 @@
|
|
|
1
|
-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
2
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
3
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
4
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
5
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
6
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
7
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
8
|
-
});
|
|
9
|
-
};
|
|
10
|
-
var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
11
|
-
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
|
12
|
-
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
13
|
-
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
14
|
-
function step(op) {
|
|
15
|
-
if (f) throw new TypeError("Generator is already executing.");
|
|
16
|
-
while (_) try {
|
|
17
|
-
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
18
|
-
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
19
|
-
switch (op[0]) {
|
|
20
|
-
case 0: case 1: t = op; break;
|
|
21
|
-
case 4: _.label++; return { value: op[1], done: false };
|
|
22
|
-
case 5: _.label++; y = op[1]; op = [0]; continue;
|
|
23
|
-
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
|
24
|
-
default:
|
|
25
|
-
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
|
26
|
-
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
|
27
|
-
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
|
28
|
-
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
|
29
|
-
if (t[2]) _.ops.pop();
|
|
30
|
-
_.trys.pop(); continue;
|
|
31
|
-
}
|
|
32
|
-
op = body.call(thisArg, _);
|
|
33
|
-
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
|
34
|
-
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
35
|
-
}
|
|
36
|
-
};
|
|
37
|
-
import crossFetch from 'cross-fetch';
|
|
38
|
-
import decode from 'jwt-decode';
|
|
39
|
-
import { toJSON } from './tools/fetch-responses';
|
|
40
|
-
export var fetchSlide = function (slideRef, token) { return __awaiter(void 0, void 0, void 0, function () {
|
|
41
|
-
var host, response;
|
|
42
|
-
return __generator(this, function (_a) {
|
|
43
|
-
switch (_a.label) {
|
|
44
|
-
case 0:
|
|
45
|
-
host = decode(token).host;
|
|
46
|
-
return [4 /*yield*/, crossFetch("".concat(host, "/api/v1/slides/").concat(slideRef, "/parentContentTitle"), {
|
|
47
|
-
headers: { authorization: token }
|
|
48
|
-
})];
|
|
49
|
-
case 1:
|
|
50
|
-
response = _a.sent();
|
|
51
|
-
return [2 /*return*/, toJSON(response)];
|
|
52
|
-
}
|
|
53
|
-
});
|
|
54
|
-
}); };
|
|
@@ -1,52 +0,0 @@
|
|
|
1
|
-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
2
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
3
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
4
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
5
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
6
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
7
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
8
|
-
});
|
|
9
|
-
};
|
|
10
|
-
var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
11
|
-
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
|
12
|
-
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
13
|
-
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
14
|
-
function step(op) {
|
|
15
|
-
if (f) throw new TypeError("Generator is already executing.");
|
|
16
|
-
while (_) try {
|
|
17
|
-
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
18
|
-
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
19
|
-
switch (op[0]) {
|
|
20
|
-
case 0: case 1: t = op; break;
|
|
21
|
-
case 4: _.label++; return { value: op[1], done: false };
|
|
22
|
-
case 5: _.label++; y = op[1]; op = [0]; continue;
|
|
23
|
-
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
|
24
|
-
default:
|
|
25
|
-
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
|
26
|
-
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
|
27
|
-
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
|
28
|
-
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
|
29
|
-
if (t[2]) _.ops.pop();
|
|
30
|
-
_.trys.pop(); continue;
|
|
31
|
-
}
|
|
32
|
-
op = body.call(thisArg, _);
|
|
33
|
-
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
|
34
|
-
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
35
|
-
}
|
|
36
|
-
};
|
|
37
|
-
import crossFetch from 'cross-fetch';
|
|
38
|
-
import decode from 'jwt-decode';
|
|
39
|
-
import { toJSON } from './tools/fetch-responses';
|
|
40
|
-
export var fetchSlidesToReviewBySkillRef = function (url, token, skillRef) { return __awaiter(void 0, void 0, void 0, function () {
|
|
41
|
-
var userId, response;
|
|
42
|
-
return __generator(this, function (_a) {
|
|
43
|
-
switch (_a.label) {
|
|
44
|
-
case 0:
|
|
45
|
-
userId = decode(token).user;
|
|
46
|
-
return [4 /*yield*/, crossFetch("".concat(url, "/api/v1/review/users/").concat(userId, "/skills/").concat(skillRef, "/slide?limit=5&offset=0"))];
|
|
47
|
-
case 1:
|
|
48
|
-
response = _a.sent();
|
|
49
|
-
return [2 /*return*/, toJSON(response)];
|
|
50
|
-
}
|
|
51
|
-
});
|
|
52
|
-
}); };
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import { fetchCorrection } from './fetch-correction';
|
|
2
|
-
import { fetchRank } from './fetch-rank';
|
|
3
|
-
import { fetchSkills } from './fetch-skills';
|
|
4
|
-
import { fetchSlide } from './fetch-slide';
|
|
5
|
-
import { fetchSlidesToReviewBySkillRef } from './fetch-slides-to-review-by-skill-ref';
|
|
6
|
-
import { postAnswer } from './post-answer';
|
|
7
|
-
import { postProgression } from './post-progression';
|
|
8
|
-
export var getServices = function () { return ({
|
|
9
|
-
fetchCorrection: fetchCorrection,
|
|
10
|
-
fetchRank: fetchRank,
|
|
11
|
-
fetchSkills: fetchSkills,
|
|
12
|
-
fetchSlide: fetchSlide,
|
|
13
|
-
fetchSlidesToReviewBySkillRef: fetchSlidesToReviewBySkillRef,
|
|
14
|
-
postAnswer: postAnswer,
|
|
15
|
-
postProgression: postProgression
|
|
16
|
-
}); };
|