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.
Files changed (103) hide show
  1. package/.editorconfig +33 -33
  2. package/.eslintignore +29 -29
  3. package/.eslintrc.cjs +81 -81
  4. package/CHANGELOG +364 -364
  5. package/README.md +71 -71
  6. package/bk.scss +117 -117
  7. package/package.json +61 -47
  8. package/src/$locales/en.json +143 -193
  9. package/src/$locales/fr.json +105 -194
  10. package/src/assets/data/onboardingMessages.json +47 -47
  11. package/src/components/AppBase.vue +1054 -1049
  12. package/src/components/AppBaseButton.vue +87 -91
  13. package/src/components/AppBaseErrorDisplay.vue +438 -428
  14. package/src/components/AppBaseFlipCard.vue +84 -83
  15. package/src/components/AppBaseModule.vue +1673 -1666
  16. package/src/components/AppBasePage.vue +779 -324
  17. package/src/components/AppBasePopover.vue +41 -0
  18. package/src/components/AppCompAudio.vue +234 -266
  19. package/src/components/AppCompBranchButtons.vue +552 -571
  20. package/src/components/AppCompButtonProgress.vue +126 -132
  21. package/src/components/AppCompCarousel.vue +298 -196
  22. package/src/components/{AppCompInputCheckBox.vue → AppCompInputCheckBoxNext.vue} +195 -233
  23. package/src/components/AppCompInputDropdownNext.vue +159 -0
  24. package/src/components/{AppCompInputRadio.vue → AppCompInputRadioNext.vue} +152 -162
  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 -67
  30. package/src/components/AppCompMenu.vue +413 -402
  31. package/src/components/AppCompMenuItem.vue +228 -191
  32. package/src/components/AppCompNavigation.vue +960 -945
  33. package/src/components/AppCompNoteCall.vue +133 -141
  34. package/src/components/AppCompNoteCredit.vue +292 -267
  35. package/src/components/AppCompPlayBar.vue +1218 -1271
  36. package/src/components/AppCompPlayBarNext.vue +2052 -0
  37. package/src/components/AppCompPlayBarProgress.vue +82 -73
  38. package/src/components/AppCompPopUpNext.vue +503 -0
  39. package/src/components/{AppCompQuiz.vue → AppCompQuizNext.vue} +2904 -2975
  40. package/src/components/AppCompQuizRecall.vue +276 -277
  41. package/src/components/{AppCompSVG.vue → AppCompSVGNext.vue} +347 -335
  42. package/src/components/AppCompSettingsMenu.vue +172 -169
  43. package/src/components/AppCompTableOfContent.vue +387 -385
  44. package/src/components/AppCompTranscript.vue +24 -19
  45. package/src/components/AppCompVideoPlayer.vue +368 -380
  46. package/src/components/AppCompViewDisplay.vue +6 -6
  47. package/src/components/BaseModule.vue +72 -71
  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 -263
  52. package/src/mixins/$mediaMixins.js +819 -827
  53. package/src/mixins/timerMixin.js +155 -155
  54. package/src/module/stores/appStore.js +893 -0
  55. package/src/module/xapi/ADL.js +376 -376
  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 -315
  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 -1963
  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 -294
  85. package/src/plugins/i18n.js +44 -44
  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 -40
  92. package/src/router/routes.js +312 -317
  93. package/src/shared/generalfuncs.js +210 -195
  94. package/src/shared/validators.js +1069 -959
  95. package/vite.config.js +27 -0
  96. package/src/components/AppCompInputDropdown.vue +0 -182
  97. package/src/components/AppCompInputTextTable.vue +0 -158
  98. package/src/components/AppCompInputTextToFillDropdown.vue +0 -257
  99. package/src/components/AppCompPopUp.vue +0 -583
  100. package/src/components/AppCompPopover.vue +0 -27
  101. package/src/mixins/$pageMixins.js +0 -415
  102. package/src/mixins/$quizMixins.js +0 -442
  103. package/src/module/store.js +0 -1014
@@ -1,442 +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(
125
- function (a, b) {
126
- return a - b
127
- }
128
- )
129
- const values = [...this.quizDragDropValue[inputId]].sort(
130
- function (a, b) {
131
- return a - b
132
- }
133
- )
134
- if (this.isEqual(solution, values)) {
135
- theClass.push('correct_answer')
136
- } else {
137
- theClass.push('wrong_answer')
138
- }
139
- }
140
- }
141
- }
142
- }
143
- return theClass
144
- },
145
- messageAccessibility(inputId) {
146
- let mess = ''
147
- if (this.showSolution) {
148
- if (this.solution !== null) {
149
- switch (this.inputType) {
150
- case 'choix_unique':
151
- if (inputId == this.solution) {
152
- mess = `${this.$t('quizState.goodAnswer')}`
153
- } else {
154
- mess = `${this.$t('quizState.badAnswer')}`
155
- }
156
- break
157
-
158
- case 'choix_mult':
159
- if (this.containsValue(this.solution, inputId)) {
160
- mess = `${this.$t('quizState.goodAnswer')}`
161
- } else {
162
- mess = `${this.$t('quizState.badAnswer')}`
163
- }
164
- break
165
-
166
- case 'dropdown':
167
- if (this.solution[inputId] == this.quizSelectedValue[inputId]) {
168
- mess = `${this.$t('quizState.goodAnswer')}`
169
- } else {
170
- mess = `${this.$t('quizState.badAnswer')}`
171
- }
172
- break
173
-
174
- case 'texte_troue_select':
175
- if (typeof this.quizSelectedValue[inputId] !== 'undefined') {
176
- if (
177
- Object.values(this.solution[inputId])[0] ==
178
- this.quizSelectedValue[inputId]
179
- ) {
180
- mess = `${this.$t('quizState.goodAnswer')}`
181
- } else {
182
- mess = `${this.$t('quizState.badAnswer')}`
183
- }
184
- }
185
- break
186
-
187
- case 'reponse_ouverte':
188
- if (this.solution == this.quizTextArea) {
189
- mess = `${this.$t('quizState.goodAnswer')}`
190
- } else {
191
- mess = `${this.$t('quizState.badAnswer')}`
192
- }
193
- break
194
- case 'texte_tableau':
195
- if (
196
- this.containsValue(
197
- this.solution[inputId].reponse_value,
198
- this.quizTextTableValue[inputId]
199
- )
200
- ) {
201
- mess = `${this.$t('quizState.goodAnswer')}`
202
- } else {
203
- mess = `${this.$t('quizState.badAnswer')}`
204
- }
205
- break
206
- case 'texte_troue':
207
- if (typeof this.quizTextTableValue[inputId] !== 'undefined') {
208
- if (
209
- this.containsValue(
210
- Object.values(this.solution[inputId])[0],
211
- this.quizTextTableValue[inputId]
212
- )
213
- ) {
214
- mess = `${this.$t('quizState.goodAnswer')}`
215
- } else {
216
- mess = `${this.$t('quizState.badAnswer')}`
217
- }
218
- }
219
- break
220
- case 'association':
221
- if (
222
- this.solution[inputId] == this.quizAssociationValue[inputId]
223
- ) {
224
- mess = `${this.$t('quizState.goodAnswer')}`
225
- } else {
226
- mess = `${this.$t('quizState.badAnswer')}`
227
- }
228
- break
229
- case 'dragdrop':
230
- if (
231
- this.solution &&
232
- this.solution[inputId] &&
233
- this.quizDragDropValue &&
234
- this.quizDragDropValue[inputId]
235
- ) {
236
- //remove sort if order is important
237
- const solution = [...this.solution[inputId]].sort(
238
- function (a, b) {
239
- return a - b
240
- }
241
- )
242
- const values = [...this.quizDragDropValue[inputId]].sort(
243
- function (a, b) {
244
- return a - b
245
- }
246
- )
247
- if (this.isEqual(solution, values)) {
248
- mess = `${this.$t('quizState.goodAnswer')}`
249
- } else {
250
- mess = `${this.$t('quizState.badAnswer')}`
251
- }
252
- }
253
- }
254
- }
255
- }
256
- return mess
257
- },
258
- /**
259
- * @description check if this question is correct
260
- * @fires quiz-submit to AppCompQuiz.vue
261
- */
262
- validateAnswers() {
263
- let theAnswer = {}
264
-
265
- switch (this.inputType) {
266
- case 'choix_unique': {
267
- let listInput = this.quizInputUnique
268
- if (listInput) {
269
- theAnswer = {
270
- [this.inputDataId]: listInput
271
- }
272
- } else {
273
- //did not answered
274
- theAnswer = null
275
- }
276
- break
277
- }
278
-
279
- case 'choix_mult': {
280
- let listInputCheck = this.quizInputMultiple
281
- if (listInputCheck.length > 0) {
282
- theAnswer = {
283
- [this.inputDataId]: listInputCheck
284
- }
285
- } else {
286
- //did not answered
287
- theAnswer = null
288
- }
289
-
290
- break
291
- }
292
-
293
- case 'dropdown': {
294
- let listQuizSelected = this.quizSelected
295
-
296
- if (
297
- listQuizSelected.length == this.inputData.length &&
298
- !this.containsValue(listQuizSelected, null)
299
- ) {
300
- let listQuizSelectedConvert = []
301
- for (let index = 0; index < this.inputData.length; index++) {
302
- const element = this.inputData[index]
303
- listQuizSelectedConvert.push({
304
- question_id: element.id,
305
- reponse_id: listQuizSelected[index]
306
- })
307
- }
308
- theAnswer = {
309
- [this.inputDataId]: listQuizSelectedConvert
310
- }
311
- } else {
312
- //did not answered
313
- theAnswer = null
314
- }
315
- break
316
- }
317
-
318
- case 'texte_troue_select': {
319
- const regex = /\$%\S*%\$/g // regex pattern to match exp: $%number%$
320
- let matchAll = this.textBase.split(regex)
321
- let listQuizSelectedText = this.quizSelected
322
- if (
323
- listQuizSelectedText.length == matchAll.length - 1 &&
324
- !this.containsValue(listQuizSelectedText, null)
325
- ) {
326
- let listQuizSelectedTextConvert = []
327
- for (let index = 0; index < listQuizSelectedText.length; index++) {
328
- listQuizSelectedTextConvert.push({
329
- question_id: index,
330
- reponse_id: listQuizSelectedText[index]
331
- })
332
- }
333
- theAnswer = {
334
- [this.inputDataId]: listQuizSelectedTextConvert
335
- }
336
- } else {
337
- //did not answered
338
- theAnswer = null
339
- }
340
- break
341
- }
342
-
343
- case 'reponse_ouverte': {
344
- let listInputText = this.quizTextArea
345
- if (listInputText.length > 0) {
346
- theAnswer = {
347
- [this.inputDataId]: listInputText
348
- }
349
- } else {
350
- //did not answered
351
- theAnswer = null
352
- }
353
- break
354
- }
355
- case 'texte_tableau': {
356
- let listInputTextTable = this.quizTextTable
357
- if (
358
- listInputTextTable.length == this.inputData.length &&
359
- !this.containsValue(listInputTextTable, null) &&
360
- !this.containsValue(listInputTextTable, '')
361
- ) {
362
- let listInputTextTableConvert = []
363
- for (let index = 0; index < this.inputData.length; index++) {
364
- const element = this.inputData[index]
365
- listInputTextTableConvert.push({
366
- question_id: element.id,
367
- reponse: listInputTextTable[index]
368
- })
369
- }
370
- theAnswer = {
371
- [this.inputDataId]: listInputTextTableConvert
372
- }
373
- } else {
374
- //did not answered
375
- theAnswer = null
376
- }
377
- break
378
- }
379
-
380
- case 'texte_troue': {
381
- const regex = /\$%\S*%\$/g // regex pattern to match exp: $%number%$
382
- let matchAll = this.textBase.split(regex)
383
- let listInputTextFill = this.quizTextTable
384
- if (
385
- listInputTextFill.length == matchAll.length - 1 &&
386
- !this.containsValue(listInputTextFill, null) &&
387
- !this.containsValue(listInputTextFill, '')
388
- ) {
389
- let listInputTextFillConvert = []
390
- for (let index = 0; index < listInputTextFill.length; index++) {
391
- listInputTextFillConvert.push({
392
- question_id: index,
393
- reponse: listInputTextFill[index]
394
- })
395
- }
396
- theAnswer = {
397
- [this.inputDataId]: listInputTextFillConvert
398
- }
399
- } else {
400
- //did not answered
401
- theAnswer = null
402
- }
403
- break
404
- }
405
-
406
- case 'association': {
407
- let listInputAssociation = this.quizAssociation
408
- if (
409
- Object.values(listInputAssociation).length ==
410
- Object.values(this.solution).length &&
411
- !this.containsValue(Object.values(listInputAssociation), '')
412
- ) {
413
- theAnswer = {
414
- [this.inputDataId]: listInputAssociation
415
- }
416
- } else {
417
- //did not answered
418
- theAnswer = null
419
- }
420
- break
421
- }
422
-
423
- case 'dragdrop': {
424
- let listInputDragDrop = this.quizDragDrop
425
- if (
426
- Object.keys(listInputDragDrop).length ==
427
- Object.keys(this.solution).length
428
- ) {
429
- theAnswer = {
430
- [this.inputDataId]: this.quizDragDrop
431
- }
432
- } else {
433
- //did not answered
434
- theAnswer = null
435
- }
436
- }
437
- }
438
- this.$emit('quiz-submit', theAnswer)
439
- }
440
- }
441
- }
442
- export default $extendsQuiz