fcad-core-dragon 2.0.0-beta.1 → 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.
- package/.editorconfig +33 -33
- package/.eslintignore +29 -29
- package/{.eslintrc.js → .eslintrc.cjs} +81 -86
- package/CHANGELOG +364 -364
- package/README.md +71 -71
- package/bk.scss +117 -0
- package/package.json +61 -63
- package/src/$locales/en.json +143 -179
- package/src/$locales/fr.json +105 -181
- package/src/assets/data/onboardingMessages.json +47 -47
- package/src/components/AppBase.vue +1054 -614
- package/src/components/AppBaseButton.vue +87 -63
- package/src/components/AppBaseErrorDisplay.vue +438 -420
- package/src/components/AppBaseFlipCard.vue +84 -83
- package/src/components/AppBaseModule.vue +1673 -1842
- package/src/components/AppBasePage.vue +779 -312
- package/src/components/AppBasePopover.vue +41 -0
- package/src/components/AppCompAudio.vue +234 -0
- package/src/components/AppCompBranchButtons.vue +552 -582
- package/src/components/AppCompButtonProgress.vue +126 -147
- package/src/components/AppCompCarousel.vue +298 -192
- package/src/components/AppCompInputCheckBoxNext.vue +195 -0
- package/src/components/AppCompInputDropdownNext.vue +159 -0
- package/src/components/AppCompInputRadioNext.vue +152 -0
- package/src/components/{AppCompInputTextBox.vue → AppCompInputTextNext.vue} +106 -91
- package/src/components/AppCompInputTextTableNext.vue +141 -0
- package/src/components/AppCompInputTextToFillDropdownNext.vue +230 -0
- package/src/components/{AppCompInputTextToFillText.vue → AppCompInputTextToFillNext.vue} +171 -164
- package/src/components/AppCompJauge.vue +74 -55
- package/src/components/AppCompMenu.vue +413 -209
- package/src/components/AppCompMenuItem.vue +228 -174
- package/src/components/AppCompNavigation.vue +960 -949
- package/src/components/AppCompNoteCall.vue +133 -126
- package/src/components/AppCompNoteCredit.vue +292 -164
- package/src/components/AppCompPlayBar.vue +1218 -1319
- package/src/components/AppCompPlayBarNext.vue +2052 -0
- package/src/components/AppCompPlayBarProgress.vue +82 -0
- package/src/components/AppCompPopUpNext.vue +503 -0
- package/src/components/{AppCompQuiz.vue → AppCompQuizNext.vue} +2904 -2989
- package/src/components/AppCompQuizRecall.vue +276 -250
- package/src/components/AppCompSVGNext.vue +347 -0
- package/src/components/AppCompSettingsMenu.vue +172 -171
- package/src/components/AppCompTableOfContent.vue +387 -264
- package/src/components/AppCompTranscript.vue +24 -19
- package/src/components/AppCompVideoPlayer.vue +368 -336
- package/src/components/AppCompViewDisplay.vue +6 -6
- package/src/components/BaseModule.vue +72 -67
- package/src/composables/useQuiz.js +206 -0
- package/src/externalComps/ModuleView.vue +22 -0
- package/src/externalComps/SummaryView.vue +91 -0
- package/src/main.js +272 -227
- package/src/mixins/$mediaMixins.js +819 -0
- package/src/mixins/timerMixin.js +155 -156
- package/src/module/stores/appStore.js +893 -0
- package/src/module/xapi/ADL.js +376 -339
- package/src/module/xapi/Crypto/Hasher.js +241 -241
- package/src/module/xapi/Crypto/WordArray.js +278 -278
- package/src/module/xapi/Crypto/algorithms/BufferedBlockAlgorithm.js +103 -103
- package/src/module/xapi/Crypto/algorithms/C_algo.js +315 -319
- package/src/module/xapi/Crypto/algorithms/HMAC.js +9 -9
- package/src/module/xapi/Crypto/algorithms/SHA1.js +9 -9
- package/src/module/xapi/Crypto/encoders/Base.js +105 -105
- package/src/module/xapi/Crypto/encoders/Base64.js +99 -99
- package/src/module/xapi/Crypto/encoders/Hex.js +61 -61
- package/src/module/xapi/Crypto/encoders/Latin1.js +61 -61
- package/src/module/xapi/Crypto/encoders/Utf8.js +45 -45
- package/src/module/xapi/Crypto/index.js +53 -53
- package/src/module/xapi/Statement/activity.js +47 -47
- package/src/module/xapi/Statement/agent.js +55 -55
- package/src/module/xapi/Statement/group.js +26 -26
- package/src/module/xapi/Statement/index.js +259 -259
- package/src/module/xapi/Statement/statement.js +253 -253
- package/src/module/xapi/Statement/statementRef.js +23 -23
- package/src/module/xapi/Statement/substatement.js +22 -22
- package/src/module/xapi/Statement/verb.js +36 -36
- package/src/module/xapi/activitytypes.js +17 -17
- package/src/module/xapi/launch.js +157 -157
- package/src/module/xapi/utils.js +167 -167
- package/src/module/xapi/verbs.js +294 -294
- package/src/module/xapi/wrapper.js +1963 -1890
- package/src/module/xapi/xapiStatement.js +444 -444
- package/src/plugins/bus.js +8 -3
- package/src/plugins/gsap.js +14 -17
- package/src/plugins/helper.js +308 -295
- package/src/plugins/i18n.js +44 -31
- package/src/plugins/idb.js +219 -212
- package/src/plugins/save.js +37 -37
- package/src/plugins/scorm.js +287 -287
- package/src/plugins/xapi.js +11 -11
- package/src/public/index.html +33 -21
- package/src/router/index.js +43 -41
- package/src/router/routes.js +312 -337
- package/src/shared/generalfuncs.js +210 -188
- package/src/shared/validators.js +1069 -249
- package/vite.config.js +27 -0
- 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/AppCompInputCheckBox.vue +0 -227
- package/src/components/AppCompInputDropdown.vue +0 -184
- package/src/components/AppCompInputRadio.vue +0 -169
- package/src/components/AppCompInputTextTable.vue +0 -155
- package/src/components/AppCompInputTextToFillDropdown.vue +0 -255
- package/src/components/AppCompMediaPlayer.vue +0 -397
- package/src/components/AppCompPopUp.vue +0 -522
- package/src/components/AppCompPopover.vue +0 -27
- package/src/components/AppCompSVG.vue +0 -309
- package/src/mixins/$pageMixins.js +0 -459
- package/src/mixins/$quizMixins.js +0 -456
- package/src/module/store.js +0 -895
- 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
|
@@ -0,0 +1,195 @@
|
|
|
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>
|
|
@@ -0,0 +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,91 +1,106 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
type:
|
|
36
|
-
default:
|
|
37
|
-
},
|
|
38
|
-
|
|
39
|
-
type:
|
|
40
|
-
default:
|
|
41
|
-
},
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
}
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
}
|
|
83
|
-
},
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
1
|
+
<!-- About this Component--
|
|
2
|
+
* Renders a TEXTAREA input to collect input for the Quiz component
|
|
3
|
+
* Related Quiz to question: REPONSE_OUVERTE
|
|
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 box-reponse-ouverte">
|
|
10
|
+
<v-textarea
|
|
11
|
+
:id="`textArea_${inputDataId}`"
|
|
12
|
+
v-model="quizInputTypeValue"
|
|
13
|
+
:aria-labelledby="`textArea_${inputDataId}`"
|
|
14
|
+
:class="classInput()"
|
|
15
|
+
:placeholder="$t('text.place_holder.for_textarea')"
|
|
16
|
+
focused
|
|
17
|
+
rows="3"
|
|
18
|
+
no-resize
|
|
19
|
+
:aria-describedby="`${inputDataId}-msg-erreur`"
|
|
20
|
+
clearable
|
|
21
|
+
/>
|
|
22
|
+
|
|
23
|
+
<span :id="`${inputDataId}-msg-erreur`" class="sr-only">
|
|
24
|
+
{{ messageAccessibility() }}
|
|
25
|
+
</span>
|
|
26
|
+
</div>
|
|
27
|
+
</template>
|
|
28
|
+
<script>
|
|
29
|
+
import { useQuiz } from '../composables/useQuiz'
|
|
30
|
+
import { toRefs } from 'vue'
|
|
31
|
+
export default {
|
|
32
|
+
name: 'AppCompInputTextNext',
|
|
33
|
+
props: {
|
|
34
|
+
quizType: {
|
|
35
|
+
type: String,
|
|
36
|
+
default: ''
|
|
37
|
+
},
|
|
38
|
+
inputDataId: {
|
|
39
|
+
type: String,
|
|
40
|
+
default: ''
|
|
41
|
+
},
|
|
42
|
+
|
|
43
|
+
inputData: {
|
|
44
|
+
type: Array,
|
|
45
|
+
default: () => []
|
|
46
|
+
}, //not used just here to be the same
|
|
47
|
+
|
|
48
|
+
quizInputType: {
|
|
49
|
+
type: String,
|
|
50
|
+
default: ''
|
|
51
|
+
},
|
|
52
|
+
|
|
53
|
+
solution: {
|
|
54
|
+
type: String,
|
|
55
|
+
default: ''
|
|
56
|
+
},
|
|
57
|
+
showSolution: {
|
|
58
|
+
type: Boolean,
|
|
59
|
+
default: false
|
|
60
|
+
},
|
|
61
|
+
quizLimitActive: {
|
|
62
|
+
type: Boolean,
|
|
63
|
+
default: false
|
|
64
|
+
}, //use to set if quiz should be active or not
|
|
65
|
+
|
|
66
|
+
quizSubmit: {
|
|
67
|
+
type: Boolean,
|
|
68
|
+
default: false
|
|
69
|
+
} //use to call a submit
|
|
70
|
+
},
|
|
71
|
+
|
|
72
|
+
emits: ['input-change'],
|
|
73
|
+
|
|
74
|
+
setup(props) {
|
|
75
|
+
const { classInput, messageAccessibility } = useQuiz(toRefs(props))
|
|
76
|
+
|
|
77
|
+
return { classInput, messageAccessibility }
|
|
78
|
+
},
|
|
79
|
+
data() {
|
|
80
|
+
return {
|
|
81
|
+
quizInputTypeValue: '' //not using quizInputType because quizInputType is a prop
|
|
82
|
+
}
|
|
83
|
+
},
|
|
84
|
+
|
|
85
|
+
watch: {
|
|
86
|
+
/**
|
|
87
|
+
* @description to pass value to AppCompQuiz
|
|
88
|
+
* @fires input-change to AppCompQuiz.vue
|
|
89
|
+
*/
|
|
90
|
+
quizInputTypeValue: {
|
|
91
|
+
deep: true,
|
|
92
|
+
handler(newValue) {
|
|
93
|
+
this.$emit('input-change', newValue)
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
},
|
|
97
|
+
|
|
98
|
+
mounted() {
|
|
99
|
+
this.quizInputTypeValue = this.quizInputType
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
</script>
|
|
103
|
+
<style>
|
|
104
|
+
.box-reponse-ouverte {
|
|
105
|
+
}
|
|
106
|
+
</style>
|