fcad-core-dragon 2.0.0-beta.1 → 2.0.0-beta.2
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/{.eslintrc.js → .eslintrc.cjs} +13 -18
- package/bk.scss +117 -0
- package/package.json +23 -39
- package/src/$locales/en.json +30 -16
- package/src/$locales/fr.json +29 -16
- package/src/components/AppBase.vue +740 -305
- package/src/components/AppBaseButton.vue +33 -5
- package/src/components/AppBaseErrorDisplay.vue +43 -35
- package/src/components/AppBaseModule.vue +447 -623
- package/src/components/AppBasePage.vue +37 -25
- package/src/components/AppCompAudio.vue +266 -0
- package/src/components/AppCompBranchButtons.vue +52 -63
- package/src/components/AppCompButtonProgress.vue +1 -16
- package/src/components/AppCompCarousel.vue +43 -39
- package/src/components/AppCompInputCheckBox.vue +9 -3
- package/src/components/AppCompInputDropdown.vue +2 -4
- package/src/components/AppCompInputRadio.vue +8 -15
- package/src/components/AppCompInputTextTable.vue +15 -12
- package/src/components/AppCompInputTextToFillDropdown.vue +16 -14
- package/src/components/AppCompInputTextToFillText.vue +2 -2
- package/src/components/AppCompJauge.vue +13 -1
- package/src/components/AppCompMenu.vue +203 -10
- package/src/components/AppCompMenuItem.vue +20 -3
- package/src/components/AppCompNavigation.vue +351 -355
- package/src/components/AppCompNoteCall.vue +62 -47
- package/src/components/AppCompNoteCredit.vue +182 -79
- package/src/components/AppCompPlayBar.vue +975 -1023
- package/src/components/AppCompPlayBarProgress.vue +73 -0
- package/src/components/AppCompPopUp.vue +175 -114
- package/src/components/AppCompQuiz.vue +67 -81
- package/src/components/AppCompQuizRecall.vue +32 -5
- package/src/components/AppCompSVG.vue +66 -40
- package/src/components/AppCompSettingsMenu.vue +6 -8
- package/src/components/AppCompTableOfContent.vue +166 -45
- package/src/components/AppCompVideoPlayer.vue +154 -110
- package/src/components/BaseModule.vue +21 -17
- package/src/main.js +124 -88
- package/src/mixins/$mediaMixins.js +827 -0
- package/src/mixins/$pageMixins.js +65 -109
- package/src/mixins/$quizMixins.js +12 -26
- package/src/mixins/timerMixin.js +8 -9
- package/src/module/store.js +187 -68
- package/src/module/xapi/ADL.js +90 -53
- package/src/module/xapi/Crypto/Hasher.js +8 -8
- package/src/module/xapi/Crypto/WordArray.js +6 -6
- package/src/module/xapi/Crypto/algorithms/BufferedBlockAlgorithm.js +4 -4
- package/src/module/xapi/Crypto/algorithms/C_algo.js +14 -18
- package/src/module/xapi/Crypto/algorithms/HMAC.js +1 -1
- package/src/module/xapi/Crypto/algorithms/SHA1.js +1 -1
- package/src/module/xapi/Crypto/encoders/Base.js +7 -7
- package/src/module/xapi/Crypto/encoders/Base64.js +3 -3
- package/src/module/xapi/Crypto/encoders/Hex.js +2 -2
- package/src/module/xapi/Crypto/encoders/Latin1.js +3 -3
- package/src/module/xapi/Crypto/encoders/Utf8.js +3 -3
- package/src/module/xapi/Statement/index.js +1 -1
- package/src/module/xapi/launch.js +10 -10
- package/src/module/xapi/utils.js +17 -17
- package/src/module/xapi/wrapper.js +123 -50
- package/src/module/xapi/xapiStatement.js +29 -29
- package/src/plugins/helper.js +8 -9
- package/src/plugins/i18n.js +23 -10
- package/src/plugins/scorm.js +14 -14
- package/src/router/index.js +3 -4
- package/src/router/routes.js +10 -30
- package/src/shared/generalfuncs.js +31 -24
- package/src/shared/validators.js +730 -20
- package/.prettierrc.js +0 -5
- package/babel.config.js +0 -3
- package/src/components/AppBaseDragChoice.vue +0 -91
- package/src/components/AppBaseDropZone.vue +0 -112
- package/src/components/AppCompBif.vue +0 -120
- package/src/components/AppCompDragAndDrop.vue +0 -339
- package/src/components/AppCompInputAssociation.vue +0 -332
- package/src/components/AppCompMediaPlayer.vue +0 -397
- package/src/plugins/timeManager.js +0 -77
- package/src/routes_bckp.js +0 -313
- package/src/routes_static.js +0 -344
- 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>
|