fcad-core-dragon 2.0.0-beta.2 → 2.0.0-beta.3
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/.editorconfig +33 -33
- package/.eslintignore +29 -29
- package/.eslintrc.cjs +81 -81
- package/CHANGELOG +364 -364
- package/README.md +71 -71
- package/bk.scss +117 -117
- package/package.json +61 -47
- package/src/$locales/en.json +143 -193
- package/src/$locales/fr.json +105 -194
- package/src/assets/data/onboardingMessages.json +47 -47
- package/src/components/AppBase.vue +1054 -1049
- package/src/components/AppBaseButton.vue +87 -91
- package/src/components/AppBaseErrorDisplay.vue +438 -428
- package/src/components/AppBaseFlipCard.vue +84 -83
- package/src/components/AppBaseModule.vue +1673 -1666
- package/src/components/AppBasePage.vue +779 -324
- package/src/components/AppBasePopover.vue +41 -0
- package/src/components/AppCompAudio.vue +234 -266
- package/src/components/AppCompBranchButtons.vue +552 -571
- package/src/components/AppCompButtonProgress.vue +126 -132
- package/src/components/AppCompCarousel.vue +298 -196
- package/src/components/{AppCompInputCheckBox.vue → AppCompInputCheckBoxNext.vue} +195 -233
- package/src/components/AppCompInputDropdownNext.vue +159 -0
- package/src/components/{AppCompInputRadio.vue → AppCompInputRadioNext.vue} +152 -162
- package/src/components/{AppCompInputTextBox.vue → AppCompInputTextNext.vue} +106 -91
- package/src/components/AppCompInputTextTableNext.vue +141 -0
- package/src/components/AppCompInputTextToFillDropdownNext.vue +230 -0
- package/src/components/{AppCompInputTextToFillText.vue → AppCompInputTextToFillNext.vue} +171 -164
- package/src/components/AppCompJauge.vue +74 -67
- package/src/components/AppCompMenu.vue +413 -402
- package/src/components/AppCompMenuItem.vue +228 -191
- package/src/components/AppCompNavigation.vue +960 -945
- package/src/components/AppCompNoteCall.vue +133 -141
- package/src/components/AppCompNoteCredit.vue +292 -267
- package/src/components/AppCompPlayBar.vue +1218 -1271
- package/src/components/AppCompPlayBarNext.vue +2052 -0
- package/src/components/AppCompPlayBarProgress.vue +82 -73
- package/src/components/AppCompPopUpNext.vue +503 -0
- package/src/components/{AppCompQuiz.vue → AppCompQuizNext.vue} +2904 -2975
- package/src/components/AppCompQuizRecall.vue +276 -277
- package/src/components/{AppCompSVG.vue → AppCompSVGNext.vue} +347 -335
- package/src/components/AppCompSettingsMenu.vue +172 -169
- package/src/components/AppCompTableOfContent.vue +387 -385
- package/src/components/AppCompTranscript.vue +24 -19
- package/src/components/AppCompVideoPlayer.vue +368 -380
- package/src/components/AppCompViewDisplay.vue +6 -6
- package/src/components/BaseModule.vue +72 -71
- package/src/composables/useQuiz.js +206 -0
- package/src/externalComps/ModuleView.vue +22 -0
- package/src/externalComps/SummaryView.vue +91 -0
- package/src/main.js +272 -263
- package/src/mixins/$mediaMixins.js +819 -827
- package/src/mixins/timerMixin.js +155 -155
- package/src/module/stores/appStore.js +893 -0
- package/src/module/xapi/ADL.js +376 -376
- package/src/module/xapi/Crypto/Hasher.js +241 -241
- package/src/module/xapi/Crypto/WordArray.js +278 -278
- package/src/module/xapi/Crypto/algorithms/BufferedBlockAlgorithm.js +103 -103
- package/src/module/xapi/Crypto/algorithms/C_algo.js +315 -315
- package/src/module/xapi/Crypto/algorithms/HMAC.js +9 -9
- package/src/module/xapi/Crypto/algorithms/SHA1.js +9 -9
- package/src/module/xapi/Crypto/encoders/Base.js +105 -105
- package/src/module/xapi/Crypto/encoders/Base64.js +99 -99
- package/src/module/xapi/Crypto/encoders/Hex.js +61 -61
- package/src/module/xapi/Crypto/encoders/Latin1.js +61 -61
- package/src/module/xapi/Crypto/encoders/Utf8.js +45 -45
- package/src/module/xapi/Crypto/index.js +53 -53
- package/src/module/xapi/Statement/activity.js +47 -47
- package/src/module/xapi/Statement/agent.js +55 -55
- package/src/module/xapi/Statement/group.js +26 -26
- package/src/module/xapi/Statement/index.js +259 -259
- package/src/module/xapi/Statement/statement.js +253 -253
- package/src/module/xapi/Statement/statementRef.js +23 -23
- package/src/module/xapi/Statement/substatement.js +22 -22
- package/src/module/xapi/Statement/verb.js +36 -36
- package/src/module/xapi/activitytypes.js +17 -17
- package/src/module/xapi/launch.js +157 -157
- package/src/module/xapi/utils.js +167 -167
- package/src/module/xapi/verbs.js +294 -294
- package/src/module/xapi/wrapper.js +1963 -1963
- package/src/module/xapi/xapiStatement.js +444 -444
- package/src/plugins/bus.js +8 -3
- package/src/plugins/gsap.js +14 -17
- package/src/plugins/helper.js +308 -294
- package/src/plugins/i18n.js +44 -44
- package/src/plugins/idb.js +219 -212
- package/src/plugins/save.js +37 -37
- package/src/plugins/scorm.js +287 -287
- package/src/plugins/xapi.js +11 -11
- package/src/public/index.html +33 -21
- package/src/router/index.js +43 -40
- package/src/router/routes.js +312 -317
- package/src/shared/generalfuncs.js +210 -195
- package/src/shared/validators.js +1069 -959
- package/vite.config.js +27 -0
- package/src/components/AppCompInputDropdown.vue +0 -182
- package/src/components/AppCompInputTextTable.vue +0 -158
- package/src/components/AppCompInputTextToFillDropdown.vue +0 -257
- package/src/components/AppCompPopUp.vue +0 -583
- package/src/components/AppCompPopover.vue +0 -27
- package/src/mixins/$pageMixins.js +0 -415
- package/src/mixins/$quizMixins.js +0 -442
- package/src/module/store.js +0 -1014
|
@@ -1,402 +1,413 @@
|
|
|
1
|
-
<!--
|
|
2
|
-
@ Description: This component is used to create the menu and the ard that will bring you back where you were before the menu.
|
|
3
|
-
@ What it does: Look in the store what was the last page you saw before you came to the menu and create the the link for the card. It display's AppCompMenuItem
|
|
4
|
-
-->
|
|
5
|
-
<template>
|
|
6
|
-
<div class="menu-container">
|
|
7
|
-
<div
|
|
8
|
-
id="page_info_section"
|
|
9
|
-
aria-labelledby="page_info"
|
|
10
|
-
aria-live="true"
|
|
11
|
-
></div>
|
|
12
|
-
<a
|
|
13
|
-
class="skip-link"
|
|
14
|
-
href=""
|
|
15
|
-
@click.prevent="$bus.$emit('move-to-target', 'menu-main')"
|
|
16
|
-
>
|
|
17
|
-
{{ $t('message.skip_content') }}
|
|
18
|
-
</a>
|
|
19
|
-
<
|
|
20
|
-
<div class="wrapper-lasRoute">
|
|
21
|
-
<div class="box-menu">
|
|
22
|
-
<h1>{{ getLessonid }}</h1>
|
|
23
|
-
<h2 v-html="getLessonTitle"></h2>
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
:
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
md="10"
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
:
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
>
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
<div></div>
|
|
72
|
-
<div></div>
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
'
|
|
105
|
-
'
|
|
106
|
-
'
|
|
107
|
-
'
|
|
108
|
-
'
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
let
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
}
|
|
151
|
-
},
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
let
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
//
|
|
190
|
-
if (this.
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
}
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
}
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
}
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
}
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
#
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
background-color:
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
0
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
0
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
transform: scale(0);
|
|
391
|
-
}
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
transform:
|
|
399
|
-
}
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
1
|
+
<!--
|
|
2
|
+
@ Description: This component is used to create the menu and the ard that will bring you back where you were before the menu.
|
|
3
|
+
@ What it does: Look in the store what was the last page you saw before you came to the menu and create the the link for the card. It display's AppCompMenuItem
|
|
4
|
+
-->
|
|
5
|
+
<template>
|
|
6
|
+
<div class="menu-container">
|
|
7
|
+
<div
|
|
8
|
+
id="page_info_section"
|
|
9
|
+
aria-labelledby="page_info"
|
|
10
|
+
aria-live="true"
|
|
11
|
+
></div>
|
|
12
|
+
<a
|
|
13
|
+
class="skip-link"
|
|
14
|
+
href=""
|
|
15
|
+
@click.prevent="$bus.$emit('move-to-target', 'menu-main')"
|
|
16
|
+
>
|
|
17
|
+
{{ $t('message.skip_content') }}
|
|
18
|
+
</a>
|
|
19
|
+
<div class="contain-lr">
|
|
20
|
+
<div class="wrapper-lasRoute">
|
|
21
|
+
<div class="box-menu">
|
|
22
|
+
<h1>{{ getLessonid }}</h1>
|
|
23
|
+
<h2 v-html="getLessonTitle"></h2>
|
|
24
|
+
|
|
25
|
+
<p class="lesson-progess">
|
|
26
|
+
{{ $t('message.progress_card') }} {{ lessonProg() }}
|
|
27
|
+
</p>
|
|
28
|
+
<router-link
|
|
29
|
+
id="btn_last_route"
|
|
30
|
+
class="nav_last_route btn-main"
|
|
31
|
+
:title="handelLabel"
|
|
32
|
+
:to="{ name: GoToLastRoute() }"
|
|
33
|
+
data-test="menu-back-btn"
|
|
34
|
+
>
|
|
35
|
+
{{ handelLabel }}
|
|
36
|
+
</router-link>
|
|
37
|
+
</div>
|
|
38
|
+
</div>
|
|
39
|
+
<v-row justify="center" align="center" class="r-menu">
|
|
40
|
+
<v-col id="menu-main" md="10" class="wrapper-MenuItem">
|
|
41
|
+
<h3>{{ $t('text.activity_title') }}</h3>
|
|
42
|
+
|
|
43
|
+
<app-comp-menu-item></app-comp-menu-item>
|
|
44
|
+
</v-col>
|
|
45
|
+
</v-row>
|
|
46
|
+
</div>
|
|
47
|
+
<v-row justify="center" align="center">
|
|
48
|
+
<v-col md="7">
|
|
49
|
+
<div v-show="appDebugMode" id="_debug-area">
|
|
50
|
+
<h5>Mode de débogage activé</h5>
|
|
51
|
+
<p>
|
|
52
|
+
Cliquez sur le bouton pour réinitialiser toutes les données de ce
|
|
53
|
+
paquet.
|
|
54
|
+
</p>
|
|
55
|
+
|
|
56
|
+
<app-base-button
|
|
57
|
+
:id="`btn-quiz`"
|
|
58
|
+
class="btn lk-btn"
|
|
59
|
+
:is-active="resetStatus !== false"
|
|
60
|
+
@click="askResetUserData"
|
|
61
|
+
>
|
|
62
|
+
Réinitialiser la leçon
|
|
63
|
+
</app-base-button>
|
|
64
|
+
<div v-show="resetStatus !== false" id="resetOverlay">
|
|
65
|
+
<div
|
|
66
|
+
v-show="resetStatus === resetState.LOADING"
|
|
67
|
+
class="lds-ellipsis"
|
|
68
|
+
>
|
|
69
|
+
<div></div>
|
|
70
|
+
<div></div>
|
|
71
|
+
<div></div>
|
|
72
|
+
<div></div>
|
|
73
|
+
</div>
|
|
74
|
+
<span v-show="resetStatus === resetState.COMPLETE" id="reset_label">
|
|
75
|
+
Opération réussie!
|
|
76
|
+
</span>
|
|
77
|
+
</div>
|
|
78
|
+
</div>
|
|
79
|
+
</v-col>
|
|
80
|
+
</v-row>
|
|
81
|
+
<div id="page_info" class="sr-only" aria-hidden="true">
|
|
82
|
+
{{ $t('text.title_content_view') }}
|
|
83
|
+
</div>
|
|
84
|
+
</div>
|
|
85
|
+
</template>
|
|
86
|
+
<script>
|
|
87
|
+
// ...
|
|
88
|
+
import { mapState } from 'pinia'
|
|
89
|
+
import { useAppStore } from '../module/stores/appStore'
|
|
90
|
+
export default {
|
|
91
|
+
name: 'AppCompMenu',
|
|
92
|
+
data() {
|
|
93
|
+
return {
|
|
94
|
+
totalAttempts: 0,
|
|
95
|
+
resetStatus: false,
|
|
96
|
+
resetState: { LOADING: 'LOADING', COMPLETE: 'COMPLETE' }
|
|
97
|
+
}
|
|
98
|
+
},
|
|
99
|
+
|
|
100
|
+
computed: {
|
|
101
|
+
...mapState(useAppStore, [
|
|
102
|
+
'getRouteHistory',
|
|
103
|
+
'getAllActivitiesState',
|
|
104
|
+
'getAllCompleted',
|
|
105
|
+
'getModuleInfo',
|
|
106
|
+
'getMenuSettings',
|
|
107
|
+
'getAppDebugMode',
|
|
108
|
+
'getAllCompleted'
|
|
109
|
+
]),
|
|
110
|
+
appDebugMode() {
|
|
111
|
+
return this.getAppDebugMode
|
|
112
|
+
},
|
|
113
|
+
handelLabel() {
|
|
114
|
+
let label = ''
|
|
115
|
+
const { allActivitiesState, allCompleted } = this.progressWithMenu()
|
|
116
|
+
|
|
117
|
+
let activity = Object.values(allActivitiesState)
|
|
118
|
+
let completeActivity = Object.values(allCompleted)
|
|
119
|
+
|
|
120
|
+
if (this.noProgress(activity)) {
|
|
121
|
+
label = this.$t('button.menu_item.start')
|
|
122
|
+
} else {
|
|
123
|
+
if (activity.length == completeActivity.length) {
|
|
124
|
+
label = this.$t('button.menu_item.end')
|
|
125
|
+
} else {
|
|
126
|
+
label = this.$t('button.menu_item.end')
|
|
127
|
+
}
|
|
128
|
+
}
|
|
129
|
+
return label
|
|
130
|
+
},
|
|
131
|
+
getLessonid() {
|
|
132
|
+
// ATTENDRE UX*UI poure voir si on garde le concept ou pas
|
|
133
|
+
let lessonLabel = this.$t('text.lesson')
|
|
134
|
+
let lessonId = 99
|
|
135
|
+
return `${lessonLabel} ${lessonId}`
|
|
136
|
+
},
|
|
137
|
+
getLessonTitle() {
|
|
138
|
+
let lessonT
|
|
139
|
+
if (this.getMenuSettings.lessonTitle) {
|
|
140
|
+
lessonT = this.getMenuSettings.lessonTitle
|
|
141
|
+
} else {
|
|
142
|
+
lessonT = 'Entrer un titre à pour votre leçon dans menu setting svp.'
|
|
143
|
+
}
|
|
144
|
+
return `${lessonT}`
|
|
145
|
+
}
|
|
146
|
+
},
|
|
147
|
+
mounted() {
|
|
148
|
+
setTimeout(() => {
|
|
149
|
+
this.$bus.$emit('move-to-target', 'page_info_section')
|
|
150
|
+
}, 200)
|
|
151
|
+
},
|
|
152
|
+
beforeUnmount() {
|
|
153
|
+
this.$bus.$off('reset-complete', this.onResetComplete)
|
|
154
|
+
},
|
|
155
|
+
methods: {
|
|
156
|
+
//When server responds after a reset request
|
|
157
|
+
onResetComplete() {
|
|
158
|
+
this.$bus.$off('reset-complete', this.onResetComplete)
|
|
159
|
+
//show Operation reussie! for 2 seconds then exit debugmode
|
|
160
|
+
this.resetStatus = this.resetState.COMPLETE
|
|
161
|
+
setTimeout(() => {
|
|
162
|
+
window.setDebugMode(false)
|
|
163
|
+
if (this.resetStatus) {
|
|
164
|
+
this.resetStatus = false
|
|
165
|
+
}
|
|
166
|
+
}, 2000)
|
|
167
|
+
},
|
|
168
|
+
GoToLastRoute() {
|
|
169
|
+
let lastRoute
|
|
170
|
+
let path
|
|
171
|
+
|
|
172
|
+
//Get all activity state (menu not included)
|
|
173
|
+
const { allActivitiesState } = this.progressWithMenu()
|
|
174
|
+
let state = Object.values(allActivitiesState)
|
|
175
|
+
|
|
176
|
+
if (this.getRouteHistory.length) {
|
|
177
|
+
if (this.getRouteHistory.length == 1) {
|
|
178
|
+
lastRoute = this.getRouteHistory[0]
|
|
179
|
+
} else {
|
|
180
|
+
lastRoute = this.getRouteHistory[this.getRouteHistory.length - 1]
|
|
181
|
+
}
|
|
182
|
+
}
|
|
183
|
+
|
|
184
|
+
//if course was not started bring you to the introduction
|
|
185
|
+
if (this.noProgress(state)) {
|
|
186
|
+
path = 'introduction'
|
|
187
|
+
return path
|
|
188
|
+
}
|
|
189
|
+
// create path from the last you saw
|
|
190
|
+
if (lastRoute) path = this.createdRoute(lastRoute)
|
|
191
|
+
|
|
192
|
+
return path
|
|
193
|
+
},
|
|
194
|
+
|
|
195
|
+
noProgress(obj) {
|
|
196
|
+
//validator to see if anything was seen before
|
|
197
|
+
for (let i = 0; i < obj.length; i++) {
|
|
198
|
+
if (obj[i].progressions.length != 0) return false //something was seen
|
|
199
|
+
}
|
|
200
|
+
return true //nothing was seen
|
|
201
|
+
},
|
|
202
|
+
createdRoute(objRoute) {
|
|
203
|
+
// create link for activity
|
|
204
|
+
let newRoute = objRoute
|
|
205
|
+
let activity
|
|
206
|
+
let page
|
|
207
|
+
let path
|
|
208
|
+
|
|
209
|
+
const typesToCatch = ['menu', 'introduction', 'conclusion']
|
|
210
|
+
//Define activity
|
|
211
|
+
if (typesToCatch.includes(newRoute.type)) {
|
|
212
|
+
activity = newRoute.type
|
|
213
|
+
} else {
|
|
214
|
+
activity =
|
|
215
|
+
newRoute.activity_ref.charAt(1) == '0'
|
|
216
|
+
? `activite_${newRoute.activity_ref.substring(2)}`
|
|
217
|
+
: `activite_${newRoute.activity_ref.substring(1)}`
|
|
218
|
+
}
|
|
219
|
+
|
|
220
|
+
//Define page
|
|
221
|
+
const idToIgnore = ['P01', 'pg_menu']
|
|
222
|
+
page = idToIgnore.includes(newRoute.id) ? ' ' : newRoute.id.substring(2)
|
|
223
|
+
|
|
224
|
+
//Define path
|
|
225
|
+
path = page !== ' ' ? `${activity}.page_${page}` : activity
|
|
226
|
+
|
|
227
|
+
return path
|
|
228
|
+
},
|
|
229
|
+
progressWithMenu() {
|
|
230
|
+
/*
|
|
231
|
+
* Note:
|
|
232
|
+
* Assaging by reference would change the property of the getters when the valued are changed in the new object in. * To prevent this behaviour we will make a deep copy of the getter
|
|
233
|
+
* cf: https://reactgo.com/javascript-clone-object/
|
|
234
|
+
*/
|
|
235
|
+
|
|
236
|
+
const allActivitiesState = JSON.parse(
|
|
237
|
+
JSON.stringify(this.getAllActivitiesState)
|
|
238
|
+
)
|
|
239
|
+
|
|
240
|
+
const allCompleted = JSON.parse(JSON.stringify(this.getAllCompleted))
|
|
241
|
+
|
|
242
|
+
for (let activity in allActivitiesState) {
|
|
243
|
+
if (
|
|
244
|
+
activity === 'A00' &&
|
|
245
|
+
allActivitiesState[activity] &&
|
|
246
|
+
allCompleted[activity]
|
|
247
|
+
) {
|
|
248
|
+
let completedIntro = allCompleted[activity]
|
|
249
|
+
|
|
250
|
+
if (!completedIntro.length) completedIntro = []
|
|
251
|
+
|
|
252
|
+
allCompleted[activity] = completedIntro
|
|
253
|
+
}
|
|
254
|
+
}
|
|
255
|
+
|
|
256
|
+
return {
|
|
257
|
+
allActivitiesState,
|
|
258
|
+
allCompleted
|
|
259
|
+
}
|
|
260
|
+
},
|
|
261
|
+
lessonProg() {
|
|
262
|
+
let lstActivity = Object.keys(this.getAllActivitiesState)
|
|
263
|
+
let progress = null
|
|
264
|
+
let info = this.progressWithMenu()
|
|
265
|
+
let page = null
|
|
266
|
+
let pageCmplt = null
|
|
267
|
+
|
|
268
|
+
lstActivity.forEach((element) => {
|
|
269
|
+
//Get the total of all the page
|
|
270
|
+
page += info.allActivitiesState[element].size
|
|
271
|
+
|
|
272
|
+
if (info.allCompleted[element]) {
|
|
273
|
+
// GEt all page complete
|
|
274
|
+
pageCmplt += Object.values(info.allCompleted[element]).length
|
|
275
|
+
}
|
|
276
|
+
})
|
|
277
|
+
|
|
278
|
+
// Create pourcentage complete
|
|
279
|
+
progress = Math.round((pageCmplt * 100) / page)
|
|
280
|
+
|
|
281
|
+
return `${progress}%`
|
|
282
|
+
},
|
|
283
|
+
askResetUserData() {
|
|
284
|
+
//show loader animation
|
|
285
|
+
this.resetStatus = this.resetState.LOADING
|
|
286
|
+
//callback on server response
|
|
287
|
+
this.$bus.$on('reset-complete', this.onResetComplete)
|
|
288
|
+
//launch reset call
|
|
289
|
+
this.$bus.$emit('reset-userdata')
|
|
290
|
+
}
|
|
291
|
+
}
|
|
292
|
+
}
|
|
293
|
+
</script>
|
|
294
|
+
<style lang="scss">
|
|
295
|
+
.contain-lr {
|
|
296
|
+
display: flex;
|
|
297
|
+
flex-direction: column;
|
|
298
|
+
flex-wrap: wrap;
|
|
299
|
+
width: 100%;
|
|
300
|
+
|
|
301
|
+
.wrapper-lasRoute {
|
|
302
|
+
display: flex;
|
|
303
|
+
justify-content: flex-end;
|
|
304
|
+
|
|
305
|
+
.nav_last_route {
|
|
306
|
+
display: inline-block;
|
|
307
|
+
}
|
|
308
|
+
}
|
|
309
|
+
}
|
|
310
|
+
|
|
311
|
+
.menu-container {
|
|
312
|
+
width: 100%;
|
|
313
|
+
height: 100%;
|
|
314
|
+
|
|
315
|
+
.r-menu {
|
|
316
|
+
margin: 0 0 0 0;
|
|
317
|
+
}
|
|
318
|
+
}
|
|
319
|
+
|
|
320
|
+
#_debug-area {
|
|
321
|
+
display: flex;
|
|
322
|
+
flex-direction: column;
|
|
323
|
+
align-items: center;
|
|
324
|
+
justify-content: center;
|
|
325
|
+
margin: 25px;
|
|
326
|
+
padding: 20px;
|
|
327
|
+
background-color: #eaabb685;
|
|
328
|
+
border-block: dotted yellow 5px;
|
|
329
|
+
p {
|
|
330
|
+
padding: 15px;
|
|
331
|
+
text-align: center;
|
|
332
|
+
font-size: 1em;
|
|
333
|
+
}
|
|
334
|
+
button {
|
|
335
|
+
background-color: #8dff95;
|
|
336
|
+
font-size: 1.3em;
|
|
337
|
+
}
|
|
338
|
+
#resetOverlay {
|
|
339
|
+
position: absolute;
|
|
340
|
+
display: flex;
|
|
341
|
+
flex-direction: column;
|
|
342
|
+
width: 33%;
|
|
343
|
+
height: 40%;
|
|
344
|
+
align-items: center;
|
|
345
|
+
justify-content: center;
|
|
346
|
+
background-color: rgba($color: #000000, $alpha: 0.9);
|
|
347
|
+
border-radius: 10px;
|
|
348
|
+
box-shadow: 2px 2px 4px 0px rgba($color: #000000, $alpha: 0.2);
|
|
349
|
+
}
|
|
350
|
+
#reset_label {
|
|
351
|
+
font-family: arial;
|
|
352
|
+
color: #fff;
|
|
353
|
+
font-weight: bold;
|
|
354
|
+
font-size: 18px;
|
|
355
|
+
}
|
|
356
|
+
.lds-ellipsis {
|
|
357
|
+
display: flex;
|
|
358
|
+
display: inline-block;
|
|
359
|
+
position: relative;
|
|
360
|
+
width: 80px;
|
|
361
|
+
height: 80px;
|
|
362
|
+
}
|
|
363
|
+
.lds-ellipsis div {
|
|
364
|
+
position: absolute;
|
|
365
|
+
top: 33px;
|
|
366
|
+
width: 13px;
|
|
367
|
+
height: 13px;
|
|
368
|
+
border-radius: 50%;
|
|
369
|
+
background: #fff;
|
|
370
|
+
animation-timing-function: cubic-bezier(0, 1, 1, 0);
|
|
371
|
+
}
|
|
372
|
+
.lds-ellipsis div:nth-child(1) {
|
|
373
|
+
left: 8px;
|
|
374
|
+
animation: lds-ellipsis1 0.6s infinite;
|
|
375
|
+
}
|
|
376
|
+
.lds-ellipsis div:nth-child(2) {
|
|
377
|
+
left: 8px;
|
|
378
|
+
animation: lds-ellipsis2 0.6s infinite;
|
|
379
|
+
}
|
|
380
|
+
.lds-ellipsis div:nth-child(3) {
|
|
381
|
+
left: 32px;
|
|
382
|
+
animation: lds-ellipsis2 0.6s infinite;
|
|
383
|
+
}
|
|
384
|
+
.lds-ellipsis div:nth-child(4) {
|
|
385
|
+
left: 56px;
|
|
386
|
+
animation: lds-ellipsis3 0.6s infinite;
|
|
387
|
+
}
|
|
388
|
+
@keyframes lds-ellipsis1 {
|
|
389
|
+
0% {
|
|
390
|
+
transform: scale(0);
|
|
391
|
+
}
|
|
392
|
+
100% {
|
|
393
|
+
transform: scale(1);
|
|
394
|
+
}
|
|
395
|
+
}
|
|
396
|
+
@keyframes lds-ellipsis3 {
|
|
397
|
+
0% {
|
|
398
|
+
transform: scale(1);
|
|
399
|
+
}
|
|
400
|
+
100% {
|
|
401
|
+
transform: scale(0);
|
|
402
|
+
}
|
|
403
|
+
}
|
|
404
|
+
@keyframes lds-ellipsis2 {
|
|
405
|
+
0% {
|
|
406
|
+
transform: translate(0, 0);
|
|
407
|
+
}
|
|
408
|
+
100% {
|
|
409
|
+
transform: translate(24px, 0);
|
|
410
|
+
}
|
|
411
|
+
}
|
|
412
|
+
}
|
|
413
|
+
</style>
|