fcad-core-dragon 2.0.1 → 2.0.2-beta.1
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/CHANGELOG +16 -1
- package/package.json +1 -1
- package/src/$locales/en.json +18 -4
- package/src/$locales/fr.json +17 -3
- package/src/components/AppBase.vue +36 -341
- package/src/components/AppBaseModule.vue +16 -21
- package/src/components/AppBasePage.vue +45 -14
- package/src/components/AppBaseSkeleton.vue +45 -0
- package/src/components/AppCompAudio.vue +12 -3
- package/src/components/AppCompButtonProgress.vue +13 -2
- package/src/components/AppCompCarousel.vue +12 -4
- package/src/components/AppCompInputCheckBoxNx.vue +324 -0
- package/src/components/AppCompInputDropdownNx.vue +295 -0
- package/src/components/AppCompInputRadioNx.vue +264 -0
- package/src/components/AppCompInputTextNx.vue +148 -0
- package/src/components/AppCompInputTextTableNx.vue +198 -0
- package/src/components/AppCompInputTextToFillDropdownNx.vue +291 -0
- package/src/components/AppCompInputTextToFillNx.vue +277 -0
- package/src/components/AppCompJauge.vue +11 -4
- package/src/components/AppCompMenu.vue +7 -14
- package/src/components/AppCompMenuItem.vue +7 -5
- package/src/components/AppCompNavigation.vue +21 -21
- package/src/components/AppCompNoteCall.vue +1 -0
- package/src/components/AppCompNoteCredit.vue +2 -1
- package/src/components/AppCompPlayBarNext.vue +94 -41
- package/src/components/AppCompPopUpNext.vue +6 -6
- package/src/components/AppCompQuizNx.vue +500 -0
- package/src/components/AppCompQuizRecall.vue +113 -66
- package/src/components/AppCompTableOfContent.vue +39 -10
- package/src/components/AppCompVideoPlayer.vue +1 -1
- package/src/composables/useQuiz.js +62 -179
- package/src/directives/nvdaFix.js +53 -0
- package/src/main.js +227 -30
- package/src/mixins/$mediaMixins.js +1 -11
- package/src/module/stores/appStore.js +29 -11
- package/src/plugins/idb.js +1 -1
- package/src/shared/generalfuncs.js +134 -0
- package/src/shared/validators.js +308 -234
- package/src/components/AppCompInputCheckBoxNext.vue +0 -205
- package/src/components/AppCompInputDropdownNext.vue +0 -201
- package/src/components/AppCompInputRadioNext.vue +0 -158
- package/src/components/AppCompInputTextNext.vue +0 -124
- package/src/components/AppCompInputTextTableNext.vue +0 -142
- package/src/components/AppCompInputTextToFillDropdownNext.vue +0 -238
- package/src/components/AppCompInputTextToFillNext.vue +0 -171
- package/src/components/AppCompQuizNext.vue +0 -2908
|
@@ -1,205 +0,0 @@
|
|
|
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
|
-
<div class="box-input">
|
|
29
|
-
<input
|
|
30
|
-
:id="`chx_${inputDataId}_${choixReponse.id}`"
|
|
31
|
-
:key="`chx_${inputDataId}_${inputDataId}-${choixReponse.id}`"
|
|
32
|
-
v-model="quizInputMultipleValue"
|
|
33
|
-
type="checkbox"
|
|
34
|
-
:value="choixReponse.id"
|
|
35
|
-
:name="`btn-checkbox-${inputDataId}`"
|
|
36
|
-
:disabled="quizLimitActive"
|
|
37
|
-
class="checkbox-input"
|
|
38
|
-
:aria-labelledby="`span_${inputDataId}_${choixReponse.id}`"
|
|
39
|
-
/>
|
|
40
|
-
</div>
|
|
41
|
-
<span
|
|
42
|
-
:id="`span_${inputDataId}_${choixReponse.id}`"
|
|
43
|
-
class="checkbox-contenu"
|
|
44
|
-
aria-hidden="true"
|
|
45
|
-
v-html="choixReponse.value"
|
|
46
|
-
></span>
|
|
47
|
-
<span
|
|
48
|
-
:id="`${inputDataId}_${choixReponse.id}-msg-erreur`"
|
|
49
|
-
:key="`msg_chx_${inputDataId}_${choixReponse.id}`"
|
|
50
|
-
class="sr-only"
|
|
51
|
-
>
|
|
52
|
-
{{ messageAccessibility(choixReponse.id) }}
|
|
53
|
-
</span>
|
|
54
|
-
</label>
|
|
55
|
-
</div>
|
|
56
|
-
</template>
|
|
57
|
-
</fieldset>
|
|
58
|
-
</div>
|
|
59
|
-
</template>
|
|
60
|
-
<script>
|
|
61
|
-
import { useQuiz } from '../composables/useQuiz'
|
|
62
|
-
import { toRefs } from 'vue'
|
|
63
|
-
export default {
|
|
64
|
-
name: 'AppCompInputCheckBoxNext',
|
|
65
|
-
|
|
66
|
-
props: {
|
|
67
|
-
quizType: {
|
|
68
|
-
type: String,
|
|
69
|
-
default: ''
|
|
70
|
-
},
|
|
71
|
-
|
|
72
|
-
inputDataId: {
|
|
73
|
-
type: String,
|
|
74
|
-
default: ''
|
|
75
|
-
},
|
|
76
|
-
inputData: {
|
|
77
|
-
type: Array,
|
|
78
|
-
default: () => []
|
|
79
|
-
},
|
|
80
|
-
quizInputType: {
|
|
81
|
-
type: Array,
|
|
82
|
-
default: () => []
|
|
83
|
-
},
|
|
84
|
-
solution: {
|
|
85
|
-
type: Array,
|
|
86
|
-
default: () => []
|
|
87
|
-
},
|
|
88
|
-
showSolution: {
|
|
89
|
-
type: Boolean,
|
|
90
|
-
default: false
|
|
91
|
-
},
|
|
92
|
-
shuffleAnswers: {
|
|
93
|
-
type: Boolean,
|
|
94
|
-
default: false
|
|
95
|
-
},
|
|
96
|
-
quizLimitActive: {
|
|
97
|
-
type: Boolean,
|
|
98
|
-
default: false
|
|
99
|
-
}, //use to set if quiz should be active or not
|
|
100
|
-
|
|
101
|
-
quizSubmit: {
|
|
102
|
-
type: Boolean,
|
|
103
|
-
default: false
|
|
104
|
-
} //use to call a submit
|
|
105
|
-
},
|
|
106
|
-
emits: ['input-change'],
|
|
107
|
-
setup(props) {
|
|
108
|
-
const { containsValue, shuffleArray, classInput, messageAccessibility } =
|
|
109
|
-
useQuiz(toRefs(props))
|
|
110
|
-
|
|
111
|
-
return { containsValue, shuffleArray, classInput, messageAccessibility }
|
|
112
|
-
},
|
|
113
|
-
|
|
114
|
-
data() {
|
|
115
|
-
return {
|
|
116
|
-
inputDataValue: [],
|
|
117
|
-
quizInputMultipleValue: [], //not using quizInputMultiple because quizInputMultiple is a prop
|
|
118
|
-
quizSolution: null
|
|
119
|
-
}
|
|
120
|
-
},
|
|
121
|
-
|
|
122
|
-
watch: {
|
|
123
|
-
/**
|
|
124
|
-
* @description to pass value to AppCompQuiz
|
|
125
|
-
* @fires input-change to AppCompQuiz.vue
|
|
126
|
-
*/
|
|
127
|
-
quizInputMultipleValue: {
|
|
128
|
-
deep: true,
|
|
129
|
-
handler(newValue) {
|
|
130
|
-
this.$emit('input-change', newValue)
|
|
131
|
-
}
|
|
132
|
-
}
|
|
133
|
-
},
|
|
134
|
-
|
|
135
|
-
mounted() {
|
|
136
|
-
this.initQuiz()
|
|
137
|
-
},
|
|
138
|
-
|
|
139
|
-
methods: {
|
|
140
|
-
initQuiz() {
|
|
141
|
-
this.quizSolution = this.solution
|
|
142
|
-
if (this.quizSolution !== null) {
|
|
143
|
-
this.quizSolution.sort(function (a, b) {
|
|
144
|
-
return a - b
|
|
145
|
-
})
|
|
146
|
-
}
|
|
147
|
-
this.quizInputMultipleValue = this.quizInputType
|
|
148
|
-
|
|
149
|
-
if (this.shuffleAnswers)
|
|
150
|
-
return (this.inputDataValue = this.shuffleArray(this.inputData))
|
|
151
|
-
|
|
152
|
-
this.inputDataValue = this.inputData
|
|
153
|
-
}
|
|
154
|
-
}
|
|
155
|
-
}
|
|
156
|
-
</script>
|
|
157
|
-
<style lang="scss">
|
|
158
|
-
.box-input {
|
|
159
|
-
position: relative;
|
|
160
|
-
}
|
|
161
|
-
|
|
162
|
-
fieldset {
|
|
163
|
-
border: inherit;
|
|
164
|
-
}
|
|
165
|
-
|
|
166
|
-
.custom-control-input:focus ~ .custom-control-label::before {
|
|
167
|
-
border: inherit;
|
|
168
|
-
}
|
|
169
|
-
|
|
170
|
-
.custom-control-input:focus ~ .custom-control-label::before {
|
|
171
|
-
box-shadow: inherit;
|
|
172
|
-
-webkit-box-shadow: inherit;
|
|
173
|
-
}
|
|
174
|
-
|
|
175
|
-
fieldset {
|
|
176
|
-
border: inherit;
|
|
177
|
-
}
|
|
178
|
-
|
|
179
|
-
.custom-checkbox {
|
|
180
|
-
width: 100%;
|
|
181
|
-
height: 100%;
|
|
182
|
-
padding-left: 0;
|
|
183
|
-
|
|
184
|
-
input {
|
|
185
|
-
width: 100%;
|
|
186
|
-
height: 100%;
|
|
187
|
-
}
|
|
188
|
-
|
|
189
|
-
label {
|
|
190
|
-
width: 100%;
|
|
191
|
-
height: 100%;
|
|
192
|
-
|
|
193
|
-
&:after,
|
|
194
|
-
&:before {
|
|
195
|
-
border: inherit;
|
|
196
|
-
top: 0px;
|
|
197
|
-
left: 0px;
|
|
198
|
-
height: 0;
|
|
199
|
-
width: 0;
|
|
200
|
-
background-color: inherit;
|
|
201
|
-
border: inherit;
|
|
202
|
-
}
|
|
203
|
-
}
|
|
204
|
-
}
|
|
205
|
-
</style>
|
|
@@ -1,201 +0,0 @@
|
|
|
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
|
-
:item-props="true"
|
|
26
|
-
:items="singleDropdown.option"
|
|
27
|
-
:disabled="quizLimitActive"
|
|
28
|
-
:open-text="$t('message.dropdown_list') + ' ' + singleDropdown.ennonce"
|
|
29
|
-
close-text=""
|
|
30
|
-
></v-select>
|
|
31
|
-
</div>
|
|
32
|
-
</div>
|
|
33
|
-
</template>
|
|
34
|
-
<script>
|
|
35
|
-
import { useQuiz } from '../composables/useQuiz'
|
|
36
|
-
import { toRefs } from 'vue'
|
|
37
|
-
export default {
|
|
38
|
-
name: 'AppCompInputDropdown',
|
|
39
|
-
|
|
40
|
-
props: {
|
|
41
|
-
quizType: {
|
|
42
|
-
type: String,
|
|
43
|
-
default: ''
|
|
44
|
-
},
|
|
45
|
-
inputDataId: {
|
|
46
|
-
type: String,
|
|
47
|
-
default: ''
|
|
48
|
-
},
|
|
49
|
-
inputData: {
|
|
50
|
-
type: Array,
|
|
51
|
-
default: () => []
|
|
52
|
-
},
|
|
53
|
-
quizInputType: {
|
|
54
|
-
type: Array,
|
|
55
|
-
default: () => []
|
|
56
|
-
},
|
|
57
|
-
solution: {
|
|
58
|
-
type: Array,
|
|
59
|
-
default: () => []
|
|
60
|
-
},
|
|
61
|
-
showSolution: {
|
|
62
|
-
type: Boolean,
|
|
63
|
-
default: false
|
|
64
|
-
},
|
|
65
|
-
quizLimitActive: {
|
|
66
|
-
type: Boolean,
|
|
67
|
-
default: false
|
|
68
|
-
},
|
|
69
|
-
shuffleAnswers: {
|
|
70
|
-
type: Boolean,
|
|
71
|
-
default: false
|
|
72
|
-
},
|
|
73
|
-
|
|
74
|
-
quizSubmit: {
|
|
75
|
-
type: Boolean,
|
|
76
|
-
default: false
|
|
77
|
-
} //use to call a submit
|
|
78
|
-
},
|
|
79
|
-
emits: ['input-change'],
|
|
80
|
-
setup(props) {
|
|
81
|
-
const { containsValue, shuffleArray, classInput, messageAccessibility } =
|
|
82
|
-
useQuiz(toRefs(props))
|
|
83
|
-
|
|
84
|
-
return {
|
|
85
|
-
containsValue,
|
|
86
|
-
shuffleArray,
|
|
87
|
-
classInput,
|
|
88
|
-
messageAccessibility
|
|
89
|
-
}
|
|
90
|
-
},
|
|
91
|
-
|
|
92
|
-
data() {
|
|
93
|
-
return {
|
|
94
|
-
quizInputTypeValue: [], //not using quizInputType because quizInputType is a prop
|
|
95
|
-
quizSolution: null
|
|
96
|
-
}
|
|
97
|
-
},
|
|
98
|
-
|
|
99
|
-
computed: {},
|
|
100
|
-
|
|
101
|
-
watch: {
|
|
102
|
-
/**
|
|
103
|
-
* @description to pass value to AppCompQuiz
|
|
104
|
-
* @emits input-change
|
|
105
|
-
*/
|
|
106
|
-
quizInputTypeValue: {
|
|
107
|
-
deep: true,
|
|
108
|
-
handler(newValue) {
|
|
109
|
-
this.$emit('input-change', newValue)
|
|
110
|
-
}
|
|
111
|
-
}
|
|
112
|
-
},
|
|
113
|
-
|
|
114
|
-
mounted() {
|
|
115
|
-
this.initQuiz()
|
|
116
|
-
},
|
|
117
|
-
|
|
118
|
-
methods: {
|
|
119
|
-
initQuiz() {
|
|
120
|
-
this.quizSolution = this.solution
|
|
121
|
-
if (this.quizSolution !== null) {
|
|
122
|
-
this.quizSolution.sort(function (a, b) {
|
|
123
|
-
return a - b
|
|
124
|
-
})
|
|
125
|
-
}
|
|
126
|
-
//to show the defaultAnswer
|
|
127
|
-
const defaultAnswer = {
|
|
128
|
-
value: null,
|
|
129
|
-
disabled: true,
|
|
130
|
-
text: this.$t('message.first_option_dropdown'),
|
|
131
|
-
selected: true
|
|
132
|
-
}
|
|
133
|
-
let selectedChoices = []
|
|
134
|
-
for (let i = 0; i < this.inputData.length; i++) {
|
|
135
|
-
let singleDropdown = this.inputData[i]
|
|
136
|
-
if (this.shuffleAnswers)
|
|
137
|
-
singleDropdown.option = this.shuffleArray(singleDropdown.option)
|
|
138
|
-
|
|
139
|
-
if (
|
|
140
|
-
this.inputData[i].option[0].text !==
|
|
141
|
-
this.$t('message.first_option_dropdown')
|
|
142
|
-
) {
|
|
143
|
-
singleDropdown.option.unshift(defaultAnswer)
|
|
144
|
-
}
|
|
145
|
-
selectedChoices.push(null)
|
|
146
|
-
}
|
|
147
|
-
if (this.quizInputType.length == 0) {
|
|
148
|
-
this.quizInputTypeValue = selectedChoices
|
|
149
|
-
} else {
|
|
150
|
-
this.quizInputTypeValue = this.quizInputType
|
|
151
|
-
}
|
|
152
|
-
}
|
|
153
|
-
}
|
|
154
|
-
}
|
|
155
|
-
</script>
|
|
156
|
-
<style lang="scss">
|
|
157
|
-
.dropdown-container {
|
|
158
|
-
position: relative;
|
|
159
|
-
}
|
|
160
|
-
|
|
161
|
-
div.texteatrou {
|
|
162
|
-
display: inline !important;
|
|
163
|
-
.cnt-input {
|
|
164
|
-
display: inline;
|
|
165
|
-
|
|
166
|
-
.v-input {
|
|
167
|
-
display: inline-block !important;
|
|
168
|
-
|
|
169
|
-
.v-input__control,
|
|
170
|
-
.v-field {
|
|
171
|
-
width: 240px !important;
|
|
172
|
-
grid-area: inherit !important;
|
|
173
|
-
|
|
174
|
-
.v-field__field {
|
|
175
|
-
height: 25px !important;
|
|
176
|
-
padding: 0 !important;
|
|
177
|
-
min-height: inherit !important;
|
|
178
|
-
|
|
179
|
-
.v-field__input {
|
|
180
|
-
padding-top: 0 !important;
|
|
181
|
-
padding-bottom: 0 !important;
|
|
182
|
-
min-height: inherit !important;
|
|
183
|
-
|
|
184
|
-
.v-select__selection {
|
|
185
|
-
min-height: inherit !important;
|
|
186
|
-
}
|
|
187
|
-
}
|
|
188
|
-
}
|
|
189
|
-
|
|
190
|
-
.v-field__append-inner {
|
|
191
|
-
margin-right: 6px;
|
|
192
|
-
}
|
|
193
|
-
}
|
|
194
|
-
|
|
195
|
-
.v-input__details {
|
|
196
|
-
display: none;
|
|
197
|
-
}
|
|
198
|
-
}
|
|
199
|
-
}
|
|
200
|
-
}
|
|
201
|
-
</style>
|
|
@@ -1,158 +0,0 @@
|
|
|
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
|
-
<div class="box-input">
|
|
31
|
-
<input
|
|
32
|
-
:id="`chx_${inputDataId}_${choixReponse.id}`"
|
|
33
|
-
:key="`chx_${inputDataId}_${choixReponse.id}`"
|
|
34
|
-
v-model="inputUniqueValue"
|
|
35
|
-
:disabled="quizLimitActive"
|
|
36
|
-
type="radio"
|
|
37
|
-
:value="choixReponse.id"
|
|
38
|
-
:name="`btn-radios-${inputDataId}`"
|
|
39
|
-
class="radio-input"
|
|
40
|
-
:aria-labelledby="`span_${inputDataId}_${choixReponse.id}`"
|
|
41
|
-
/>
|
|
42
|
-
</div>
|
|
43
|
-
<span
|
|
44
|
-
:id="`span_${inputDataId}_${choixReponse.id}`"
|
|
45
|
-
aria-hidden="true"
|
|
46
|
-
class="radio-contenu"
|
|
47
|
-
v-html="choixReponse.value"
|
|
48
|
-
/>
|
|
49
|
-
<span
|
|
50
|
-
:id="`${inputDataId}_${choixReponse.id}-msg-erreur`"
|
|
51
|
-
:key="`msg_chx_${inputDataId}_${choixReponse.id}`"
|
|
52
|
-
class="sr-only"
|
|
53
|
-
>
|
|
54
|
-
{{ messageAccessibility(choixReponse.id) }}
|
|
55
|
-
</span>
|
|
56
|
-
</label>
|
|
57
|
-
</div>
|
|
58
|
-
</template>
|
|
59
|
-
</fieldset>
|
|
60
|
-
</div>
|
|
61
|
-
</template>
|
|
62
|
-
<script>
|
|
63
|
-
import { useQuiz } from '../composables/useQuiz'
|
|
64
|
-
import { toRefs } from 'vue'
|
|
65
|
-
export default {
|
|
66
|
-
name: 'AppCompInputRadioNext',
|
|
67
|
-
|
|
68
|
-
props: {
|
|
69
|
-
quizType: {
|
|
70
|
-
type: String,
|
|
71
|
-
default: ''
|
|
72
|
-
},
|
|
73
|
-
inputDataId: {
|
|
74
|
-
type: String,
|
|
75
|
-
default: ''
|
|
76
|
-
},
|
|
77
|
-
|
|
78
|
-
inputData: {
|
|
79
|
-
type: Array,
|
|
80
|
-
default: () => []
|
|
81
|
-
},
|
|
82
|
-
quizInputType: {
|
|
83
|
-
type: String,
|
|
84
|
-
default: ''
|
|
85
|
-
},
|
|
86
|
-
solution: {
|
|
87
|
-
type: String,
|
|
88
|
-
default: ''
|
|
89
|
-
}, //may be null
|
|
90
|
-
showSolution: {
|
|
91
|
-
type: Boolean,
|
|
92
|
-
default: false
|
|
93
|
-
},
|
|
94
|
-
shuffleAnswers: {
|
|
95
|
-
type: Boolean,
|
|
96
|
-
default: false
|
|
97
|
-
},
|
|
98
|
-
quizLimitActive: {
|
|
99
|
-
type: Boolean,
|
|
100
|
-
default: false
|
|
101
|
-
}, //use to set if quiz should be active or not
|
|
102
|
-
|
|
103
|
-
quizSubmit: {
|
|
104
|
-
type: Boolean,
|
|
105
|
-
default: false
|
|
106
|
-
} //use to call a submit
|
|
107
|
-
},
|
|
108
|
-
emits: ['input-change'],
|
|
109
|
-
setup(props) {
|
|
110
|
-
const { shuffleArray, classInput, messageAccessibility } = useQuiz(
|
|
111
|
-
toRefs(props)
|
|
112
|
-
)
|
|
113
|
-
|
|
114
|
-
return { shuffleArray, classInput, messageAccessibility }
|
|
115
|
-
},
|
|
116
|
-
data() {
|
|
117
|
-
return {
|
|
118
|
-
quizInputDataValue: [],
|
|
119
|
-
inputUniqueValue: null //not using quizInputUnique because quizInputUnique is a prop
|
|
120
|
-
}
|
|
121
|
-
},
|
|
122
|
-
|
|
123
|
-
computed: {},
|
|
124
|
-
|
|
125
|
-
watch: {
|
|
126
|
-
// /**
|
|
127
|
-
// * @description to pass value to AppCompQuiz
|
|
128
|
-
// * @fires input-change to AppCompQuiz.vue
|
|
129
|
-
// */
|
|
130
|
-
inputUniqueValue: {
|
|
131
|
-
deep: true,
|
|
132
|
-
handler(newValue) {
|
|
133
|
-
this.$emit('input-change', newValue)
|
|
134
|
-
}
|
|
135
|
-
}
|
|
136
|
-
},
|
|
137
|
-
|
|
138
|
-
mounted() {
|
|
139
|
-
this.initQuiz()
|
|
140
|
-
},
|
|
141
|
-
|
|
142
|
-
methods: {
|
|
143
|
-
initQuiz() {
|
|
144
|
-
this.inputUniqueValue = this.quizInputType
|
|
145
|
-
if (this.shuffleAnswers) {
|
|
146
|
-
this.quizInputDataValue = this.shuffleArray(this.inputData)
|
|
147
|
-
} else {
|
|
148
|
-
this.quizInputDataValue = this.inputData
|
|
149
|
-
}
|
|
150
|
-
}
|
|
151
|
-
}
|
|
152
|
-
}
|
|
153
|
-
</script>
|
|
154
|
-
<style lang="scss">
|
|
155
|
-
.box-input {
|
|
156
|
-
position: relative;
|
|
157
|
-
}
|
|
158
|
-
</style>
|
|
@@ -1,124 +0,0 @@
|
|
|
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
|
-
rows="3"
|
|
17
|
-
no-resize
|
|
18
|
-
:aria-describedby="`${inputDataId}-msg-erreur`"
|
|
19
|
-
clearable
|
|
20
|
-
/>
|
|
21
|
-
|
|
22
|
-
<span :id="`${inputDataId}-msg-erreur`" class="sr-only">
|
|
23
|
-
{{ messageAccessibility() }}
|
|
24
|
-
</span>
|
|
25
|
-
</div>
|
|
26
|
-
</template>
|
|
27
|
-
<script>
|
|
28
|
-
import { useQuiz } from '../composables/useQuiz'
|
|
29
|
-
import { toRefs } from 'vue'
|
|
30
|
-
export default {
|
|
31
|
-
name: 'AppCompInputTextNext',
|
|
32
|
-
props: {
|
|
33
|
-
quizType: {
|
|
34
|
-
type: String,
|
|
35
|
-
default: ''
|
|
36
|
-
},
|
|
37
|
-
inputDataId: {
|
|
38
|
-
type: String,
|
|
39
|
-
default: ''
|
|
40
|
-
},
|
|
41
|
-
|
|
42
|
-
inputData: {
|
|
43
|
-
type: Array,
|
|
44
|
-
default: () => []
|
|
45
|
-
}, //not used just here to be the same
|
|
46
|
-
|
|
47
|
-
quizInputType: {
|
|
48
|
-
type: String,
|
|
49
|
-
default: ''
|
|
50
|
-
},
|
|
51
|
-
|
|
52
|
-
solution: {
|
|
53
|
-
type: String,
|
|
54
|
-
default: ''
|
|
55
|
-
},
|
|
56
|
-
showSolution: {
|
|
57
|
-
type: Boolean,
|
|
58
|
-
default: false
|
|
59
|
-
},
|
|
60
|
-
quizLimitActive: {
|
|
61
|
-
type: Boolean,
|
|
62
|
-
default: false
|
|
63
|
-
}, //use to set if quiz should be active or not
|
|
64
|
-
|
|
65
|
-
quizSubmit: {
|
|
66
|
-
type: Boolean,
|
|
67
|
-
default: false
|
|
68
|
-
} //use to call a submit
|
|
69
|
-
},
|
|
70
|
-
|
|
71
|
-
emits: ['input-change'],
|
|
72
|
-
|
|
73
|
-
setup(props) {
|
|
74
|
-
const { classInput, messageAccessibility } = useQuiz(toRefs(props))
|
|
75
|
-
|
|
76
|
-
return { classInput, messageAccessibility }
|
|
77
|
-
},
|
|
78
|
-
data() {
|
|
79
|
-
return {
|
|
80
|
-
quizInputTypeValue: '' //not using quizInputType because quizInputType is a prop
|
|
81
|
-
}
|
|
82
|
-
},
|
|
83
|
-
|
|
84
|
-
watch: {
|
|
85
|
-
/**
|
|
86
|
-
* @description to pass value to AppCompQuiz
|
|
87
|
-
* @fires input-change to AppCompQuiz.vue
|
|
88
|
-
*/
|
|
89
|
-
quizInputTypeValue: {
|
|
90
|
-
deep: true,
|
|
91
|
-
handler(newValue) {
|
|
92
|
-
this.$emit('input-change', newValue)
|
|
93
|
-
}
|
|
94
|
-
}
|
|
95
|
-
},
|
|
96
|
-
|
|
97
|
-
mounted() {
|
|
98
|
-
this.quizInputTypeValue = this.quizInputType
|
|
99
|
-
}
|
|
100
|
-
}
|
|
101
|
-
</script>
|
|
102
|
-
<style lang="scss">
|
|
103
|
-
.quiz-texte-troue {
|
|
104
|
-
.texteatrou {
|
|
105
|
-
.v-input {
|
|
106
|
-
display: inline-block !important;
|
|
107
|
-
width: 150px;
|
|
108
|
-
|
|
109
|
-
.v-field {
|
|
110
|
-
height: 25px;
|
|
111
|
-
|
|
112
|
-
input {
|
|
113
|
-
padding: 0 24px;
|
|
114
|
-
min-height: 25px !important;
|
|
115
|
-
}
|
|
116
|
-
}
|
|
117
|
-
|
|
118
|
-
.v-input__details {
|
|
119
|
-
display: none;
|
|
120
|
-
}
|
|
121
|
-
}
|
|
122
|
-
}
|
|
123
|
-
}
|
|
124
|
-
</style>
|