fcad-core-dragon 2.0.0-beta.9 → 2.0.1-beta.0

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 (64) hide show
  1. package/.editorconfig +33 -33
  2. package/.eslintignore +29 -29
  3. package/.eslintrc.cjs +81 -81
  4. package/CHANGELOG +11 -0
  5. package/README.md +57 -72
  6. package/bk.scss +117 -117
  7. package/package.json +1 -1
  8. package/src/assets/data/onboardingMessages.json +47 -47
  9. package/src/components/AppBase.vue +130 -3
  10. package/src/components/AppBaseErrorDisplay.vue +438 -438
  11. package/src/components/AppBaseFlipCard.vue +84 -84
  12. package/src/components/AppBaseModule.vue +15 -18
  13. package/src/components/AppBasePopover.vue +41 -41
  14. package/src/components/AppCompBranchButtons.vue +5 -5
  15. package/src/components/AppCompInputDropdownNext.vue +1 -1
  16. package/src/components/AppCompInputRadioNext.vue +152 -152
  17. package/src/components/AppCompInputTextToFillNext.vue +171 -171
  18. package/src/components/AppCompJauge.vue +74 -74
  19. package/src/components/AppCompMenuItem.vue +238 -228
  20. package/src/components/AppCompPlayBarProgress.vue +82 -82
  21. package/src/components/AppCompSettingsMenu.vue +172 -172
  22. package/src/components/AppCompTableOfContent.vue +2 -0
  23. package/src/components/AppCompViewDisplay.vue +6 -6
  24. package/src/composables/useQuiz.js +206 -206
  25. package/src/externalComps/ModuleView.vue +22 -22
  26. package/src/externalComps/SummaryView.vue +91 -91
  27. package/src/mixins/$mediaMixins.js +819 -819
  28. package/src/mixins/timerMixin.js +195 -155
  29. package/src/module/stores/appStore.js +3 -3
  30. package/src/module/xapi/ADL.js +0 -1
  31. package/src/module/xapi/Crypto/Hasher.js +241 -241
  32. package/src/module/xapi/Crypto/WordArray.js +278 -278
  33. package/src/module/xapi/Crypto/algorithms/BufferedBlockAlgorithm.js +103 -103
  34. package/src/module/xapi/Crypto/algorithms/C_algo.js +315 -315
  35. package/src/module/xapi/Crypto/algorithms/HMAC.js +9 -9
  36. package/src/module/xapi/Crypto/algorithms/SHA1.js +9 -9
  37. package/src/module/xapi/Crypto/encoders/Base.js +105 -105
  38. package/src/module/xapi/Crypto/encoders/Base64.js +99 -99
  39. package/src/module/xapi/Crypto/encoders/Hex.js +61 -61
  40. package/src/module/xapi/Crypto/encoders/Latin1.js +61 -61
  41. package/src/module/xapi/Crypto/encoders/Utf8.js +45 -45
  42. package/src/module/xapi/Crypto/index.js +53 -53
  43. package/src/module/xapi/Statement/activity.js +47 -47
  44. package/src/module/xapi/Statement/agent.js +55 -55
  45. package/src/module/xapi/Statement/group.js +26 -26
  46. package/src/module/xapi/Statement/index.js +259 -259
  47. package/src/module/xapi/Statement/statement.js +253 -253
  48. package/src/module/xapi/Statement/statementRef.js +23 -23
  49. package/src/module/xapi/Statement/substatement.js +22 -22
  50. package/src/module/xapi/Statement/verb.js +36 -36
  51. package/src/module/xapi/activitytypes.js +17 -17
  52. package/src/module/xapi/utils.js +167 -167
  53. package/src/module/xapi/verbs.js +294 -294
  54. package/src/module/xapi/wrapper.js +0 -1
  55. package/src/module/xapi/xapiStatement.js +444 -444
  56. package/src/plugins/bus.js +8 -8
  57. package/src/plugins/gsap.js +14 -14
  58. package/src/plugins/i18n.js +44 -44
  59. package/src/plugins/save.js +37 -37
  60. package/src/plugins/scorm.js +287 -287
  61. package/src/plugins/xapi.js +11 -11
  62. package/src/public/index.html +33 -33
  63. package/src/router/index.js +5 -0
  64. package/src/shared/generalfuncs.js +210 -210
@@ -1,152 +1,152 @@
1
- <!-- About this Component--
2
- * Renders a RADIO BUTTON input to display choices of response for the Quiz component
3
- * Related Quiz to question: REPONSE_UNIQUE
4
- * Receives the a data object defined by user
5
- * Used by AppCompQuizNext
6
- * Uses useQuiz composable
7
- -->
8
-
9
- <template>
10
- <div class="input-box">
11
- <fieldset>
12
- <legend
13
- :id="`lgd_${inputDataId}`"
14
- class="sr-only"
15
- tabindex="-1"
16
- v-html="$t('quizState.answers')"
17
- />
18
-
19
- <template
20
- v-for="choixReponse in quizInputDataValue"
21
- :Key="`div_chx_${inputDataId}-${choixReponse.id}`"
22
- >
23
- <div class="box-radio" role="group">
24
- <label
25
- :key="`lbl_chx_${inputDataId}_${choixReponse.id}`"
26
- :for="`chx_${inputDataId}_${choixReponse.id}`"
27
- :class="classInput(choixReponse.id)"
28
- class="radio-label"
29
- >
30
- <input
31
- :id="`chx_${inputDataId}_${choixReponse.id}`"
32
- :key="`chx_${inputDataId}_${choixReponse.id}`"
33
- v-model="inputUniqueValue"
34
- :disabled="quizLimitActive"
35
- type="radio"
36
- :value="choixReponse.id"
37
- :name="`btn-radios-${inputDataId}`"
38
- class="radio-input"
39
- :aria-labelledby="`span_${inputDataId}_${choixReponse.id}`"
40
- />
41
-
42
- <span
43
- :id="`span_${inputDataId}_${choixReponse.id}`"
44
- aria-hidden="true"
45
- class="radio-contenu"
46
- v-html="choixReponse.value"
47
- />
48
- <span
49
- :id="`${inputDataId}_${choixReponse.id}-msg-erreur`"
50
- :key="`msg_chx_${inputDataId}_${choixReponse.id}`"
51
- class="sr-only"
52
- >
53
- {{ messageAccessibility(choixReponse.id) }}
54
- </span>
55
- </label>
56
- </div>
57
- </template>
58
- </fieldset>
59
- </div>
60
- </template>
61
- <script>
62
- import { useQuiz } from '../composables/useQuiz'
63
- import { toRefs } from 'vue'
64
- export default {
65
- name: 'AppCompInputRadioNext',
66
-
67
- props: {
68
- quizType: {
69
- type: String,
70
- default: ''
71
- },
72
- inputDataId: {
73
- type: String,
74
- default: ''
75
- },
76
-
77
- inputData: {
78
- type: Array,
79
- default: () => []
80
- },
81
- quizInputType: {
82
- type: String,
83
- default: ''
84
- },
85
- solution: {
86
- type: String,
87
- default: ''
88
- }, //may be null
89
- showSolution: {
90
- type: Boolean,
91
- default: false
92
- },
93
- shuffleAnswers: {
94
- type: Boolean,
95
- default: false
96
- },
97
- quizLimitActive: {
98
- type: Boolean,
99
- default: false
100
- }, //use to set if quiz should be active or not
101
-
102
- quizSubmit: {
103
- type: Boolean,
104
- default: false
105
- } //use to call a submit
106
- },
107
- emits: ['input-change'],
108
- setup(props) {
109
- const { shuffleArray, classInput, messageAccessibility } = useQuiz(
110
- toRefs(props)
111
- )
112
-
113
- return { shuffleArray, classInput, messageAccessibility }
114
- },
115
- data() {
116
- return {
117
- quizInputDataValue: [],
118
- inputUniqueValue: null //not using quizInputUnique because quizInputUnique is a prop
119
- }
120
- },
121
-
122
- computed: {},
123
-
124
- watch: {
125
- // /**
126
- // * @description to pass value to AppCompQuiz
127
- // * @fires input-change to AppCompQuiz.vue
128
- // */
129
- inputUniqueValue: {
130
- deep: true,
131
- handler(newValue) {
132
- this.$emit('input-change', newValue)
133
- }
134
- }
135
- },
136
-
137
- mounted() {
138
- this.initQuiz()
139
- },
140
-
141
- methods: {
142
- initQuiz() {
143
- this.inputUniqueValue = this.quizInputType
144
- if (this.shuffleAnswers) {
145
- this.quizInputDataValue = this.shuffleArray(this.inputData)
146
- } else {
147
- this.quizInputDataValue = this.inputData
148
- }
149
- }
150
- }
151
- }
152
- </script>
1
+ <!-- About this Component--
2
+ * Renders a RADIO BUTTON input to display choices of response for the Quiz component
3
+ * Related Quiz to question: REPONSE_UNIQUE
4
+ * Receives the a data object defined by user
5
+ * Used by AppCompQuizNext
6
+ * Uses useQuiz composable
7
+ -->
8
+
9
+ <template>
10
+ <div class="input-box">
11
+ <fieldset>
12
+ <legend
13
+ :id="`lgd_${inputDataId}`"
14
+ class="sr-only"
15
+ tabindex="-1"
16
+ v-html="$t('quizState.answers')"
17
+ />
18
+
19
+ <template
20
+ v-for="choixReponse in quizInputDataValue"
21
+ :Key="`div_chx_${inputDataId}-${choixReponse.id}`"
22
+ >
23
+ <div class="box-radio" role="group">
24
+ <label
25
+ :key="`lbl_chx_${inputDataId}_${choixReponse.id}`"
26
+ :for="`chx_${inputDataId}_${choixReponse.id}`"
27
+ :class="classInput(choixReponse.id)"
28
+ class="radio-label"
29
+ >
30
+ <input
31
+ :id="`chx_${inputDataId}_${choixReponse.id}`"
32
+ :key="`chx_${inputDataId}_${choixReponse.id}`"
33
+ v-model="inputUniqueValue"
34
+ :disabled="quizLimitActive"
35
+ type="radio"
36
+ :value="choixReponse.id"
37
+ :name="`btn-radios-${inputDataId}`"
38
+ class="radio-input"
39
+ :aria-labelledby="`span_${inputDataId}_${choixReponse.id}`"
40
+ />
41
+
42
+ <span
43
+ :id="`span_${inputDataId}_${choixReponse.id}`"
44
+ aria-hidden="true"
45
+ class="radio-contenu"
46
+ v-html="choixReponse.value"
47
+ />
48
+ <span
49
+ :id="`${inputDataId}_${choixReponse.id}-msg-erreur`"
50
+ :key="`msg_chx_${inputDataId}_${choixReponse.id}`"
51
+ class="sr-only"
52
+ >
53
+ {{ messageAccessibility(choixReponse.id) }}
54
+ </span>
55
+ </label>
56
+ </div>
57
+ </template>
58
+ </fieldset>
59
+ </div>
60
+ </template>
61
+ <script>
62
+ import { useQuiz } from '../composables/useQuiz'
63
+ import { toRefs } from 'vue'
64
+ export default {
65
+ name: 'AppCompInputRadioNext',
66
+
67
+ props: {
68
+ quizType: {
69
+ type: String,
70
+ default: ''
71
+ },
72
+ inputDataId: {
73
+ type: String,
74
+ default: ''
75
+ },
76
+
77
+ inputData: {
78
+ type: Array,
79
+ default: () => []
80
+ },
81
+ quizInputType: {
82
+ type: String,
83
+ default: ''
84
+ },
85
+ solution: {
86
+ type: String,
87
+ default: ''
88
+ }, //may be null
89
+ showSolution: {
90
+ type: Boolean,
91
+ default: false
92
+ },
93
+ shuffleAnswers: {
94
+ type: Boolean,
95
+ default: false
96
+ },
97
+ quizLimitActive: {
98
+ type: Boolean,
99
+ default: false
100
+ }, //use to set if quiz should be active or not
101
+
102
+ quizSubmit: {
103
+ type: Boolean,
104
+ default: false
105
+ } //use to call a submit
106
+ },
107
+ emits: ['input-change'],
108
+ setup(props) {
109
+ const { shuffleArray, classInput, messageAccessibility } = useQuiz(
110
+ toRefs(props)
111
+ )
112
+
113
+ return { shuffleArray, classInput, messageAccessibility }
114
+ },
115
+ data() {
116
+ return {
117
+ quizInputDataValue: [],
118
+ inputUniqueValue: null //not using quizInputUnique because quizInputUnique is a prop
119
+ }
120
+ },
121
+
122
+ computed: {},
123
+
124
+ watch: {
125
+ // /**
126
+ // * @description to pass value to AppCompQuiz
127
+ // * @fires input-change to AppCompQuiz.vue
128
+ // */
129
+ inputUniqueValue: {
130
+ deep: true,
131
+ handler(newValue) {
132
+ this.$emit('input-change', newValue)
133
+ }
134
+ }
135
+ },
136
+
137
+ mounted() {
138
+ this.initQuiz()
139
+ },
140
+
141
+ methods: {
142
+ initQuiz() {
143
+ this.inputUniqueValue = this.quizInputType
144
+ if (this.shuffleAnswers) {
145
+ this.quizInputDataValue = this.shuffleArray(this.inputData)
146
+ } else {
147
+ this.quizInputDataValue = this.inputData
148
+ }
149
+ }
150
+ }
151
+ }
152
+ </script>
@@ -1,171 +1,171 @@
1
- <!-- About this Component--
2
- * Renders a Series of inputs to collect input for the Quiz component.
3
- * Related Quiz to question: TEXTE_TROUE
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="textInput in theInputData"
12
- :key="textInput.id"
13
- class="texteatrou"
14
- >
15
- <span v-if="!textInput.type" v-html="textInput.content"></span>
16
- <label
17
- :for="`${inputDataId}_${textInput.id}-champ`"
18
- style="display: none"
19
- >
20
- {{ $t('text.quiz') }}
21
- </label>
22
- <v-text-field
23
- v-if="textInput.type == 'inputText'"
24
- :id="`${inputDataId}_${textInput.id}-champ`"
25
- v-model="quizInputTypeValue[textInput.id]"
26
- :placeholder="$t('text.place_holder.for_textarea')"
27
- :disabled="quizLimitActive"
28
- no-resize
29
- :class="classInput(textInput.id, quizInputTypeValue)"
30
- class="input-textatrou"
31
- :aria-describedby="`${inputDataId}_${textInput.id}-msg-erreur`"
32
- :aria-labelledby="`${inputDataId}_${textInput.id}-label`"
33
- />
34
- <span :id="`${inputDataId}_${textInput.id}-msg-erreur`" class="sr-only">
35
- {{ messageAccessibility(textInput.id, quizInputTypeValue) }}
36
- </span>
37
- </div>
38
- </div>
39
- </template>
40
- <script>
41
- import { useQuiz } from '../composables/useQuiz'
42
- import { toRefs } from 'vue'
43
- export default {
44
- name: 'AppCompInputTextToFillNext',
45
- props: {
46
- quizType: {
47
- type: String,
48
- default: ''
49
- },
50
- inputDataId: {
51
- type: String,
52
- default: ''
53
- },
54
- inputData: {
55
- type: Array,
56
- default: () => []
57
- },
58
- inputType: {
59
- type: String,
60
- default: ''
61
- },
62
- textBase: {
63
- type: String,
64
- default: ''
65
- },
66
- quizInputType: {
67
- type: Array,
68
- default: () => []
69
- },
70
- solution: {
71
- type: Array,
72
- default: () => []
73
- },
74
- showSolution: {
75
- type: Boolean,
76
- default: false
77
- },
78
- quizLimitActive: {
79
- type: Boolean,
80
- default: false
81
- }, //use to set if quiz should be active or not
82
- quizSubmit: {
83
- type: Boolean,
84
- default: false
85
- } //use to call a submit
86
- },
87
- emits: ['input-change'],
88
- setup(props) {
89
- const { shuffleArray, classInput, messageAccessibility } = useQuiz(
90
- toRefs(props)
91
- )
92
- return { shuffleArray, classInput, messageAccessibility }
93
- },
94
- data() {
95
- return {
96
- quizInputTypeValue: [], //not using quizInputType because quizInputType is a prop
97
- theInputData: [], //to create the list of drop down and text mixed togeter
98
- quizSolution: null
99
- }
100
- },
101
-
102
- watch: {
103
- /**
104
- * @description to pass value to AppCompQuiz
105
- * @fires input-change to AppCompQuiz.vue
106
- */
107
- quizInputTypeValue: {
108
- deep: true,
109
- handler(newValue) {
110
- this.$emit('input-change', newValue)
111
- }
112
- }
113
- },
114
-
115
- mounted() {
116
- this.initQuiz()
117
- },
118
-
119
- methods: {
120
- initQuiz() {
121
- this.quizSolution = this.solution
122
- if (this.quizSolution !== null) {
123
- this.quizSolution.sort(function (a, b) {
124
- return a - b
125
- })
126
- }
127
- let textChoices = []
128
-
129
- const regex = /\$%\S*%\$/g // regex pattern to match exp: $%number%$
130
- let matchAll = this.textBase.split(regex)
131
-
132
- for (let i = 0; i < matchAll.length - 1; i++) {
133
- textChoices.push('')
134
- }
135
- //apply previous answers
136
- if (this.quizInputType && this.quizInputType.length == 0) {
137
- this.quizInputTypeValue = textChoices
138
- } else {
139
- this.quizInputTypeValue = this.quizInputType
140
- }
141
- this.createTextWithInput(this.textBase)
142
- },
143
- /**
144
- * @description create the object to genate the text and inputs
145
- * @param {String} str the text with holes to fill
146
- */
147
- createTextWithInput(str) {
148
- const regex = /\$%\S*%\$/g // regex pattern to match exp: $%number%$
149
- let matchAll = str.split(regex)
150
- let listInput = []
151
- for (let i = 0; i < matchAll.length - 1; i++) {
152
- listInput.push({ id: 't' + i, content: matchAll[i] })
153
- listInput.push({ id: i, type: 'inputText' })
154
- }
155
- let lastItem = matchAll.length - 1
156
- listInput.push({ id: 't' + lastItem, content: matchAll[lastItem] })
157
- this.theInputData = listInput
158
- }
159
- }
160
- }
161
- </script>
162
- <style lang="scss" scoped>
163
- .texteatrou {
164
- display: inline;
165
- position: relative;
166
- }
167
- .texteatrou > input {
168
- display: inline;
169
- width: auto;
170
- }
171
- </style>
1
+ <!-- About this Component--
2
+ * Renders a Series of inputs to collect input for the Quiz component.
3
+ * Related Quiz to question: TEXTE_TROUE
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="textInput in theInputData"
12
+ :key="textInput.id"
13
+ class="texteatrou"
14
+ >
15
+ <span v-if="!textInput.type" v-html="textInput.content"></span>
16
+ <label
17
+ :for="`${inputDataId}_${textInput.id}-champ`"
18
+ style="display: none"
19
+ >
20
+ {{ $t('text.quiz') }}
21
+ </label>
22
+ <v-text-field
23
+ v-if="textInput.type == 'inputText'"
24
+ :id="`${inputDataId}_${textInput.id}-champ`"
25
+ v-model="quizInputTypeValue[textInput.id]"
26
+ :placeholder="$t('text.place_holder.for_textarea')"
27
+ :disabled="quizLimitActive"
28
+ no-resize
29
+ :class="classInput(textInput.id, quizInputTypeValue)"
30
+ class="input-textatrou"
31
+ :aria-describedby="`${inputDataId}_${textInput.id}-msg-erreur`"
32
+ :aria-labelledby="`${inputDataId}_${textInput.id}-label`"
33
+ />
34
+ <span :id="`${inputDataId}_${textInput.id}-msg-erreur`" class="sr-only">
35
+ {{ messageAccessibility(textInput.id, quizInputTypeValue) }}
36
+ </span>
37
+ </div>
38
+ </div>
39
+ </template>
40
+ <script>
41
+ import { useQuiz } from '../composables/useQuiz'
42
+ import { toRefs } from 'vue'
43
+ export default {
44
+ name: 'AppCompInputTextToFillNext',
45
+ props: {
46
+ quizType: {
47
+ type: String,
48
+ default: ''
49
+ },
50
+ inputDataId: {
51
+ type: String,
52
+ default: ''
53
+ },
54
+ inputData: {
55
+ type: Array,
56
+ default: () => []
57
+ },
58
+ inputType: {
59
+ type: String,
60
+ default: ''
61
+ },
62
+ textBase: {
63
+ type: String,
64
+ default: ''
65
+ },
66
+ quizInputType: {
67
+ type: Array,
68
+ default: () => []
69
+ },
70
+ solution: {
71
+ type: Array,
72
+ default: () => []
73
+ },
74
+ showSolution: {
75
+ type: Boolean,
76
+ default: false
77
+ },
78
+ quizLimitActive: {
79
+ type: Boolean,
80
+ default: false
81
+ }, //use to set if quiz should be active or not
82
+ quizSubmit: {
83
+ type: Boolean,
84
+ default: false
85
+ } //use to call a submit
86
+ },
87
+ emits: ['input-change'],
88
+ setup(props) {
89
+ const { shuffleArray, classInput, messageAccessibility } = useQuiz(
90
+ toRefs(props)
91
+ )
92
+ return { shuffleArray, classInput, messageAccessibility }
93
+ },
94
+ data() {
95
+ return {
96
+ quizInputTypeValue: [], //not using quizInputType because quizInputType is a prop
97
+ theInputData: [], //to create the list of drop down and text mixed togeter
98
+ quizSolution: null
99
+ }
100
+ },
101
+
102
+ watch: {
103
+ /**
104
+ * @description to pass value to AppCompQuiz
105
+ * @fires input-change to AppCompQuiz.vue
106
+ */
107
+ quizInputTypeValue: {
108
+ deep: true,
109
+ handler(newValue) {
110
+ this.$emit('input-change', newValue)
111
+ }
112
+ }
113
+ },
114
+
115
+ mounted() {
116
+ this.initQuiz()
117
+ },
118
+
119
+ methods: {
120
+ initQuiz() {
121
+ this.quizSolution = this.solution
122
+ if (this.quizSolution !== null) {
123
+ this.quizSolution.sort(function (a, b) {
124
+ return a - b
125
+ })
126
+ }
127
+ let textChoices = []
128
+
129
+ const regex = /\$%\S*%\$/g // regex pattern to match exp: $%number%$
130
+ let matchAll = this.textBase.split(regex)
131
+
132
+ for (let i = 0; i < matchAll.length - 1; i++) {
133
+ textChoices.push('')
134
+ }
135
+ //apply previous answers
136
+ if (this.quizInputType && this.quizInputType.length == 0) {
137
+ this.quizInputTypeValue = textChoices
138
+ } else {
139
+ this.quizInputTypeValue = this.quizInputType
140
+ }
141
+ this.createTextWithInput(this.textBase)
142
+ },
143
+ /**
144
+ * @description create the object to genate the text and inputs
145
+ * @param {String} str the text with holes to fill
146
+ */
147
+ createTextWithInput(str) {
148
+ const regex = /\$%\S*%\$/g // regex pattern to match exp: $%number%$
149
+ let matchAll = str.split(regex)
150
+ let listInput = []
151
+ for (let i = 0; i < matchAll.length - 1; i++) {
152
+ listInput.push({ id: 't' + i, content: matchAll[i] })
153
+ listInput.push({ id: i, type: 'inputText' })
154
+ }
155
+ let lastItem = matchAll.length - 1
156
+ listInput.push({ id: 't' + lastItem, content: matchAll[lastItem] })
157
+ this.theInputData = listInput
158
+ }
159
+ }
160
+ }
161
+ </script>
162
+ <style lang="scss" scoped>
163
+ .texteatrou {
164
+ display: inline;
165
+ position: relative;
166
+ }
167
+ .texteatrou > input {
168
+ display: inline;
169
+ width: auto;
170
+ }
171
+ </style>