fcad-core-dragon 2.0.0-beta.1 → 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.
Files changed (118) hide show
  1. package/.editorconfig +33 -33
  2. package/.eslintignore +29 -29
  3. package/{.eslintrc.js → .eslintrc.cjs} +81 -86
  4. package/CHANGELOG +364 -364
  5. package/README.md +71 -71
  6. package/bk.scss +117 -0
  7. package/package.json +61 -63
  8. package/src/$locales/en.json +143 -179
  9. package/src/$locales/fr.json +105 -181
  10. package/src/assets/data/onboardingMessages.json +47 -47
  11. package/src/components/AppBase.vue +1054 -614
  12. package/src/components/AppBaseButton.vue +87 -63
  13. package/src/components/AppBaseErrorDisplay.vue +438 -420
  14. package/src/components/AppBaseFlipCard.vue +84 -83
  15. package/src/components/AppBaseModule.vue +1673 -1842
  16. package/src/components/AppBasePage.vue +779 -312
  17. package/src/components/AppBasePopover.vue +41 -0
  18. package/src/components/AppCompAudio.vue +234 -0
  19. package/src/components/AppCompBranchButtons.vue +552 -582
  20. package/src/components/AppCompButtonProgress.vue +126 -147
  21. package/src/components/AppCompCarousel.vue +298 -192
  22. package/src/components/AppCompInputCheckBoxNext.vue +195 -0
  23. package/src/components/AppCompInputDropdownNext.vue +159 -0
  24. package/src/components/AppCompInputRadioNext.vue +152 -0
  25. package/src/components/{AppCompInputTextBox.vue → AppCompInputTextNext.vue} +106 -91
  26. package/src/components/AppCompInputTextTableNext.vue +141 -0
  27. package/src/components/AppCompInputTextToFillDropdownNext.vue +230 -0
  28. package/src/components/{AppCompInputTextToFillText.vue → AppCompInputTextToFillNext.vue} +171 -164
  29. package/src/components/AppCompJauge.vue +74 -55
  30. package/src/components/AppCompMenu.vue +413 -209
  31. package/src/components/AppCompMenuItem.vue +228 -174
  32. package/src/components/AppCompNavigation.vue +960 -949
  33. package/src/components/AppCompNoteCall.vue +133 -126
  34. package/src/components/AppCompNoteCredit.vue +292 -164
  35. package/src/components/AppCompPlayBar.vue +1218 -1319
  36. package/src/components/AppCompPlayBarNext.vue +2052 -0
  37. package/src/components/AppCompPlayBarProgress.vue +82 -0
  38. package/src/components/AppCompPopUpNext.vue +503 -0
  39. package/src/components/{AppCompQuiz.vue → AppCompQuizNext.vue} +2904 -2989
  40. package/src/components/AppCompQuizRecall.vue +276 -250
  41. package/src/components/AppCompSVGNext.vue +347 -0
  42. package/src/components/AppCompSettingsMenu.vue +172 -171
  43. package/src/components/AppCompTableOfContent.vue +387 -264
  44. package/src/components/AppCompTranscript.vue +24 -19
  45. package/src/components/AppCompVideoPlayer.vue +368 -336
  46. package/src/components/AppCompViewDisplay.vue +6 -6
  47. package/src/components/BaseModule.vue +72 -67
  48. package/src/composables/useQuiz.js +206 -0
  49. package/src/externalComps/ModuleView.vue +22 -0
  50. package/src/externalComps/SummaryView.vue +91 -0
  51. package/src/main.js +272 -227
  52. package/src/mixins/$mediaMixins.js +819 -0
  53. package/src/mixins/timerMixin.js +155 -156
  54. package/src/module/stores/appStore.js +893 -0
  55. package/src/module/xapi/ADL.js +376 -339
  56. package/src/module/xapi/Crypto/Hasher.js +241 -241
  57. package/src/module/xapi/Crypto/WordArray.js +278 -278
  58. package/src/module/xapi/Crypto/algorithms/BufferedBlockAlgorithm.js +103 -103
  59. package/src/module/xapi/Crypto/algorithms/C_algo.js +315 -319
  60. package/src/module/xapi/Crypto/algorithms/HMAC.js +9 -9
  61. package/src/module/xapi/Crypto/algorithms/SHA1.js +9 -9
  62. package/src/module/xapi/Crypto/encoders/Base.js +105 -105
  63. package/src/module/xapi/Crypto/encoders/Base64.js +99 -99
  64. package/src/module/xapi/Crypto/encoders/Hex.js +61 -61
  65. package/src/module/xapi/Crypto/encoders/Latin1.js +61 -61
  66. package/src/module/xapi/Crypto/encoders/Utf8.js +45 -45
  67. package/src/module/xapi/Crypto/index.js +53 -53
  68. package/src/module/xapi/Statement/activity.js +47 -47
  69. package/src/module/xapi/Statement/agent.js +55 -55
  70. package/src/module/xapi/Statement/group.js +26 -26
  71. package/src/module/xapi/Statement/index.js +259 -259
  72. package/src/module/xapi/Statement/statement.js +253 -253
  73. package/src/module/xapi/Statement/statementRef.js +23 -23
  74. package/src/module/xapi/Statement/substatement.js +22 -22
  75. package/src/module/xapi/Statement/verb.js +36 -36
  76. package/src/module/xapi/activitytypes.js +17 -17
  77. package/src/module/xapi/launch.js +157 -157
  78. package/src/module/xapi/utils.js +167 -167
  79. package/src/module/xapi/verbs.js +294 -294
  80. package/src/module/xapi/wrapper.js +1963 -1890
  81. package/src/module/xapi/xapiStatement.js +444 -444
  82. package/src/plugins/bus.js +8 -3
  83. package/src/plugins/gsap.js +14 -17
  84. package/src/plugins/helper.js +308 -295
  85. package/src/plugins/i18n.js +44 -31
  86. package/src/plugins/idb.js +219 -212
  87. package/src/plugins/save.js +37 -37
  88. package/src/plugins/scorm.js +287 -287
  89. package/src/plugins/xapi.js +11 -11
  90. package/src/public/index.html +33 -21
  91. package/src/router/index.js +43 -41
  92. package/src/router/routes.js +312 -337
  93. package/src/shared/generalfuncs.js +210 -188
  94. package/src/shared/validators.js +1069 -249
  95. package/vite.config.js +27 -0
  96. package/.prettierrc.js +0 -5
  97. package/babel.config.js +0 -3
  98. package/src/components/AppBaseDragChoice.vue +0 -91
  99. package/src/components/AppBaseDropZone.vue +0 -112
  100. package/src/components/AppCompBif.vue +0 -120
  101. package/src/components/AppCompDragAndDrop.vue +0 -339
  102. package/src/components/AppCompInputAssociation.vue +0 -332
  103. package/src/components/AppCompInputCheckBox.vue +0 -227
  104. package/src/components/AppCompInputDropdown.vue +0 -184
  105. package/src/components/AppCompInputRadio.vue +0 -169
  106. package/src/components/AppCompInputTextTable.vue +0 -155
  107. package/src/components/AppCompInputTextToFillDropdown.vue +0 -255
  108. package/src/components/AppCompMediaPlayer.vue +0 -397
  109. package/src/components/AppCompPopUp.vue +0 -522
  110. package/src/components/AppCompPopover.vue +0 -27
  111. package/src/components/AppCompSVG.vue +0 -309
  112. package/src/mixins/$pageMixins.js +0 -459
  113. package/src/mixins/$quizMixins.js +0 -456
  114. package/src/module/store.js +0 -895
  115. package/src/plugins/timeManager.js +0 -77
  116. package/src/routes_bckp.js +0 -313
  117. package/src/routes_static.js +0 -344
  118. package/vue.config.js +0 -83
@@ -1,456 +0,0 @@
1
- const $extendsQuiz = {
2
- watch: {
3
- /**
4
- * @description used to call a validation
5
- */
6
- quizSubmit(newValue) {
7
- if (newValue == true) {
8
- this.validateAnswers()
9
- }
10
- }
11
- },
12
-
13
- methods: {
14
- /**
15
- * @param {String} inputId
16
- * @returns {Array} the class
17
- */
18
- classInput(inputId) {
19
- let theClass = []
20
-
21
- switch (this.inputType) {
22
- case 'choix_unique':
23
- if (inputId == this.quizInputUnique) {
24
- theClass.push('reponseSelectionner')
25
- }
26
- break
27
-
28
- case 'choix_mult':
29
- if (this.containsValue(this.quizInputMultiple, inputId)) {
30
- theClass.push('reponseSelectionner')
31
- }
32
- }
33
-
34
- if (this.showSolution) {
35
- if (this.solution !== null) {
36
- switch (this.inputType) {
37
- case 'choix_unique':
38
- if (inputId == this.solution) {
39
- theClass.push('correct_answer')
40
- } else {
41
- theClass.push('wrong_answer')
42
- }
43
- break
44
-
45
- case 'choix_mult':
46
- if (this.containsValue(this.solution, inputId)) {
47
- theClass.push('correct_answer')
48
- } else {
49
- theClass.push('wrong_answer')
50
- }
51
- break
52
-
53
- case 'dropdown':
54
- if (this.solution[inputId] == this.quizSelectedValue[inputId]) {
55
- theClass.push('correct_answer')
56
- } else {
57
- theClass.push('wrong_answer')
58
- }
59
- break
60
-
61
- case 'texte_troue_select':
62
- if (typeof this.quizSelectedValue[inputId] !== 'undefined') {
63
- if (
64
- Object.values(this.solution[inputId])[0] ==
65
- this.quizSelectedValue[inputId]
66
- ) {
67
- theClass.push('correct_answer')
68
- } else {
69
- theClass.push('wrong_answer')
70
- }
71
- }
72
- break
73
-
74
- case 'reponse_ouverte':
75
- if (this.solution == this.quizTextArea) {
76
- theClass.push('correct_answer')
77
- } else {
78
- theClass.push('wrong_answer')
79
- }
80
- break
81
- case 'texte_tableau':
82
- if (
83
- this.containsValue(
84
- this.solution[inputId].reponse_value,
85
- this.quizTextTableValue[inputId]
86
- )
87
- ) {
88
- theClass.push('correct_answer')
89
- } else {
90
- theClass.push('wrong_answer')
91
- }
92
- break
93
- case 'texte_troue':
94
- if (typeof this.quizTextTableValue[inputId] !== 'undefined') {
95
- if (
96
- this.containsValue(
97
- Object.values(this.solution[inputId])[0],
98
- this.quizTextTableValue[inputId]
99
- )
100
- ) {
101
- theClass.push('correct_answer')
102
- } else {
103
- theClass.push('wrong_answer')
104
- }
105
- }
106
- break
107
- case 'association':
108
- if (
109
- this.solution[inputId] == this.quizAssociationValue[inputId]
110
- ) {
111
- theClass.push('correct_answer')
112
- } else {
113
- theClass.push('wrong_answer')
114
- }
115
- break
116
- case 'dragdrop':
117
- if (
118
- this.solution &&
119
- this.solution[inputId] &&
120
- this.quizDragDropValue &&
121
- this.quizDragDropValue[inputId]
122
- ) {
123
- //remove sort if order is important
124
- const solution = [...this.solution[inputId]].sort(function(
125
- a,
126
- b
127
- ) {
128
- return a - b
129
- })
130
- const values = [...this.quizDragDropValue[inputId]].sort(
131
- function(a, b) {
132
- return a - b
133
- }
134
- )
135
- if (this.isEqual(solution, values)) {
136
- theClass.push('correct_answer')
137
- } else {
138
- theClass.push('wrong_answer')
139
- }
140
- }
141
- }
142
- }
143
- }
144
- return theClass
145
- },
146
- messageAccessibility(inputId) {
147
- let mess = ''
148
- if (this.showSolution) {
149
- if (this.solution !== null) {
150
- switch (this.inputType) {
151
- case 'choix_unique':
152
- if (inputId == this.solution) {
153
- mess = `${this.$t('quizState.goodAnswer')}`
154
- } else {
155
- mess = `${this.$t('quizState.badAnswer')}`
156
- }
157
- break
158
-
159
- case 'choix_mult':
160
- if (this.containsValue(this.solution, inputId)) {
161
- mess = `${this.$t('quizState.goodAnswer')}`
162
- } else {
163
- mess = `${this.$t('quizState.badAnswer')}`
164
- }
165
- break
166
-
167
- case 'dropdown':
168
- if (this.solution[inputId] == this.quizSelectedValue[inputId]) {
169
- mess = `${this.$t('quizState.goodAnswer')}`
170
- } else {
171
- mess = `${this.$t('quizState.badAnswer')}`
172
- }
173
- break
174
-
175
- case 'texte_troue_select':
176
- if (typeof this.quizSelectedValue[inputId] !== 'undefined') {
177
- if (
178
- Object.values(this.solution[inputId])[0] ==
179
- this.quizSelectedValue[inputId]
180
- ) {
181
- mess = `${this.$t('quizState.goodAnswer')}`
182
- } else {
183
- mess = `${this.$t('quizState.badAnswer')}`
184
- }
185
- }
186
- break
187
-
188
- case 'reponse_ouverte':
189
- if (this.solution == this.quizTextArea) {
190
- mess = `${this.$t('quizState.goodAnswer')}`
191
- } else {
192
- mess = `${this.$t('quizState.badAnswer')}`
193
- }
194
- break
195
- case 'texte_tableau':
196
- if (
197
- this.containsValue(
198
- this.solution[inputId].reponse_value,
199
- this.quizTextTableValue[inputId]
200
- )
201
- ) {
202
- mess = `${this.$t('quizState.goodAnswer')}`
203
- } else {
204
- mess = `${this.$t('quizState.badAnswer')}`
205
- }
206
- break
207
- case 'texte_troue':
208
- if (typeof this.quizTextTableValue[inputId] !== 'undefined') {
209
- if (
210
- this.containsValue(
211
- Object.values(this.solution[inputId])[0],
212
- this.quizTextTableValue[inputId]
213
- )
214
- ) {
215
- mess = `${this.$t('quizState.goodAnswer')}`
216
- } else {
217
- mess = `${this.$t('quizState.badAnswer')}`
218
- }
219
- }
220
- break
221
- case 'association':
222
- if (
223
- this.solution[inputId] == this.quizAssociationValue[inputId]
224
- ) {
225
- mess = `${this.$t('quizState.goodAnswer')}`
226
- } else {
227
- mess = `${this.$t('quizState.badAnswer')}`
228
- }
229
- break
230
- case 'dragdrop':
231
- if (
232
- this.solution &&
233
- this.solution[inputId] &&
234
- this.quizDragDropValue &&
235
- this.quizDragDropValue[inputId]
236
- ) {
237
- //remove sort if order is important
238
- const solution = [...this.solution[inputId]].sort(function(
239
- a,
240
- b
241
- ) {
242
- return a - b
243
- })
244
- const values = [...this.quizDragDropValue[inputId]].sort(
245
- function(a, b) {
246
- return a - b
247
- }
248
- )
249
- if (this.isEqual(solution, values)) {
250
- mess = `${this.$t('quizState.goodAnswer')}`
251
- } else {
252
- mess = `${this.$t('quizState.badAnswer')}`
253
- }
254
- }
255
- }
256
- }
257
- }
258
- return mess
259
- },
260
- /**
261
- * @description check if this question is correct
262
- * @fires quiz-submit to AppCompQuiz.vue
263
- */
264
- validateAnswers() {
265
- let theAnswer = {}
266
-
267
- switch (this.inputType) {
268
- case 'choix_unique': {
269
- let listInput = this.quizInputUnique
270
- if (listInput) {
271
- theAnswer = {
272
- [this.inputDataId]: listInput
273
- }
274
- } else {
275
- //did not answered
276
- theAnswer = null
277
- }
278
- break
279
- }
280
-
281
- case 'choix_mult': {
282
- let listInputCheck = this.quizInputMultiple
283
- if (listInputCheck.length > 0) {
284
- theAnswer = {
285
- [this.inputDataId]: listInputCheck
286
- }
287
- } else {
288
- //did not answered
289
- theAnswer = null
290
- }
291
-
292
- break
293
- }
294
-
295
- case 'dropdown': {
296
- let listQuizSelected = this.quizSelected
297
-
298
- if (
299
- listQuizSelected.length == this.inputData.length &&
300
- !this.containsValue(listQuizSelected, null)
301
- ) {
302
- let listQuizSelectedConvert = []
303
- for (let index = 0; index < this.inputData.length; index++) {
304
- const element = this.inputData[index]
305
- listQuizSelectedConvert.push({
306
- question_id: element.id,
307
- reponse_id: listQuizSelected[index]
308
- })
309
- }
310
- theAnswer = {
311
- [this.inputDataId]: listQuizSelectedConvert
312
- }
313
- } else {
314
- //did not answered
315
- theAnswer = null
316
- }
317
- break
318
- }
319
-
320
- case 'texte_troue_select': {
321
- const regex = /\$%\S*%\$/g // regex pattern to match exp: $%number%$
322
- let matchAll = this.textBase.split(regex)
323
- let listQuizSelectedText = this.quizSelected
324
- if (
325
- listQuizSelectedText.length == matchAll.length - 1 &&
326
- !this.containsValue(listQuizSelectedText, null)
327
- ) {
328
- let listQuizSelectedTextConvert = []
329
- for (let index = 0; index < listQuizSelectedText.length; index++) {
330
- listQuizSelectedTextConvert.push({
331
- question_id: index,
332
- reponse_id: listQuizSelectedText[index]
333
- })
334
- }
335
- theAnswer = {
336
- [this.inputDataId]: listQuizSelectedTextConvert
337
- }
338
- } else {
339
- //did not answered
340
- theAnswer = null
341
- }
342
- break
343
- }
344
-
345
- case 'reponse_ouverte': {
346
- let listInputText = this.quizTextArea
347
- if (listInputText.length > 0) {
348
- theAnswer = {
349
- [this.inputDataId]: listInputText
350
- }
351
- } else {
352
- //did not answered
353
- theAnswer = null
354
- }
355
- break
356
- }
357
- case 'texte_tableau': {
358
- let listInputTextTable = this.quizTextTable
359
- if (
360
- listInputTextTable.length == this.inputData.length &&
361
- !this.containsValue(listInputTextTable, null) &&
362
- !this.containsValue(listInputTextTable, '')
363
- ) {
364
- let listInputTextTableConvert = []
365
- for (let index = 0; index < this.inputData.length; index++) {
366
- const element = this.inputData[index]
367
- listInputTextTableConvert.push({
368
- question_id: element.id,
369
- reponse: listInputTextTable[index]
370
- })
371
- }
372
- theAnswer = {
373
- [this.inputDataId]: listInputTextTableConvert
374
- }
375
- } else {
376
- //did not answered
377
- theAnswer = null
378
- }
379
- break
380
- }
381
-
382
- case 'texte_troue': {
383
- const regex = /\$%\S*%\$/g // regex pattern to match exp: $%number%$
384
- let matchAll = this.textBase.split(regex)
385
- let listInputTextFill = this.quizTextTable
386
- if (
387
- listInputTextFill.length == matchAll.length - 1 &&
388
- !this.containsValue(listInputTextFill, null) &&
389
- !this.containsValue(listInputTextFill, '')
390
- ) {
391
- let listInputTextFillConvert = []
392
- for (let index = 0; index < listInputTextFill.length; index++) {
393
- listInputTextFillConvert.push({
394
- question_id: index,
395
- reponse: listInputTextFill[index]
396
- })
397
- }
398
- theAnswer = {
399
- [this.inputDataId]: listInputTextFillConvert
400
- }
401
- } else {
402
- //did not answered
403
- theAnswer = null
404
- }
405
- break
406
- }
407
-
408
- case 'association': {
409
- let listInputAssociation = this.quizAssociation
410
- if (
411
- Object.values(listInputAssociation).length ==
412
- Object.values(this.solution).length &&
413
- !this.containsValue(Object.values(listInputAssociation), '')
414
- ) {
415
- theAnswer = {
416
- [this.inputDataId]: listInputAssociation
417
- }
418
- } else {
419
- //did not answered
420
- theAnswer = null
421
- }
422
- break
423
- }
424
-
425
- case 'dragdrop': {
426
- let listInputDragDrop = this.quizDragDrop
427
- if (
428
- Object.keys(listInputDragDrop).length ==
429
- Object.keys(this.solution).length
430
- ) {
431
- theAnswer = {
432
- [this.inputDataId]: this.quizDragDrop
433
- }
434
- } else {
435
- //did not answered
436
- theAnswer = null
437
- }
438
- }
439
- }
440
- this.$emit('quiz-submit', theAnswer)
441
- },
442
- /**
443
- * @description - Method to get the question
444
- */
445
- getQuizQuestion() {
446
- const el = document.querySelector(`#${this.aBy}`)
447
- if (!el || !el.innerHTML) return
448
- const labelFor =
449
- this.$i18n.locale === 'fr'
450
- ? 'Choix de reponse pour la'
451
- : 'Answers available for the'
452
- return `${labelFor} ${el.innerText}`
453
- }
454
- }
455
- }
456
- export default $extendsQuiz