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,233 +1,195 @@
1
- <template>
2
- <div class="input-box">
3
- <fieldset>
4
- <legend
5
- :id="`lgd_${inputDataId}`"
6
- class="sr-only"
7
- tabindex="-1"
8
- v-html="$t('quizState.answers')"
9
- />
10
-
11
- <template v-for="choixReponse in inputDataValue">
12
- <div
13
- :Key="`div_chx_${inputDataId}_${choixReponse.id}`"
14
- class="box-checkbox"
15
- >
16
- <label
17
- :key="`lbl_chx_${inputDataId}-${choixReponse.id}`"
18
- :for="`chx_${inputDataId}_${choixReponse.id}`"
19
- :class="classInput(choixReponse.id)"
20
- class="checkbox-label"
21
- >
22
- <input
23
- :id="`chx_${inputDataId}_${choixReponse.id}`"
24
- :key="`chx_${inputDataId}_${inputDataId}-${choixReponse.id}`"
25
- v-model="quizInputMultipleValue"
26
- type="checkbox"
27
- :value="choixReponse.id"
28
- :name="`btn-checkbox-${inputDataId}`"
29
- :disabled="quizCompleted"
30
- class="checkbox-input"
31
- :aria-labelledby="`span_${inputDataId}_${choixReponse.id}`"
32
- />
33
- <span
34
- :id="`span_${inputDataId}_${choixReponse.id}`"
35
- class="checkbox-contenu"
36
- aria-hidden="true"
37
- v-html="choixReponse.value"
38
- ></span>
39
- <span
40
- :id="`${inputDataId}_${choixReponse.id}-msg-erreur`"
41
- :key="`msg_chx_${inputDataId}_${choixReponse.id}`"
42
- class="sr-only"
43
- >
44
- {{ messageAccessibility(choixReponse.id) }}
45
- </span>
46
- </label>
47
- </div>
48
- </template>
49
- </fieldset>
50
- </div>
51
- </template>
52
- <script>
53
- import $extendsQuiz from '../mixins/$quizMixins'
54
- export default {
55
- name: 'AppCompInputCheckBox',
56
- mixins: [$extendsQuiz],
57
- props: {
58
- inputType: {
59
- type: String,
60
- default: ''
61
- },
62
- inputDataId: {
63
- type: String,
64
- default: ''
65
- },
66
- inputData: {
67
- type: Array,
68
- default: () => []
69
- },
70
- quizCompleted: {
71
- type: Boolean,
72
- default: false
73
- },
74
- solution: {
75
- type: Array,
76
- default: () => []
77
- },
78
- showSolution: {
79
- type: Boolean,
80
- default: false
81
- },
82
- shuffleAnswers: {
83
- type: Boolean,
84
- default: false
85
- },
86
- quizInputMultiple: {
87
- type: Array,
88
- default: () => []
89
- }, //use to pass the value of the input
90
- quizSubmit: {
91
- type: Boolean,
92
- default: false
93
- }, //use to call a submit
94
- aBy: {
95
- type: String,
96
- default: ''
97
- } // use to pass id of the related question for the choices
98
- },
99
-
100
- data() {
101
- return {
102
- inputDataValue: [],
103
- quizInputMultipleValue: [] //not using quizInputMultiple because quizInputMultiple is a prop
104
- }
105
- },
106
-
107
- computed: {},
108
-
109
- watch: {
110
- /**
111
- * @description to pass value to AppCompQuiz
112
- * @fires input-change to AppCompQuiz.vue
113
- */
114
- quizInputMultipleValue(newValue) {
115
- this.$emit('input-change', newValue)
116
- },
117
-
118
- /**
119
- * @description to pass the value from AppCompQuiz
120
- */
121
- quizInputMultiple(newValue) {
122
- this.quizInputMultipleValue = newValue
123
- }
124
- },
125
-
126
- mounted() {
127
- if (this.solution !== null) {
128
- this.solution.sort(function (a, b) {
129
- return a - b
130
- })
131
- }
132
- this.quizInputMultipleValue = this.quizInputMultiple
133
-
134
- if (this.shuffleAnswers) {
135
- this.inputDataValue = this.shuffleArray(this.inputData)
136
- } else {
137
- this.inputDataValue = this.inputData
138
- }
139
- },
140
-
141
- methods: {
142
- /**
143
- * @description compares 2 array
144
- * @param {Array} array1
145
- * @param {Array} array2
146
- * @returns {Boolean}
147
- */
148
- isEqual(array1, array2) {
149
- // if length is not equal
150
- if (array1.length != array2.length) {
151
- return false
152
- } else {
153
- // comapring each element of array
154
- for (let i = 0; i < array1.length; i++) {
155
- if (array1[i] != array2[i]) {
156
- return false
157
- }
158
- }
159
- return true
160
- }
161
- },
162
-
163
- /**
164
- * @description check if a values exists in a array
165
- * @param {Array} array
166
- * @param value
167
- * @returns {Boolean}
168
- */
169
- containsValue(array, value) {
170
- return array.includes(value)
171
- },
172
-
173
- /**
174
- * @description shuffles an array used to randomized the option order if shuffleAnswers is true
175
- * @param {Array} array
176
- * @returns {Array}
177
- */
178
- shuffleArray(array) {
179
- let newArray = []
180
- let newArray2 = []
181
-
182
- for (let i = 0; i < array.length; i++) {
183
- const element = array[i]
184
- //todo remove null values
185
- newArray.push(element)
186
- }
187
- while (newArray.length > 0) {
188
- let pos = Math.floor(newArray.length * Math.random())
189
- newArray2.push(newArray[pos])
190
- newArray.splice(pos, 1)
191
- }
192
- return newArray2
193
- }
194
- }
195
- }
196
- </script>
197
- <style lang="scss">
198
- .custom-control-input:focus ~ .custom-control-label::before {
199
- border: inherit;
200
- }
201
-
202
- .custom-control-input:focus ~ .custom-control-label::before {
203
- box-shadow: inherit;
204
- -webkit-box-shadow: inherit;
205
- }
206
-
207
- .custom-checkbox {
208
- width: 100%;
209
- height: 100%;
210
- padding-left: 0;
211
-
212
- input {
213
- width: 100%;
214
- height: 100%;
215
- }
216
-
217
- label {
218
- width: 100%;
219
- height: 100%;
220
-
221
- &:after,
222
- &:before {
223
- border: inherit;
224
- top: 0px;
225
- left: 0px;
226
- height: 0;
227
- width: 0;
228
- background-color: inherit;
229
- border: inherit;
230
- }
231
- }
232
- }
233
- </style>
1
+ <!-- About this Component--
2
+ * Renders a checkboxe input type for the Quiz component
3
+ * Related Quiz to question: REPONSE_MULTIPLE
4
+ * Receives the a data object defined by user
5
+ * Used by AppCompQuizNext
6
+ -->
7
+ <template>
8
+ <div class="input-box">
9
+ <fieldset>
10
+ <legend
11
+ :id="`lgd_${inputDataId}`"
12
+ class="sr-only"
13
+ tabindex="-1"
14
+ v-html="$t('quizState.answers')"
15
+ />
16
+
17
+ <template
18
+ v-for="choixReponse in inputDataValue"
19
+ :Key="`div_chx_${inputDataId}_${choixReponse.id}`"
20
+ >
21
+ <div class="box-checkbox" role="group">
22
+ <label
23
+ :key="`lbl_chx_${inputDataId}-${choixReponse.id}`"
24
+ :for="`chx_${inputDataId}_${choixReponse.id}`"
25
+ :class="classInput(choixReponse.id)"
26
+ class="checkbox-label"
27
+ >
28
+ <input
29
+ :id="`chx_${inputDataId}_${choixReponse.id}`"
30
+ :key="`chx_${inputDataId}_${inputDataId}-${choixReponse.id}`"
31
+ v-model="quizInputMultipleValue"
32
+ type="checkbox"
33
+ :value="choixReponse.id"
34
+ :name="`btn-checkbox-${inputDataId}`"
35
+ :disabled="quizLimitActive"
36
+ class="checkbox-input"
37
+ :aria-labelledby="`span_${inputDataId}_${choixReponse.id}`"
38
+ />
39
+ <span
40
+ :id="`span_${inputDataId}_${choixReponse.id}`"
41
+ class="checkbox-contenu"
42
+ aria-hidden="true"
43
+ v-html="choixReponse.value"
44
+ ></span>
45
+ <span
46
+ :id="`${inputDataId}_${choixReponse.id}-msg-erreur`"
47
+ :key="`msg_chx_${inputDataId}_${choixReponse.id}`"
48
+ class="sr-only"
49
+ >
50
+ {{ messageAccessibility(choixReponse.id) }}
51
+ </span>
52
+ </label>
53
+ </div>
54
+ </template>
55
+ </fieldset>
56
+ </div>
57
+ </template>
58
+ <script>
59
+ import { useQuiz } from '../composables/useQuiz'
60
+ import { toRefs } from 'vue'
61
+ export default {
62
+ name: 'AppCompInputCheckBoxNext',
63
+
64
+ props: {
65
+ quizType: {
66
+ type: String,
67
+ default: ''
68
+ },
69
+
70
+ inputDataId: {
71
+ type: String,
72
+ default: ''
73
+ },
74
+ inputData: {
75
+ type: Array,
76
+ default: () => []
77
+ },
78
+ quizInputType: {
79
+ type: Array,
80
+ default: () => []
81
+ },
82
+ solution: {
83
+ type: Array,
84
+ default: () => []
85
+ },
86
+ showSolution: {
87
+ type: Boolean,
88
+ default: false
89
+ },
90
+ shuffleAnswers: {
91
+ type: Boolean,
92
+ default: false
93
+ },
94
+ quizLimitActive: {
95
+ type: Boolean,
96
+ default: false
97
+ }, //use to set if quiz should be active or not
98
+
99
+ quizSubmit: {
100
+ type: Boolean,
101
+ default: false
102
+ } //use to call a submit
103
+ },
104
+ emits: ['input-change'],
105
+ setup(props) {
106
+ const { containsValue, shuffleArray, classInput, messageAccessibility } =
107
+ useQuiz(toRefs(props))
108
+
109
+ return { containsValue, shuffleArray, classInput, messageAccessibility }
110
+ },
111
+
112
+ data() {
113
+ return {
114
+ inputDataValue: [],
115
+ quizInputMultipleValue: [], //not using quizInputMultiple because quizInputMultiple is a prop
116
+ quizSolution: null
117
+ }
118
+ },
119
+
120
+ watch: {
121
+ /**
122
+ * @description to pass value to AppCompQuiz
123
+ * @fires input-change to AppCompQuiz.vue
124
+ */
125
+ quizInputMultipleValue: {
126
+ deep: true,
127
+ handler(newValue) {
128
+ this.$emit('input-change', newValue)
129
+ }
130
+ }
131
+ },
132
+
133
+ mounted() {
134
+ this.initQuiz()
135
+ },
136
+
137
+ methods: {
138
+ initQuiz() {
139
+ this.quizSolution = this.solution
140
+ if (this.quizSolution !== null) {
141
+ this.quizSolution.sort(function (a, b) {
142
+ return a - b
143
+ })
144
+ }
145
+ this.quizInputMultipleValue = this.quizInputType
146
+
147
+ if (this.shuffleAnswers)
148
+ return (this.inputDataValue = this.shuffleArray(this.inputData))
149
+
150
+ this.inputDataValue = this.inputData
151
+ }
152
+ }
153
+ }
154
+ </script>
155
+ <style lang="scss">
156
+ fieldset {
157
+ border: inherit;
158
+ }
159
+
160
+ .custom-control-input:focus ~ .custom-control-label::before {
161
+ border: inherit;
162
+ }
163
+
164
+ .custom-control-input:focus ~ .custom-control-label::before {
165
+ box-shadow: inherit;
166
+ -webkit-box-shadow: inherit;
167
+ }
168
+
169
+ .custom-checkbox {
170
+ width: 100%;
171
+ height: 100%;
172
+ padding-left: 0;
173
+
174
+ input {
175
+ width: 100%;
176
+ height: 100%;
177
+ }
178
+
179
+ label {
180
+ width: 100%;
181
+ height: 100%;
182
+
183
+ &:after,
184
+ &:before {
185
+ border: inherit;
186
+ top: 0px;
187
+ left: 0px;
188
+ height: 0;
189
+ width: 0;
190
+ background-color: inherit;
191
+ border: inherit;
192
+ }
193
+ }
194
+ }
195
+ </style>
@@ -0,0 +1,159 @@
1
+ <!-- About this Component--
2
+ * Renders a SELECT input to display choices of response for the Quiz component
3
+ * Related Quiz to question: DROPDOWN
4
+ * Receives the a data object defined by user
5
+ * Used by AppCompQuizNext
6
+ * Uses useQuiz composable
7
+ -->
8
+ <template>
9
+ <div class="input-box">
10
+ <div
11
+ v-for="singleDropdown in inputData"
12
+ :key="singleDropdown.id"
13
+ class="dropdown-container"
14
+ :class="`dropdownlist-${singleDropdown.id} ${classInput(singleDropdown.id, quizInputTypeValue)}`"
15
+ >
16
+ <label
17
+ :for="`${inputDataId}_${singleDropdown.id}`"
18
+ v-html="singleDropdown.ennonce"
19
+ ></label>
20
+
21
+ <v-select
22
+ :id="inputDataId + '_' + singleDropdown.id"
23
+ v-model="quizInputTypeValue[singleDropdown.id]"
24
+ item-title="text"
25
+ :items="singleDropdown.option"
26
+ :disabled="quizLimitActive"
27
+ />
28
+ </div>
29
+ </div>
30
+ </template>
31
+ <script>
32
+ import { useQuiz } from '../composables/useQuiz'
33
+ import { toRefs } from 'vue'
34
+ export default {
35
+ name: 'AppCompInputDropdown',
36
+
37
+ props: {
38
+ quizType: {
39
+ type: String,
40
+ default: ''
41
+ },
42
+ inputDataId: {
43
+ type: String,
44
+ default: ''
45
+ },
46
+ inputData: {
47
+ type: Array,
48
+ default: () => []
49
+ },
50
+ quizInputType: {
51
+ type: Array,
52
+ default: () => []
53
+ },
54
+ solution: {
55
+ type: Array,
56
+ default: () => []
57
+ },
58
+ showSolution: {
59
+ type: Boolean,
60
+ default: false
61
+ },
62
+ quizLimitActive: {
63
+ type: Boolean,
64
+ default: false
65
+ },
66
+ shuffleAnswers: {
67
+ type: Boolean,
68
+ default: false
69
+ },
70
+
71
+ quizSubmit: {
72
+ type: Boolean,
73
+ default: false
74
+ } //use to call a submit
75
+ },
76
+ emits: ['input-change'],
77
+ setup(props) {
78
+ const { containsValue, shuffleArray, classInput, messageAccessibility } =
79
+ useQuiz(toRefs(props))
80
+
81
+ return {
82
+ containsValue,
83
+ shuffleArray,
84
+ classInput,
85
+ messageAccessibility
86
+ }
87
+ },
88
+
89
+ data() {
90
+ return {
91
+ quizInputTypeValue: [], //not using quizInputType because quizInputType is a prop
92
+ quizSolution: null
93
+ }
94
+ },
95
+
96
+ computed: {},
97
+
98
+ watch: {
99
+ /**
100
+ * @description to pass value to AppCompQuiz
101
+ * @emits input-change
102
+ */
103
+ quizInputTypeValue: {
104
+ deep: true,
105
+ handler(newValue) {
106
+ this.$emit('input-change', newValue)
107
+ }
108
+ }
109
+ },
110
+
111
+ mounted() {
112
+ this.initQuiz()
113
+ },
114
+
115
+ methods: {
116
+ initQuiz() {
117
+ this.quizSolution = this.solution
118
+ if (this.quizSolution !== null) {
119
+ this.quizSolution.sort(function (a, b) {
120
+ return a - b
121
+ })
122
+ }
123
+ //to show the defaultAnswer
124
+ const defaultAnswer = {
125
+ value: null,
126
+ disabled: true,
127
+ text: this.$t('message.first_option_dropdown')
128
+ }
129
+ let selectedChoices = []
130
+ for (let i = 0; i < this.inputData.length; i++) {
131
+ let singleDropdown
132
+ if (this.shuffleAnswers) {
133
+ singleDropdown = this.inputData[i]
134
+ singleDropdown.option = this.shuffleArray(singleDropdown.option)
135
+ } else {
136
+ singleDropdown = this.inputData[i]
137
+ }
138
+ if (
139
+ this.inputData[i].option[0].text !==
140
+ this.$t('message.first_option_dropdown')
141
+ ) {
142
+ singleDropdown.option.unshift(defaultAnswer)
143
+ }
144
+ selectedChoices.push(null)
145
+ }
146
+ if (this.quizInputType.length == 0) {
147
+ this.quizInputTypeValue = selectedChoices
148
+ } else {
149
+ this.quizInputTypeValue = this.quizInputType
150
+ }
151
+ }
152
+ }
153
+ }
154
+ </script>
155
+ <style lang="scss">
156
+ .dropdown-container {
157
+ position: relative;
158
+ }
159
+ </style>