@windward/games 0.3.0 → 0.5.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.
- package/components/content/CrudTable.vue +8 -4
- package/components/content/DatableEditor.vue +1 -0
- package/components/content/blocks/crosswordPuzzle/CrosswordPuzzle.vue +3 -2
- package/components/content/blocks/dragDrop/BucketGame.vue +9 -4
- package/components/content/blocks/dragDrop/SortingGame.vue +2 -1
- package/components/content/blocks/flashcards/CardFace.vue +48 -9
- package/components/content/blocks/flashcards/Flashcard.vue +26 -17
- package/components/content/blocks/flashcards/FlashcardSlides.vue +10 -5
- package/components/content/blocks/matchingGame/MatchingGame.vue +327 -304
- package/components/content/blocks/multipleChoice/MultipleChoice.vue +6 -2
- package/components/content/blocks/multipleChoice/QuestionDialog.vue +2 -0
- package/components/content/blocks/quizshowGame/AnswerPanel.vue +3 -1
- package/components/content/blocks/quizshowGame/Gridview.vue +1 -0
- package/components/content/blocks/quizshowGame/QuizShow.vue +6 -3
- package/components/content/blocks/sevenStrikes/SevenStikes.vue +8 -2
- package/components/content/blocks/slideshow/SlideShow.vue +31 -22
- package/components/content/blocks/wordJumble/WordJumble.vue +8 -3
- package/components/settings/BucketGameSettingsManager.vue +5 -1
- package/components/settings/CrosswordPuzzleSettingsManager.vue +1 -0
- package/components/settings/FlashCardSlidesManager.vue +165 -107
- package/components/settings/MatchingGameManager.vue +57 -27
- package/components/settings/MultipleChoiceSettingsManager.vue +1 -0
- package/components/settings/QuizShowSettingsManager.vue +3 -0
- package/components/settings/SevenStrikesSettingsManager.vue +1 -0
- package/components/settings/SlideShowManager.vue +32 -12
- package/components/settings/SortingGameSettingsManager.vue +1 -0
- package/components/settings/WordJumbleSettingsManager.vue +1 -0
- package/i18n/en-US/components/content/blocks/slideshow.ts +1 -3
- package/i18n/en-US/components/settings/matching_game.ts +4 -0
- package/i18n/en-US/components/settings/seven_strikes.ts +1 -1
- package/i18n/es-ES/components/content/blocks/slideshow.ts +0 -2
- package/i18n/es-ES/components/settings/matching_game.ts +4 -0
- package/i18n/es-ES/components/settings/seven_strikes.ts +1 -1
- package/i18n/sv-SE/components/content/blocks/slideshow.ts +0 -2
- package/i18n/sv-SE/components/settings/matching_game.ts +4 -0
- package/i18n/sv-SE/components/settings/seven_strikes.ts +1 -1
- package/package.json +1 -1
- package/test/blocks/flashcards/CardFace.spec.js +2 -0
- package/test/blocks/flashcards/Flashcard.spec.js +1 -0
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<div>
|
|
3
3
|
<div>
|
|
4
|
-
<
|
|
4
|
+
<h2
|
|
5
5
|
:aria-label="
|
|
6
6
|
$t(
|
|
7
7
|
'windward.games.components.content.blocks.matching_game.match_game_title'
|
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
tabindex="0"
|
|
11
11
|
>
|
|
12
12
|
{{ block.metadata.config.title }}
|
|
13
|
-
</
|
|
13
|
+
</h2>
|
|
14
14
|
|
|
15
15
|
<p tabindex="0">
|
|
16
16
|
{{ block.metadata.config.instructions }}
|
|
@@ -23,309 +23,304 @@
|
|
|
23
23
|
}}
|
|
24
24
|
</p>
|
|
25
25
|
|
|
26
|
-
<v-container fluid :class="status"
|
|
27
|
-
<
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
><v-icon class="icon--error"
|
|
49
|
-
>mdi-close-circle</v-icon
|
|
50
|
-
>
|
|
51
|
-
</v-container>
|
|
52
|
-
</v-col>
|
|
26
|
+
<v-container fluid :class="status">
|
|
27
|
+
<v-row class="d-flex justify-center pa-2">{{
|
|
28
|
+
feedback
|
|
29
|
+
? feedback
|
|
30
|
+
: $t(
|
|
31
|
+
'windward.games.components.content.blocks.bucket_game.form.feedback.feedback_here'
|
|
32
|
+
)
|
|
33
|
+
}}</v-row>
|
|
34
|
+
<v-row class="d-flex justify-center pa-2">
|
|
35
|
+
<v-btn
|
|
36
|
+
v-if="status === 'successOutline'"
|
|
37
|
+
class="success mr-5"
|
|
38
|
+
elevation="0"
|
|
39
|
+
@click="onContinueGame"
|
|
40
|
+
>{{ $t('shared.forms.continue') }}
|
|
41
|
+
</v-btn>
|
|
42
|
+
<v-container
|
|
43
|
+
v-if="status === 'errorOutline'"
|
|
44
|
+
class="d-flex justify-center align-center"
|
|
45
|
+
@click="onExitFeedback"
|
|
46
|
+
><v-icon class="icon--error">mdi-close-circle</v-icon>
|
|
47
|
+
</v-container>
|
|
53
48
|
</v-row>
|
|
54
|
-
<br />
|
|
55
49
|
</v-container>
|
|
56
|
-
<
|
|
57
|
-
<v-
|
|
58
|
-
<
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
:
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
@end="onEnd"
|
|
70
|
-
>
|
|
71
|
-
<v-card
|
|
72
|
-
v-for="(answer, aindex) in block.metadata.config
|
|
73
|
-
.answerObjects"
|
|
74
|
-
:key="aindex"
|
|
75
|
-
class="pa-2 ma-2 answerCard container-outline"
|
|
76
|
-
outlined
|
|
77
|
-
>
|
|
78
|
-
<v-icon>mdi-drag-vertical</v-icon>
|
|
79
|
-
<span>
|
|
80
|
-
{{ answer.display }}
|
|
81
|
-
</span>
|
|
82
|
-
</v-card>
|
|
83
|
-
</draggable>
|
|
84
|
-
</v-row>
|
|
85
|
-
<v-row
|
|
86
|
-
v-if="render"
|
|
87
|
-
class="d-flex flex-wrap flex-row justify-center flex-fill"
|
|
50
|
+
<v-container class="pa-0">
|
|
51
|
+
<v-row>
|
|
52
|
+
<draggable
|
|
53
|
+
v-bind="dragOptions"
|
|
54
|
+
class="d-flex justify-space-between flex-wrap col-md-12"
|
|
55
|
+
:list="block.metadata.config.answerObjects"
|
|
56
|
+
:disabled="!allowDrag"
|
|
57
|
+
:group="{
|
|
58
|
+
name: 'people',
|
|
59
|
+
pull: 'clone',
|
|
60
|
+
put: false,
|
|
61
|
+
}"
|
|
62
|
+
@end="onEnd"
|
|
88
63
|
>
|
|
89
|
-
<v-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
>
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
class="dragArea list-group"
|
|
129
|
-
:key="mainPrompt['prompt']"
|
|
130
|
-
v-bind="dragOptions"
|
|
131
|
-
disabled
|
|
132
|
-
group="people"
|
|
133
|
-
tabindex="0"
|
|
64
|
+
<v-card
|
|
65
|
+
v-for="(answer, aindex) in block.metadata.config
|
|
66
|
+
.answerObjects"
|
|
67
|
+
:key="aindex"
|
|
68
|
+
class="pa-2 ma-2 answerCard container-outline"
|
|
69
|
+
outlined
|
|
70
|
+
>
|
|
71
|
+
<v-icon>mdi-drag-vertical</v-icon>
|
|
72
|
+
<span>
|
|
73
|
+
{{ answer.display }}
|
|
74
|
+
</span>
|
|
75
|
+
</v-card>
|
|
76
|
+
</draggable>
|
|
77
|
+
</v-row>
|
|
78
|
+
<v-row
|
|
79
|
+
v-if="render"
|
|
80
|
+
class="d-flex flex-wrap flex-row justify-center flex-fill"
|
|
81
|
+
>
|
|
82
|
+
<v-row align="center" class="col-md-12">
|
|
83
|
+
<v-card
|
|
84
|
+
v-if="mainPrompt['textOrImage'] === 'text'"
|
|
85
|
+
class="flex-fill bucket"
|
|
86
|
+
min-height="5em"
|
|
87
|
+
outlined
|
|
88
|
+
tile
|
|
89
|
+
color="secondary"
|
|
90
|
+
>
|
|
91
|
+
<v-card-text class="text-center">
|
|
92
|
+
<draggable
|
|
93
|
+
class="dragArea list-group"
|
|
94
|
+
:key="mainPrompt['prompt']"
|
|
95
|
+
v-bind="dragOptions"
|
|
96
|
+
disabled
|
|
97
|
+
group="people"
|
|
98
|
+
tabindex="0"
|
|
99
|
+
>
|
|
100
|
+
<div
|
|
101
|
+
class="card_text secondary"
|
|
102
|
+
color="secondary"
|
|
134
103
|
>
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
104
|
+
{{ mainPrompt['prompt'] }}
|
|
105
|
+
</div>
|
|
106
|
+
</draggable>
|
|
107
|
+
</v-card-text>
|
|
108
|
+
</v-card>
|
|
109
|
+
</v-row>
|
|
110
|
+
<v-row align="center" class="col-md-10">
|
|
111
|
+
<v-card
|
|
112
|
+
v-if="mainPrompt['textOrImage'] === 'image'"
|
|
113
|
+
class="pa-2 flex-fill bucket"
|
|
114
|
+
min-height="5em"
|
|
115
|
+
outlined
|
|
116
|
+
tile
|
|
117
|
+
>
|
|
118
|
+
<v-card-text>
|
|
119
|
+
<draggable
|
|
120
|
+
v-if="mainPrompt.file"
|
|
121
|
+
class="dragArea list-group"
|
|
122
|
+
:key="mainPrompt['prompt']"
|
|
123
|
+
v-bind="dragOptions"
|
|
124
|
+
disabled
|
|
125
|
+
group="people"
|
|
126
|
+
tabindex="0"
|
|
127
|
+
>
|
|
128
|
+
<div :id="mainPrompt.file.id">
|
|
129
|
+
<v-img
|
|
130
|
+
:aria-describedby="
|
|
131
|
+
getFileAriaDescribedBy(
|
|
132
|
+
mainPrompt.file,
|
|
145
133
|
mainPrompt[
|
|
146
134
|
'ariaDescribedBy'
|
|
147
135
|
]
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
]
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
136
|
+
)
|
|
137
|
+
"
|
|
138
|
+
:alt="
|
|
139
|
+
getFileAlt(
|
|
140
|
+
mainPrompt.file,
|
|
141
|
+
mainPrompt['altText']
|
|
142
|
+
)
|
|
143
|
+
"
|
|
144
|
+
:src="
|
|
145
|
+
getFilePublicUrl(
|
|
146
|
+
mainPrompt.file
|
|
147
|
+
)
|
|
148
|
+
"
|
|
149
|
+
></v-img>
|
|
150
|
+
</div>
|
|
151
|
+
</draggable>
|
|
152
|
+
</v-card-text>
|
|
153
|
+
</v-card>
|
|
161
154
|
</v-row>
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
>
|
|
168
|
-
<v-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
>
|
|
181
|
-
<
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
155
|
+
</v-row>
|
|
156
|
+
<v-row
|
|
157
|
+
v-if="!render && block.metadata.config.prompts.length > 0"
|
|
158
|
+
class="d-flex flex-wrap flex-row justify-center flex-fill"
|
|
159
|
+
>
|
|
160
|
+
<v-row align="center" class="col-md-12">
|
|
161
|
+
<v-card
|
|
162
|
+
v-if="
|
|
163
|
+
block.metadata.config.prompts[startingIndex][
|
|
164
|
+
startingIndex
|
|
165
|
+
].textOrImage === 'text'
|
|
166
|
+
"
|
|
167
|
+
class="pa-2 flex-fill bucket"
|
|
168
|
+
min-height="5em"
|
|
169
|
+
outlined
|
|
170
|
+
tile
|
|
171
|
+
color="secondary"
|
|
172
|
+
>
|
|
173
|
+
<v-card-text class="text-center">
|
|
174
|
+
<draggable
|
|
175
|
+
v-bind="dragOptions"
|
|
176
|
+
class="dragArea list-group"
|
|
177
|
+
disabled
|
|
178
|
+
group="people"
|
|
179
|
+
tabindex="0"
|
|
180
|
+
>
|
|
181
|
+
<div
|
|
182
|
+
class="card_text secondary"
|
|
183
|
+
color="secondary"
|
|
188
184
|
>
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
185
|
+
{{
|
|
186
|
+
block.metadata.config.prompts[
|
|
187
|
+
startingIndex
|
|
188
|
+
][startingIndex].prompt
|
|
189
|
+
}}
|
|
190
|
+
</div>
|
|
191
|
+
</draggable>
|
|
192
|
+
</v-card-text>
|
|
193
|
+
</v-card>
|
|
194
|
+
</v-row>
|
|
195
|
+
<v-row align="center" class="col-md-10">
|
|
196
|
+
<v-card
|
|
197
|
+
v-if="
|
|
198
|
+
block.metadata.config.prompts[startingIndex][
|
|
199
|
+
startingIndex
|
|
200
|
+
].textOrImage === 'image' &&
|
|
201
|
+
block.metadata.config.prompts[startingIndex][
|
|
202
|
+
startingIndex
|
|
203
|
+
].file
|
|
204
|
+
"
|
|
205
|
+
class="pa-2 flex-fill bucket"
|
|
206
|
+
min-height="5em"
|
|
207
|
+
outlined
|
|
208
|
+
tile
|
|
209
|
+
>
|
|
210
|
+
<v-card-text>
|
|
211
|
+
<draggable
|
|
212
|
+
v-bind="dragOptions"
|
|
213
|
+
class="dragArea list-group"
|
|
214
|
+
:key="
|
|
215
|
+
block.metadata.config.prompts[
|
|
216
|
+
startingIndex
|
|
217
|
+
]['prompt']
|
|
218
|
+
"
|
|
219
|
+
disabled
|
|
220
|
+
group="people"
|
|
221
|
+
tabindex="0"
|
|
222
|
+
>
|
|
223
|
+
<div
|
|
224
|
+
:id="
|
|
223
225
|
block.metadata.config.prompts[
|
|
224
226
|
startingIndex
|
|
225
|
-
][
|
|
227
|
+
][startingIndex].file.id
|
|
226
228
|
"
|
|
227
|
-
disabled
|
|
228
|
-
group="people"
|
|
229
|
-
tabindex="0"
|
|
230
229
|
>
|
|
231
|
-
<
|
|
232
|
-
:
|
|
233
|
-
|
|
234
|
-
startingIndex
|
|
235
|
-
][startingIndex].file.asset
|
|
236
|
-
.public_url
|
|
237
|
-
"
|
|
238
|
-
>
|
|
239
|
-
<v-img
|
|
240
|
-
v-if="
|
|
230
|
+
<v-img
|
|
231
|
+
:aria-describedby="
|
|
232
|
+
getFileAriaDescribedBy(
|
|
241
233
|
block.metadata.config
|
|
242
234
|
.prompts[startingIndex][
|
|
243
235
|
startingIndex
|
|
244
|
-
]
|
|
245
|
-
"
|
|
246
|
-
:aria-describedby="
|
|
236
|
+
].file,
|
|
247
237
|
block.metadata.config
|
|
248
238
|
.prompts[startingIndex][
|
|
249
239
|
startingIndex
|
|
250
240
|
]['ariaDescribedBy']
|
|
251
|
-
|
|
252
|
-
|
|
241
|
+
)
|
|
242
|
+
"
|
|
243
|
+
:alt="
|
|
244
|
+
getFileAlt(
|
|
245
|
+
block.metadata.config
|
|
246
|
+
.prompts[startingIndex][
|
|
247
|
+
startingIndex
|
|
248
|
+
].file,
|
|
253
249
|
block.metadata.config
|
|
254
250
|
.prompts[startingIndex][
|
|
255
251
|
startingIndex
|
|
256
252
|
]['altText']
|
|
257
|
-
|
|
258
|
-
|
|
253
|
+
)
|
|
254
|
+
"
|
|
255
|
+
:src="
|
|
256
|
+
getFilePublicUrl(
|
|
259
257
|
block.metadata.config
|
|
260
258
|
.prompts[startingIndex][
|
|
261
259
|
startingIndex
|
|
262
|
-
]
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
</v-card>
|
|
271
|
-
</v-row>
|
|
260
|
+
].file
|
|
261
|
+
)
|
|
262
|
+
"
|
|
263
|
+
></v-img>
|
|
264
|
+
</div>
|
|
265
|
+
</draggable>
|
|
266
|
+
</v-card-text>
|
|
267
|
+
</v-card>
|
|
272
268
|
</v-row>
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
269
|
+
</v-row>
|
|
270
|
+
<v-container
|
|
271
|
+
class="d-flex flex-wrap flex-row justify-center flex-fill"
|
|
272
|
+
align="end"
|
|
273
|
+
>
|
|
274
|
+
<v-row>
|
|
275
|
+
<!-- <v-flex xs8></v-flex> -->
|
|
276
|
+
<v-col cols="12" lg="6" md="7" sm="6"></v-col>
|
|
277
|
+
<v-col cols="12" lg="6" md="5" sm="6">
|
|
278
|
+
<v-row
|
|
279
|
+
align="end"
|
|
280
|
+
tabindex="0"
|
|
281
|
+
:aria-label="
|
|
282
|
+
$t(
|
|
283
|
+
'windward.games.components.content.blocks.matching_game.of_complete',
|
|
284
|
+
[completedAmount, totalAmountQuestions]
|
|
285
|
+
)
|
|
286
|
+
"
|
|
287
|
+
>
|
|
288
|
+
<v-col align="end" tabindex="0" class="pa-0">
|
|
289
|
+
{{
|
|
284
290
|
$t(
|
|
285
|
-
'windward.games.components.content.blocks.matching_game.
|
|
291
|
+
'windward.games.components.content.blocks.matching_game.of_complete_text_area',
|
|
286
292
|
[
|
|
287
293
|
completedAmount,
|
|
288
294
|
totalAmountQuestions,
|
|
289
295
|
]
|
|
290
296
|
)
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
297
|
+
}}
|
|
298
|
+
<v-progress-linear
|
|
299
|
+
v-model="completedPercent"
|
|
300
|
+
color="primary"
|
|
301
|
+
outlined
|
|
302
|
+
rounded
|
|
303
|
+
height="15"
|
|
304
|
+
style="pointer-events: none"
|
|
305
|
+
></v-progress-linear>
|
|
306
|
+
<br />
|
|
307
|
+
<v-btn
|
|
308
|
+
color="primary"
|
|
309
|
+
outlined
|
|
310
|
+
elevation="0"
|
|
311
|
+
@click="onReset"
|
|
312
|
+
>{{
|
|
295
313
|
$t(
|
|
296
|
-
'windward.games.components.content.blocks.matching_game.
|
|
297
|
-
[
|
|
298
|
-
completedAmount,
|
|
299
|
-
totalAmountQuestions,
|
|
300
|
-
]
|
|
314
|
+
'windward.games.components.content.blocks.matching_game.reset'
|
|
301
315
|
)
|
|
302
316
|
}}
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
height="15"
|
|
309
|
-
style="pointer-events: none"
|
|
310
|
-
></v-progress-linear>
|
|
311
|
-
<br />
|
|
312
|
-
<v-btn
|
|
313
|
-
color="primary"
|
|
314
|
-
outlined
|
|
315
|
-
@click="onReset"
|
|
316
|
-
>{{
|
|
317
|
-
$t(
|
|
318
|
-
'windward.games.components.content.blocks.matching_game.reset'
|
|
319
|
-
)
|
|
320
|
-
}}
|
|
321
|
-
</v-btn>
|
|
322
|
-
</v-col>
|
|
323
|
-
</v-row>
|
|
324
|
-
</v-flex>
|
|
325
|
-
</v-layout>
|
|
326
|
-
</v-container>
|
|
317
|
+
</v-btn>
|
|
318
|
+
</v-col>
|
|
319
|
+
</v-row>
|
|
320
|
+
</v-col>
|
|
321
|
+
</v-row>
|
|
327
322
|
</v-container>
|
|
328
|
-
</
|
|
323
|
+
</v-container>
|
|
329
324
|
</div>
|
|
330
325
|
<br />
|
|
331
326
|
</div>
|
|
@@ -359,12 +354,12 @@ export default {
|
|
|
359
354
|
}
|
|
360
355
|
if (_.isEmpty(this.block.metadata.config.feedback_correct)) {
|
|
361
356
|
this.block.metadata.config.feedback_correct = this.$t(
|
|
362
|
-
'windward.games.components.settings.
|
|
357
|
+
'windward.games.components.settings.matching_game.form.correct_match'
|
|
363
358
|
)
|
|
364
359
|
}
|
|
365
360
|
if (_.isEmpty(this.block.metadata.config.feedback_incorrect)) {
|
|
366
361
|
this.block.metadata.config.feedback_incorrect = this.$t(
|
|
367
|
-
'windward.games.components.settings.
|
|
362
|
+
'windward.games.components.settings.matching_game.form.incorrect_match'
|
|
368
363
|
)
|
|
369
364
|
}
|
|
370
365
|
if (_.isEmpty(this.block.metadata.config.prompts)) {
|
|
@@ -410,12 +405,7 @@ export default {
|
|
|
410
405
|
mainPrompt: {
|
|
411
406
|
altText: '',
|
|
412
407
|
answer: {},
|
|
413
|
-
file:
|
|
414
|
-
asset: {
|
|
415
|
-
public_url: '',
|
|
416
|
-
},
|
|
417
|
-
name: '',
|
|
418
|
-
},
|
|
408
|
+
file: null,
|
|
419
409
|
prompt: '',
|
|
420
410
|
textOrImage: 'text',
|
|
421
411
|
},
|
|
@@ -464,48 +454,59 @@ export default {
|
|
|
464
454
|
}
|
|
465
455
|
},
|
|
466
456
|
onEnd(evt, originalEvent) {
|
|
457
|
+
// if dragged to nowhere do not set target
|
|
458
|
+
const draggedToNowhere = evt.to === evt.from
|
|
467
459
|
if (!this.render) {
|
|
468
460
|
this.mainPrompt =
|
|
469
461
|
this.block.metadata.config.prompts[this.startingIndex]
|
|
470
462
|
}
|
|
471
463
|
let draggedElement = ''
|
|
472
464
|
let target = ''
|
|
473
|
-
if (
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
element
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
465
|
+
if (!draggedToNowhere) {
|
|
466
|
+
if (this.mainPrompt.textOrImage === 'text') {
|
|
467
|
+
draggedElement =
|
|
468
|
+
this.block.metadata.config.answerObjects[evt.oldIndex]
|
|
469
|
+
this.block.metadata.config.prompts.forEach(
|
|
470
|
+
(outerElement) => {
|
|
471
|
+
const getMain = outerElement.find((element) => {
|
|
472
|
+
return (
|
|
473
|
+
element.prompt ==
|
|
474
|
+
evt.to.firstChild.textContent.trim()
|
|
475
|
+
)
|
|
476
|
+
})
|
|
477
|
+
if (getMain) {
|
|
478
|
+
target = getMain
|
|
479
|
+
}
|
|
480
|
+
}
|
|
481
|
+
)
|
|
482
|
+
} else {
|
|
483
|
+
draggedElement =
|
|
484
|
+
this.block.metadata.config.answerObjects[evt.oldIndex]
|
|
485
|
+
this.block.metadata.config.prompts.forEach(
|
|
486
|
+
(outerElement) => {
|
|
487
|
+
const mainElement = outerElement.find((element) => {
|
|
488
|
+
return (
|
|
489
|
+
element.file?.id ==
|
|
490
|
+
evt.to.firstElementChild.id
|
|
491
|
+
)
|
|
492
|
+
})
|
|
493
|
+
if (mainElement) {
|
|
494
|
+
target = mainElement
|
|
495
|
+
}
|
|
496
|
+
}
|
|
497
|
+
)
|
|
498
|
+
}
|
|
501
499
|
}
|
|
500
|
+
//set feedback information here
|
|
502
501
|
if (_.isUndefined(target) || _.isEmpty(target)) {
|
|
503
502
|
console.log('dragged to nowhere')
|
|
504
503
|
} else if (draggedElement.id !== target.answer.id) {
|
|
505
504
|
this.feedback = this.block.metadata.config.feedback_incorrect
|
|
506
505
|
this.status = 'errorOutline'
|
|
507
506
|
} else if (draggedElement.id === target.answer.id) {
|
|
508
|
-
this.feedback =
|
|
507
|
+
this.feedback = !_.isEmpty(target.matchExplanation)
|
|
508
|
+
? target.matchExplanation
|
|
509
|
+
: this.block.metadata.config.feedback_correct
|
|
509
510
|
this.solvedQuestions.push(target)
|
|
510
511
|
this.status = 'successOutline'
|
|
511
512
|
this.allowDrag = false
|
|
@@ -550,6 +551,28 @@ export default {
|
|
|
550
551
|
)
|
|
551
552
|
this.setMainPrompt()
|
|
552
553
|
},
|
|
554
|
+
getFileAlt(file, defaultText = '') {
|
|
555
|
+
// If a default / override was defined
|
|
556
|
+
if (defaultText) {
|
|
557
|
+
return defaultText
|
|
558
|
+
}
|
|
559
|
+
|
|
560
|
+
file = this.resolveAsset(file)
|
|
561
|
+
return _.get(file, 'asset.metadata.props.alt', '')
|
|
562
|
+
},
|
|
563
|
+
getFileAriaDescribedBy(file, defaultText = '') {
|
|
564
|
+
// If a default / override was defined
|
|
565
|
+
if (defaultText) {
|
|
566
|
+
return defaultText
|
|
567
|
+
}
|
|
568
|
+
|
|
569
|
+
file = this.resolveAsset(file)
|
|
570
|
+
return _.get(file, 'asset.metadata.props.aria_describedby', '')
|
|
571
|
+
},
|
|
572
|
+
getFilePublicUrl(file) {
|
|
573
|
+
file = this.resolveAsset(file)
|
|
574
|
+
return _.get(file, 'asset.public_url', '')
|
|
575
|
+
},
|
|
553
576
|
},
|
|
554
577
|
}
|
|
555
578
|
</script>
|