fcad-core-dragon 2.0.0-beta.0 → 2.0.0-beta.10

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 (161) hide show
  1. package/.editorconfig +6 -31
  2. package/.prettierrc +11 -0
  3. package/.vscode/extensions.json +8 -0
  4. package/.vscode/settings.json +16 -0
  5. package/CHANGELOG +153 -0
  6. package/README.md +28 -43
  7. package/documentation/.vitepress/config.js +114 -0
  8. package/documentation/api-examples.md +49 -0
  9. package/documentation/composants/app-base-button.md +58 -0
  10. package/documentation/composants/app-base-error-display.md +59 -0
  11. package/documentation/composants/app-base-popover.md +68 -0
  12. package/documentation/composants/app-comp-audio.md +75 -0
  13. package/documentation/composants/app-comp-branch-buttons.md +111 -0
  14. package/documentation/composants/app-comp-button-progress.md +53 -0
  15. package/documentation/composants/app-comp-carousel.md +53 -0
  16. package/documentation/composants/app-comp-container.md +53 -0
  17. package/documentation/composants/app-comp-input-checkbox-next.md +42 -0
  18. package/documentation/composants/app-comp-input-dropdown-next.md +34 -0
  19. package/documentation/composants/app-comp-input-radio-next.md +39 -0
  20. package/documentation/composants/app-comp-input-text-next.md +35 -0
  21. package/documentation/composants/app-comp-input-text-table-next.md +34 -0
  22. package/documentation/composants/app-comp-input-text-to-fill-dropdown-next.md +53 -0
  23. package/documentation/composants/app-comp-input-text-to-fill-next.md +31 -0
  24. package/documentation/composants/app-comp-jauge.md +31 -0
  25. package/documentation/composants/app-comp-menu-item.md +55 -0
  26. package/documentation/composants/app-comp-menu.md +29 -0
  27. package/documentation/composants/app-comp-navigation.md +41 -0
  28. package/documentation/composants/app-comp-note-call.md +53 -0
  29. package/documentation/composants/app-comp-note-credit.md +53 -0
  30. package/documentation/composants/app-comp-play-bar-next.md +53 -0
  31. package/documentation/composants/app-comp-pop-up-next.md +93 -0
  32. package/documentation/composants/app-comp-quiz-next.md +235 -0
  33. package/documentation/composants/app-comp-quiz-recall.md +53 -0
  34. package/documentation/composants/app-comp-svg-next.md +53 -0
  35. package/documentation/composants/app-comp-table-of-content.md +50 -0
  36. package/documentation/composants/app-comp-video-player.md +82 -0
  37. package/documentation/composants.md +46 -0
  38. package/documentation/composants_critiques/ModelPageComposant.md +53 -0
  39. package/documentation/composants_critiques/app-base-module.md +43 -0
  40. package/documentation/composants_critiques/app-base-page.md +48 -0
  41. package/documentation/composants_critiques/app-base.md +311 -0
  42. package/documentation/composants_critiques/main.md +15 -0
  43. package/documentation/demarrage.md +50 -0
  44. package/documentation/deploiement.md +58 -0
  45. package/documentation/index.md +33 -0
  46. package/documentation/markdown-examples.md +85 -0
  47. package/documentation/public/npm_version.png +0 -0
  48. package/documentation/public/vite.svg +15 -0
  49. package/documentation/public/vuejs.svg +2 -0
  50. package/documentation/public/vuetify.svg +6 -0
  51. package/eslint.config.js +60 -0
  52. package/package.json +43 -49
  53. package/src/$locales/en.json +94 -92
  54. package/src/$locales/fr.json +77 -113
  55. package/src/assets/data/onboardingMessages.json +1 -1
  56. package/src/components/AppBase.vue +971 -437
  57. package/src/components/AppBaseButton.test.js +21 -0
  58. package/src/components/AppBaseButton.vue +42 -10
  59. package/src/components/AppBaseErrorDisplay.vue +209 -162
  60. package/src/components/AppBaseFlipCard.vue +1 -0
  61. package/src/components/AppBaseModule.vue +1021 -976
  62. package/src/components/AppBasePage.vue +656 -128
  63. package/src/components/AppBasePopover.vue +41 -0
  64. package/src/components/AppBaseSkeleton.vue +66 -0
  65. package/src/components/AppCompAudio.vue +256 -0
  66. package/src/components/AppCompBranchButtons.vue +108 -181
  67. package/src/components/AppCompButtonProgress.vue +44 -70
  68. package/src/components/AppCompCarousel.vue +284 -233
  69. package/src/components/AppCompContainer.vue +29 -0
  70. package/src/components/AppCompInputCheckBoxNx.vue +323 -0
  71. package/src/components/AppCompInputDropdownNx.vue +299 -0
  72. package/src/components/AppCompInputRadioNx.vue +284 -0
  73. package/src/components/AppCompInputTextNx.vue +153 -0
  74. package/src/components/AppCompInputTextTableNx.vue +202 -0
  75. package/src/components/AppCompInputTextToFillDropdownNx.vue +340 -0
  76. package/src/components/AppCompInputTextToFillNx.vue +313 -0
  77. package/src/components/AppCompJauge.vue +36 -11
  78. package/src/components/AppCompMenu.vue +312 -92
  79. package/src/components/AppCompMenuItem.vue +129 -105
  80. package/src/components/AppCompNavigation.vue +972 -0
  81. package/src/components/AppCompNoteCall.vue +161 -0
  82. package/src/components/AppCompNoteCredit.vue +491 -0
  83. package/src/components/AppCompPlayBarNext.vue +2288 -0
  84. package/src/components/AppCompPopUpNext.vue +504 -0
  85. package/src/components/AppCompQuizNext.vue +510 -0
  86. package/src/components/AppCompQuizRecall.vue +350 -0
  87. package/src/components/AppCompSVGNext.vue +346 -0
  88. package/src/components/AppCompSettingsMenu.vue +18 -16
  89. package/src/components/AppCompTableOfContent.vue +340 -122
  90. package/src/components/AppCompVideoPlayer.vue +377 -0
  91. package/src/components/BaseModule.vue +24 -117
  92. package/src/components/tests__/AppBaseButton.spec.js +53 -0
  93. package/src/components/tests__/useTimer.spec.js +91 -0
  94. package/src/composables/useIdleDetector.js +56 -0
  95. package/src/composables/useQuiz.js +89 -0
  96. package/src/composables/useTimer.js +172 -0
  97. package/src/directives/nvdaFix.js +53 -0
  98. package/src/externalComps/ModuleView.vue +22 -0
  99. package/src/externalComps/SummaryView.vue +91 -0
  100. package/src/main.js +400 -142
  101. package/src/module/stores/appStore.js +947 -0
  102. package/src/module/xapi/ADL.js +241 -60
  103. package/src/module/xapi/Crypto/Hasher.js +8 -8
  104. package/src/module/xapi/Crypto/WordArray.js +6 -6
  105. package/src/module/xapi/Crypto/algorithms/BufferedBlockAlgorithm.js +4 -4
  106. package/src/module/xapi/Crypto/algorithms/C_algo.js +14 -18
  107. package/src/module/xapi/Crypto/algorithms/HMAC.js +1 -1
  108. package/src/module/xapi/Crypto/algorithms/SHA1.js +1 -1
  109. package/src/module/xapi/Crypto/encoders/Base.js +7 -7
  110. package/src/module/xapi/Crypto/encoders/Base64.js +3 -3
  111. package/src/module/xapi/Crypto/encoders/Hex.js +4 -3
  112. package/src/module/xapi/Crypto/encoders/Latin1.js +3 -3
  113. package/src/module/xapi/Crypto/encoders/Utf8.js +3 -3
  114. package/src/module/xapi/Statement/index.js +3 -3
  115. package/src/module/xapi/launch.js +10 -10
  116. package/src/module/xapi/utils.js +17 -17
  117. package/src/module/xapi/wrapper.js +223 -218
  118. package/src/module/xapi/xapiStatement.js +29 -29
  119. package/src/plugins/analytics.js +34 -0
  120. package/src/plugins/bus.js +7 -2
  121. package/src/plugins/gsap.js +9 -8
  122. package/src/plugins/helper.js +141 -43
  123. package/src/plugins/i18n.js +13 -18
  124. package/src/plugins/idb.js +46 -30
  125. package/src/plugins/save.js +1 -1
  126. package/src/plugins/scorm.js +15 -15
  127. package/src/plugins/xapi.js +2 -2
  128. package/src/public/index.html +23 -11
  129. package/src/router/index.js +57 -0
  130. package/src/router/routes.js +312 -0
  131. package/src/shared/generalfuncs.js +241 -10
  132. package/src/shared/validators.js +1018 -0
  133. package/vitest.config.js +19 -0
  134. package/.eslintignore +0 -29
  135. package/.eslintrc.js +0 -86
  136. package/.prettierrc.js +0 -5
  137. package/babel.config.js +0 -3
  138. package/src/components/AppBaseDragChoice.vue +0 -91
  139. package/src/components/AppBaseDropZone.vue +0 -112
  140. package/src/components/AppCompDragAndDrop.vue +0 -339
  141. package/src/components/AppCompInputAssociation.vue +0 -332
  142. package/src/components/AppCompInputCheckBox.vue +0 -227
  143. package/src/components/AppCompInputDropdown.vue +0 -184
  144. package/src/components/AppCompInputRadio.vue +0 -169
  145. package/src/components/AppCompInputTextBox.vue +0 -91
  146. package/src/components/AppCompInputTextTable.vue +0 -155
  147. package/src/components/AppCompInputTextToFillDropdown.vue +0 -255
  148. package/src/components/AppCompInputTextToFillText.vue +0 -164
  149. package/src/components/AppCompMediaPlayer.vue +0 -365
  150. package/src/components/AppCompNavigationFull.vue +0 -1791
  151. package/src/components/AppCompPlayBar.vue +0 -1540
  152. package/src/components/AppCompPopUp.vue +0 -523
  153. package/src/components/AppCompQuiz.vue +0 -2998
  154. package/src/components/AppCompToolTip.vue +0 -94
  155. package/src/mixins/$pageMixins.js +0 -381
  156. package/src/mixins/$quizMixins.js +0 -456
  157. package/src/mixins/timerMixin.js +0 -132
  158. package/src/module/store.js +0 -874
  159. package/src/plugins/timeManager.js +0 -77
  160. package/src/routes.js +0 -734
  161. package/vue.config.js +0 -83
@@ -1,332 +0,0 @@
1
- <template>
2
- <div class="input-box">
3
- <div style="display:flex">
4
- <div
5
- v-for="singleAssociationZone in inputData.zone_depots"
6
- :key="singleAssociationZone.id"
7
- :class="
8
- `associationlist-${singleAssociationZone.id} ` +
9
- classInput(singleAssociationZone.id)
10
- "
11
- >
12
- <label
13
- :for="`${inputDataId}_${singleAssociationZone.id}`"
14
- v-html="singleAssociationZone.contenu.alt"
15
- ></label>
16
- <div
17
- :class="
18
- quizClickedZone == singleAssociationZone.id
19
- ? 'quizZoneActive'
20
- : 'quizZone'
21
- "
22
- @click="activateChoice(singleAssociationZone.id)"
23
- >
24
- <!--zone is img-->
25
- <div
26
- v-if="singleAssociationZone.contenu.type == 'img'"
27
- class="quizZoneIsImg"
28
- >
29
- <img
30
- :src="singleAssociationZone.contenu.affichage"
31
- :alt="singleAssociationZone.contenu.alt"
32
- />
33
- </div>
34
- <!--zone is text-->
35
- <div
36
- v-if="singleAssociationZone.contenu.type == 'str'"
37
- class="quizZoneIsText"
38
- >
39
- <p v-html="singleAssociationZone.contenu.affichage"></p>
40
- </div>
41
- <!--selected item-->
42
- <!---selected is img--->
43
- <div
44
- v-if="
45
- quizAssociation[singleAssociationZone.id] &&
46
- quizAssociation[singleAssociationZone.id] !== '' &&
47
- inputData.choix_deplaceable[
48
- quizAssociation[singleAssociationZone.id]
49
- ].contenu.type == 'img'
50
- "
51
- class="quizZoneWithImg"
52
- >
53
- <img
54
- :src="
55
- inputData.choix_deplaceable[
56
- quizAssociation[singleAssociationZone.id]
57
- ].contenu.affichage
58
- "
59
- :alt="
60
- inputData.choix_deplaceable[
61
- quizAssociation[singleAssociationZone.id]
62
- ].contenu.alt
63
- "
64
- />
65
- </div>
66
- <!---selected is text--->
67
- <div
68
- v-if="
69
- quizAssociation[singleAssociationZone.id] &&
70
- quizAssociation[singleAssociationZone.id] !== '' &&
71
- inputData.choix_deplaceable[
72
- quizAssociation[singleAssociationZone.id]
73
- ].contenu.type == 'str'
74
- "
75
- class="quizZoneWithText"
76
- >
77
- <p
78
- v-html="
79
- inputData.choix_deplaceable[
80
- quizAssociation[singleAssociationZone.id]
81
- ].contenu.affichage
82
- "
83
- ></p>
84
- </div>
85
- </div>
86
- </div>
87
- </div>
88
- <!--choices-->
89
- <div
90
- style="display:flex"
91
- :class="quizClickedZone ? 'parentQuizChoicesActive' : 'parentQuizChoices'"
92
- >
93
- <div
94
- v-for="singleAssociationChoice in inputData.choix_deplaceable"
95
- :key="singleAssociationChoice.id"
96
- :class="`associationlist-${singleAssociationChoice.id}`"
97
- >
98
- <label
99
- :for="`${inputDataId}_${singleAssociationChoice.id}`"
100
- v-html="singleAssociationChoice.contenu.alt"
101
- ></label>
102
- <div
103
- class="quizAssociationChoice"
104
- @click="assignValueToZone(singleAssociationChoice.id)"
105
- >
106
- <!---is img--->
107
- <div
108
- v-if="singleAssociationChoice.contenu.type == 'img'"
109
- class="quizChoiceWithImg"
110
- >
111
- <img
112
- :src="singleAssociationChoice.contenu.affichage"
113
- :alt="singleAssociationChoice.contenu.alt"
114
- />
115
- </div>
116
- <!---is text--->
117
- <div
118
- v-if="singleAssociationChoice.contenu.type == 'str'"
119
- class="quizChoiceWithText"
120
- >
121
- <p v-html="singleAssociationChoice.contenu.affichage"></p>
122
- </div>
123
- </div>
124
- </div>
125
- </div>
126
- </div>
127
- </template>
128
- <script>
129
- import $extendsQuiz from '../mixins/$quizMixins'
130
- export default {
131
- mixins: [$extendsQuiz],
132
-
133
- props: {
134
- inputType: {
135
- type: String,
136
- default: ''
137
- },
138
- inputDataId: {
139
- type: String,
140
- default: ''
141
- },
142
- inputData: {
143
- type: Object,
144
- default: () => {}
145
- },
146
- quizCompleted: {
147
- type: Boolean,
148
- default: false
149
- },
150
- solution: {
151
- type: Object,
152
- default: () => []
153
- },
154
- showSolution: {
155
- type: Boolean,
156
- default: false
157
- },
158
- shuffleAnswers: {
159
- type: Boolean,
160
- default: false
161
- },
162
- quizAssociation: {
163
- type: Object,
164
- default: () => {}
165
- }, //use to pass the value of the input
166
- quizSubmit: {
167
- type: Boolean,
168
- default: false
169
- } //use to call a submit
170
- },
171
-
172
- data() {
173
- return {
174
- quizClickedZone: '', //for the id of the last clicked zone to assign the choice
175
- quizAssociationValue: [] //not using quizAssociation because quizAssociation is a prop
176
- }
177
- },
178
-
179
- computed: {
180
- /**
181
- * @description
182
- *
183
- quizZoneContent(zoneId) {
184
- //check if zone is filled
185
- if (zoneId == false) {
186
- // check if zone has image
187
-
188
- }
189
- return zoneId
190
- }*/
191
- },
192
-
193
- watch: {
194
- /**
195
- * @description to pass value to AppCompQuiz
196
- * @fires input-change to AppCompQuiz.vue
197
- */
198
- quizAssociationValue(newValue) {
199
- this.$emit('input-change', newValue)
200
- },
201
-
202
- /**
203
- * @description to pass the value from AppCompQuiz
204
- */
205
- quizAssociation(newValue) {
206
- this.quizAssociationValue = newValue
207
- }
208
- },
209
-
210
- mounted() {
211
- let associatedChoices = []
212
- for (let i = 0; i < this.inputData.length; i++) {
213
- let singleAssociation
214
- if (this.shuffleAnswers) {
215
- singleAssociation = this.inputData[i]
216
- //@todo shuffle
217
- singleAssociation.option = this.shuffleArray(singleAssociation.option)
218
- } else {
219
- singleAssociation = this.inputData[i]
220
- }
221
- }
222
- if (this.quizAssociation.length == 0) {
223
- this.quizAssociationValue = associatedChoices
224
- } else {
225
- this.quizAssociationValue = this.quizAssociation
226
- }
227
- },
228
-
229
- methods: {
230
- /**
231
- * @description check if a values exists in a array
232
- * @param {Array} array
233
- * @param value
234
- * @returns {Boolean}
235
- */
236
- containsValue(array, value) {
237
- return array.includes(value)
238
- },
239
-
240
- /**
241
- * @description shuffles an array used to randomized the option order if shuffleAnswers is true
242
- * @param {Array} array
243
- * @returns {Array}
244
- * @todo redo shuffle
245
- */
246
- shuffleArray(array) {
247
- let newArray = []
248
- let newArray2 = []
249
-
250
- for (let i = 0; i < array.length; i++) {
251
- const element = array[i]
252
- //todo remove null values
253
- newArray.push(element)
254
- }
255
- while (newArray.length > 0) {
256
- let pos = Math.floor(newArray.length * Math.random())
257
- newArray2.push(newArray[pos])
258
- newArray.splice(pos, 1)
259
- }
260
- return newArray2
261
- },
262
-
263
- /**
264
- * @description activates choices to assign to that zone
265
- * @param {String} zoneId
266
- */
267
- activateChoice(zoneId) {
268
- if (this.quizClickedZone == zoneId) {
269
- this.quizClickedZone = ''
270
- } else {
271
- this.quizClickedZone = zoneId
272
- }
273
- },
274
-
275
- /**
276
- * @description remove current uses of value and assign value to quiz
277
- * @param {String} choiceId
278
- */
279
- assignValueToZone(choiceId) {
280
- if (this.quizClickedZone !== '' && choiceId !== '') {
281
- //remove current uses of value
282
- for (const singleKey in this.quizAssociationValue) {
283
- if (
284
- Object.hasOwnProperty.call(this.quizAssociationValue, singleKey)
285
- ) {
286
- const element = this.quizAssociationValue[singleKey]
287
- if (element == choiceId) {
288
- this.$set(this.quizAssociationValue, singleKey, '')
289
- }
290
- }
291
- }
292
- /*
293
- let listKeys = Object.keys(this.quizAssociationValue)
294
- for (let index = 0; index < listKeys.length; index++) {
295
- if (this.quizAssociationValue[listKeys[index]] == choiceId) {
296
- this.$set(this.quizAssociationValue, listKeys[index], '')
297
- }
298
- }*/
299
- //assing value
300
- this.$set(this.quizAssociationValue, this.quizClickedZone, choiceId)
301
- //deactivate choices
302
- this.quizClickedZone = ''
303
- }
304
- }
305
- }
306
- }
307
- </script>
308
- <style scoped>
309
- .quizZone,
310
- .quizZoneActive {
311
- height: 300px;
312
- width: 300px;
313
- border: solid 1px;
314
- }
315
-
316
- .quizZone {
317
- border-color: black;
318
- }
319
- .quizZoneActive {
320
- border-color: red;
321
- }
322
-
323
- .parentQuizChoicesActive {
324
- background: yellow;
325
- }
326
-
327
- .quizAssociationChoice {
328
- height: 300px;
329
- width: 300px;
330
- border: solid black 1px;
331
- }
332
- </style>
@@ -1,227 +0,0 @@
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="getQuizQuestion()"
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
- />
32
- <span class="checkbox-contenu" v-html="choixReponse.value"></span>
33
- <span
34
- :id="`${inputDataId}_${choixReponse.id}-msg-erreur`"
35
- :key="`msg_chx_${inputDataId}_${choixReponse.id}`"
36
- class="sr-only"
37
- >
38
- {{ messageAccessibility(choixReponse.id) }}
39
- </span>
40
- </label>
41
- </div>
42
- </template>
43
- </fieldset>
44
- </div>
45
- </template>
46
- <script>
47
- import $extendsQuiz from '../mixins/$quizMixins'
48
- export default {
49
- name: 'AppCompInputCheckBox',
50
- mixins: [$extendsQuiz],
51
- props: {
52
- inputType: {
53
- type: String,
54
- default: ''
55
- },
56
- inputDataId: {
57
- type: String,
58
- default: ''
59
- },
60
- inputData: {
61
- type: Array,
62
- default: () => []
63
- },
64
- quizCompleted: {
65
- type: Boolean,
66
- default: false
67
- },
68
- solution: {
69
- type: Array,
70
- default: () => []
71
- },
72
- showSolution: {
73
- type: Boolean,
74
- default: false
75
- },
76
- shuffleAnswers: {
77
- type: Boolean,
78
- default: false
79
- },
80
- quizInputMultiple: {
81
- type: Array,
82
- default: () => []
83
- }, //use to pass the value of the input
84
- quizSubmit: {
85
- type: Boolean,
86
- default: false
87
- }, //use to call a submit
88
- aBy: {
89
- type: String,
90
- default: ''
91
- } // use to pass id of the related question for the choices
92
- },
93
-
94
- data() {
95
- return {
96
- inputDataValue: [],
97
- quizInputMultipleValue: [] //not using quizInputMultiple because quizInputMultiple is a prop
98
- }
99
- },
100
-
101
- computed: {},
102
-
103
- watch: {
104
- /**
105
- * @description to pass value to AppCompQuiz
106
- * @fires input-change to AppCompQuiz.vue
107
- */
108
- quizInputMultipleValue(newValue) {
109
- this.$emit('input-change', newValue)
110
- },
111
-
112
- /**
113
- * @description to pass the value from AppCompQuiz
114
- */
115
- quizInputMultiple(newValue) {
116
- this.quizInputMultipleValue = newValue
117
- }
118
- },
119
-
120
- mounted() {
121
- if (this.solution !== null) {
122
- this.solution.sort(function(a, b) {
123
- return a - b
124
- })
125
- }
126
- this.quizInputMultipleValue = this.quizInputMultiple
127
-
128
- if (this.shuffleAnswers) {
129
- this.inputDataValue = this.shuffleArray(this.inputData)
130
- } else {
131
- this.inputDataValue = this.inputData
132
- }
133
- },
134
-
135
- methods: {
136
- /**
137
- * @description compares 2 array
138
- * @param {Array} array1
139
- * @param {Array} array2
140
- * @returns {Boolean}
141
- */
142
- isEqual(array1, array2) {
143
- // if length is not equal
144
- if (array1.length != array2.length) {
145
- return false
146
- } else {
147
- // comapring each element of array
148
- for (let i = 0; i < array1.length; i++) {
149
- if (array1[i] != array2[i]) {
150
- return false
151
- }
152
- }
153
- return true
154
- }
155
- },
156
-
157
- /**
158
- * @description check if a values exists in a array
159
- * @param {Array} array
160
- * @param value
161
- * @returns {Boolean}
162
- */
163
- containsValue(array, value) {
164
- return array.includes(value)
165
- },
166
-
167
- /**
168
- * @description shuffles an array used to randomized the option order if shuffleAnswers is true
169
- * @param {Array} array
170
- * @returns {Array}
171
- */
172
- shuffleArray(array) {
173
- let newArray = []
174
- let newArray2 = []
175
-
176
- for (let i = 0; i < array.length; i++) {
177
- const element = array[i]
178
- //todo remove null values
179
- newArray.push(element)
180
- }
181
- while (newArray.length > 0) {
182
- let pos = Math.floor(newArray.length * Math.random())
183
- newArray2.push(newArray[pos])
184
- newArray.splice(pos, 1)
185
- }
186
- return newArray2
187
- }
188
- }
189
- }
190
- </script>
191
- <style lang="scss">
192
- .custom-control-input:focus ~ .custom-control-label::before {
193
- border: inherit;
194
- }
195
-
196
- .custom-control-input:focus ~ .custom-control-label::before {
197
- box-shadow: inherit;
198
- -webkit-box-shadow: inherit;
199
- }
200
-
201
- .custom-checkbox {
202
- width: 100%;
203
- height: 100%;
204
- padding-left: 0;
205
-
206
- input {
207
- width: 100%;
208
- height: 100%;
209
- }
210
-
211
- label {
212
- width: 100%;
213
- height: 100%;
214
-
215
- &:after,
216
- &:before {
217
- border: inherit;
218
- top: 0px;
219
- left: 0px;
220
- height: 0;
221
- width: 0;
222
- background-color: inherit;
223
- border: inherit;
224
- }
225
- }
226
- }
227
- </style>