@windward/games 0.6.0 → 0.7.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/CHANGELOG.md +8 -1
- package/components/content/blocks/dragDrop/BucketGame.vue +24 -8
- package/components/content/blocks/flashcards/CardFace.vue +3 -3
- package/components/content/blocks/matchingGame/MatchingGame.vue +0 -7
- package/components/content/blocks/sevenStrikes/SevenStikes.vue +2 -6
- package/components/content/blocks/wordJumble/WordJumble.vue +9 -8
- package/components/settings/BucketGameSettingsManager.vue +37 -40
- package/components/settings/CrosswordPuzzleSettingsManager.vue +49 -26
- package/components/settings/FlashCardSlidesManager.vue +30 -16
- package/components/settings/MatchingGameManager.vue +39 -20
- package/components/settings/MultipleChoiceSettingsManager.vue +29 -14
- package/components/settings/QuizShowSettingsManager.vue +20 -12
- package/components/settings/SevenStrikesSettingsManager.vue +37 -25
- package/components/settings/SlideShowManager.vue +39 -20
- package/components/settings/SortingGameSettingsManager.vue +40 -20
- package/components/settings/WordJumbleSettingsManager.vue +33 -25
- package/i18n/en-US/components/content/blocks/bucket_game.ts +1 -0
- package/i18n/en-US/components/content/blocks/flashcard.ts +2 -2
- package/i18n/en-US/components/content/blocks/quizshow_game.ts +1 -1
- package/i18n/en-US/components/settings/bucket_game.ts +2 -1
- package/i18n/en-US/components/settings/crossword.ts +1 -0
- package/i18n/en-US/components/settings/flashcard.ts +2 -1
- package/i18n/en-US/components/settings/matching_game.ts +1 -0
- package/i18n/en-US/components/settings/multiple_choice.ts +1 -0
- package/i18n/en-US/components/settings/quizshow_game.ts +1 -1
- package/i18n/en-US/components/settings/seven_strikes.ts +1 -1
- package/i18n/en-US/components/settings/slideshow.ts +3 -2
- package/i18n/en-US/components/settings/sorting_game.ts +1 -0
- package/i18n/en-US/components/settings/word_jumble.ts +1 -0
- package/i18n/es-ES/components/content/blocks/bucket_game.ts +1 -0
- package/i18n/es-ES/components/settings/bucket_game.ts +3 -1
- package/i18n/es-ES/components/settings/crossword.ts +2 -0
- package/i18n/es-ES/components/settings/flashcard.ts +1 -0
- package/i18n/es-ES/components/settings/matching_game.ts +1 -0
- package/i18n/es-ES/components/settings/multiple_choice.ts +2 -0
- package/i18n/es-ES/components/settings/quizshow_game.ts +1 -1
- package/i18n/es-ES/components/settings/slideshow.ts +1 -0
- package/i18n/es-ES/components/settings/sorting_game.ts +1 -0
- package/i18n/es-ES/components/settings/word_jumble.ts +1 -0
- package/i18n/sv-SE/components/content/blocks/bucket_game.ts +1 -0
- package/i18n/sv-SE/components/content/blocks/quizshow_game.ts +1 -1
- package/i18n/sv-SE/components/settings/bucket_game.ts +2 -0
- package/i18n/sv-SE/components/settings/crossword.ts +1 -0
- package/i18n/sv-SE/components/settings/flashcard.ts +1 -0
- package/i18n/sv-SE/components/settings/matching_game.ts +1 -0
- package/i18n/sv-SE/components/settings/multiple_choice.ts +1 -0
- package/i18n/sv-SE/components/settings/quizshow_game.ts +1 -1
- package/i18n/sv-SE/components/settings/slideshow.ts +1 -0
- package/i18n/sv-SE/components/settings/sorting_game.ts +1 -0
- package/i18n/sv-SE/components/settings/word_jumble.ts +2 -1
- package/i18n/sv-SE/shared/content_blocks.ts +5 -5
- package/i18n/sv-SE/shared/settings.ts +6 -6
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -253,6 +253,7 @@ import _ from 'lodash'
|
|
|
253
253
|
import CrudTable from '../../CrudTable'
|
|
254
254
|
import BaseContentBlock from '~/components/Content/Blocks/BaseContentBlock'
|
|
255
255
|
import TextViewer from '~/components/Text/TextViewer.vue'
|
|
256
|
+
import Uuid from '~/helpers/Uuid'
|
|
256
257
|
|
|
257
258
|
export default {
|
|
258
259
|
name: 'BucketGame',
|
|
@@ -268,7 +269,11 @@ export default {
|
|
|
268
269
|
if (_.isEmpty(this.block.metadata.config)) {
|
|
269
270
|
this.block.metadata.config = {}
|
|
270
271
|
}
|
|
271
|
-
if (
|
|
272
|
+
if (
|
|
273
|
+
_.isEmpty(this.block.metadata.config.title) &&
|
|
274
|
+
this.block.id &&
|
|
275
|
+
!Uuid.test(this.block.id)
|
|
276
|
+
) {
|
|
272
277
|
this.block.metadata.config.title = this.$t(
|
|
273
278
|
'windward.games.components.content.blocks.bucket_game.game_title'
|
|
274
279
|
)
|
|
@@ -277,14 +282,10 @@ export default {
|
|
|
277
282
|
this.block.metadata.config.instructions = ''
|
|
278
283
|
}
|
|
279
284
|
if (_.isEmpty(this.block.metadata.config.feedback_correct)) {
|
|
280
|
-
this.block.metadata.config.feedback_correct =
|
|
281
|
-
'windward.games.components.settings.bucket_game.form.feedback.correct_default'
|
|
282
|
-
)
|
|
285
|
+
this.block.metadata.config.feedback_correct = ''
|
|
283
286
|
}
|
|
284
287
|
if (_.isEmpty(this.block.metadata.config.feedback_incorrect)) {
|
|
285
|
-
this.block.metadata.config.feedback_incorrect =
|
|
286
|
-
'windward.games.components.settings.bucket_game.form.feedback.incorrect_default'
|
|
287
|
-
)
|
|
288
|
+
this.block.metadata.config.feedback_incorrect = ''
|
|
288
289
|
}
|
|
289
290
|
if (_.isEmpty(this.block.metadata.config.bucket_titles)) {
|
|
290
291
|
this.block.metadata.config.bucket_titles = []
|
|
@@ -429,7 +430,6 @@ export default {
|
|
|
429
430
|
if (
|
|
430
431
|
element.bucket_index === item.bucket_index &&
|
|
431
432
|
element.display === item.display &&
|
|
432
|
-
element.display_value === item.display_value &&
|
|
433
433
|
element.feedback === item.feedback &&
|
|
434
434
|
element.id === item.id
|
|
435
435
|
) {
|
|
@@ -467,6 +467,17 @@ export default {
|
|
|
467
467
|
)
|
|
468
468
|
} else {
|
|
469
469
|
this.status = 'successOutline'
|
|
470
|
+
// set correct feedback
|
|
471
|
+
if (evt.added.element.feedback) {
|
|
472
|
+
this.feedback = evt.added.element.feedback
|
|
473
|
+
} else {
|
|
474
|
+
this.feedback = this.block.metadata.config
|
|
475
|
+
.feedback_correct
|
|
476
|
+
? this.block.metadata.config.feedback_correct
|
|
477
|
+
: this.$t(
|
|
478
|
+
'windward.games.components.settings.bucket_game.form.feedback.correct_default'
|
|
479
|
+
)
|
|
480
|
+
}
|
|
470
481
|
}
|
|
471
482
|
} else {
|
|
472
483
|
let items = this.items[bucket_index]
|
|
@@ -474,7 +485,12 @@ export default {
|
|
|
474
485
|
this.items[bucket_index].splice(indexOfAddedElement, 1)
|
|
475
486
|
// puts item back into mutable array for draggable component
|
|
476
487
|
this.mainAnswer.push(evt.added.element)
|
|
488
|
+
// set incorrect feedback
|
|
477
489
|
this.feedback = this.block.metadata.config.feedback_incorrect
|
|
490
|
+
? this.block.metadata.config.feedback_incorrect
|
|
491
|
+
: this.$t(
|
|
492
|
+
'windward.games.components.settings.bucket_game.form.feedback.incorrect_default'
|
|
493
|
+
)
|
|
478
494
|
this.status = 'errorOutline'
|
|
479
495
|
}
|
|
480
496
|
},
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
<v-container>
|
|
3
3
|
<br />
|
|
4
4
|
<div class="card-content">
|
|
5
|
-
<v-row
|
|
5
|
+
<v-row>
|
|
6
6
|
<content-viewer :class="textClass" v-model="settings.text" />
|
|
7
7
|
</v-row>
|
|
8
8
|
<br />
|
|
@@ -51,7 +51,7 @@ export default {
|
|
|
51
51
|
this.settings.text.length < 100 &&
|
|
52
52
|
this.side === 'front'
|
|
53
53
|
) {
|
|
54
|
-
return '
|
|
54
|
+
return 'centered card-content--bold'
|
|
55
55
|
}
|
|
56
56
|
|
|
57
57
|
if (this.side === 'front') {
|
|
@@ -66,7 +66,7 @@ export default {
|
|
|
66
66
|
return 'text-justify centered'
|
|
67
67
|
}
|
|
68
68
|
|
|
69
|
-
return 'px-6 text-
|
|
69
|
+
return 'px-6 text-left'
|
|
70
70
|
},
|
|
71
71
|
imageAsset() {
|
|
72
72
|
if (!this.settings.imageAsset) {
|
|
@@ -15,13 +15,6 @@
|
|
|
15
15
|
<p>
|
|
16
16
|
{{ block.metadata.config.instructions }}
|
|
17
17
|
</p>
|
|
18
|
-
<p>
|
|
19
|
-
{{
|
|
20
|
-
$t(
|
|
21
|
-
'windward.games.components.content.blocks.matching_game.description'
|
|
22
|
-
)
|
|
23
|
-
}}
|
|
24
|
-
</p>
|
|
25
18
|
<v-container :class="status">
|
|
26
19
|
<v-row class="d-flex justify-center pa-2">{{
|
|
27
20
|
feedback
|
|
@@ -234,14 +234,10 @@ export default {
|
|
|
234
234
|
)
|
|
235
235
|
}
|
|
236
236
|
if (_.isEmpty(this.block.metadata.config.feedback_correct)) {
|
|
237
|
-
this.block.metadata.config.feedback_correct =
|
|
238
|
-
'windward.games.components.settings.bucket_game.form.feedback.correct_default'
|
|
239
|
-
)
|
|
237
|
+
this.block.metadata.config.feedback_correct = ''
|
|
240
238
|
}
|
|
241
239
|
if (_.isEmpty(this.block.metadata.config.feedback_correct)) {
|
|
242
|
-
this.block.metadata.config.feedback_incorrect =
|
|
243
|
-
'windward.games.components.settings.bucket_game.form.feedback.incorrect_default'
|
|
244
|
-
)
|
|
240
|
+
this.block.metadata.config.feedback_incorrect = ''
|
|
245
241
|
}
|
|
246
242
|
if (_.isEmpty(this.block.metadata.config.words)) {
|
|
247
243
|
this.block.metadata.config.words = []
|
|
@@ -164,6 +164,7 @@ import _ from 'lodash'
|
|
|
164
164
|
import Jumble from './Jumble.vue'
|
|
165
165
|
import BaseContentBlock from '~/components/Content/Blocks/BaseContentBlock'
|
|
166
166
|
import Crypto from '~/helpers/Crypto'
|
|
167
|
+
import Uuid from '~/helpers/Uuid'
|
|
167
168
|
|
|
168
169
|
export default {
|
|
169
170
|
name: 'WordJumble',
|
|
@@ -183,23 +184,23 @@ export default {
|
|
|
183
184
|
}
|
|
184
185
|
if (_.isEmpty(this.block.metadata.config.title)) {
|
|
185
186
|
this.block.metadata.config.title = this.$t(
|
|
186
|
-
'windward.games.components.
|
|
187
|
+
'windward.games.components.settings.word_jumble.title'
|
|
187
188
|
)
|
|
188
189
|
}
|
|
189
|
-
if (
|
|
190
|
+
if (
|
|
191
|
+
_.isEmpty(this.block.metadata.config.instructions) &&
|
|
192
|
+
this.block.id &&
|
|
193
|
+
!Uuid.test(this.block.id)
|
|
194
|
+
) {
|
|
190
195
|
this.block.metadata.config.instructions = this.$t(
|
|
191
196
|
'windward.games.components.content.blocks.word_jumble.instructions'
|
|
192
197
|
)
|
|
193
198
|
}
|
|
194
199
|
if (_.isEmpty(this.block.metadata.config.feedback_correct)) {
|
|
195
|
-
this.block.metadata.config.feedback_correct =
|
|
196
|
-
'windward.games.components.settings.bucket_game.form.feedback.correct_default'
|
|
197
|
-
)
|
|
200
|
+
this.block.metadata.config.feedback_correct = ''
|
|
198
201
|
}
|
|
199
202
|
if (_.isEmpty(this.block.metadata.config.feedback_incorrect)) {
|
|
200
|
-
this.block.metadata.config.feedback_incorrect =
|
|
201
|
-
'windward.games.components.settings.bucket_game.form.feedback.incorrect_default'
|
|
202
|
-
)
|
|
203
|
+
this.block.metadata.config.feedback_incorrect = ''
|
|
203
204
|
}
|
|
204
205
|
if (_.isEmpty(this.block.metadata.config.words)) {
|
|
205
206
|
this.block.metadata.config.words = []
|
|
@@ -146,24 +146,7 @@
|
|
|
146
146
|
<p class="p-label mb-0">
|
|
147
147
|
{{
|
|
148
148
|
$t(
|
|
149
|
-
'windward.games.components.content.blocks.bucket_game.form.
|
|
150
|
-
)
|
|
151
|
-
}}
|
|
152
|
-
</p>
|
|
153
|
-
<v-text-field
|
|
154
|
-
v-model="
|
|
155
|
-
block.metadata.config
|
|
156
|
-
.bucket_answers[index][
|
|
157
|
-
answerIndex
|
|
158
|
-
].display_value
|
|
159
|
-
"
|
|
160
|
-
outlined
|
|
161
|
-
:disabled="render"
|
|
162
|
-
></v-text-field>
|
|
163
|
-
<p class="p-label mb-0">
|
|
164
|
-
{{
|
|
165
|
-
$t(
|
|
166
|
-
'windward.games.components.content.blocks.bucket_game.form.feedback.feedback'
|
|
149
|
+
'windward.games.components.content.blocks.bucket_game.form.feedback.explanation'
|
|
167
150
|
)
|
|
168
151
|
}}
|
|
169
152
|
</p>
|
|
@@ -265,6 +248,7 @@ import TextEditor from '~/components/Text/TextEditor'
|
|
|
265
248
|
import Crypto from '~/helpers/Crypto'
|
|
266
249
|
import BaseContentSettings from '~/components/Content/Settings/BaseContentSettings.js'
|
|
267
250
|
import SortableExpansionPanel from '~/components/Core/SortableExpansionPanel.vue'
|
|
251
|
+
import Uuid from '~/helpers/Uuid'
|
|
268
252
|
|
|
269
253
|
export default {
|
|
270
254
|
name: 'BucketGameSettingsManager',
|
|
@@ -286,23 +270,29 @@ export default {
|
|
|
286
270
|
if (_.isEmpty(this.block.metadata.config)) {
|
|
287
271
|
this.block.metadata.config = {}
|
|
288
272
|
}
|
|
289
|
-
if (
|
|
273
|
+
if (
|
|
274
|
+
_.isEmpty(this.block.metadata.config.title) &&
|
|
275
|
+
this.block.id &&
|
|
276
|
+
!Uuid.test(this.block.id)
|
|
277
|
+
) {
|
|
290
278
|
this.block.metadata.config.title = this.$t(
|
|
291
279
|
'windward.games.components.content.blocks.bucket_game.game_title'
|
|
292
280
|
)
|
|
293
281
|
}
|
|
294
|
-
if (
|
|
295
|
-
this.block.metadata.config.instructions
|
|
282
|
+
if (
|
|
283
|
+
_.isEmpty(this.block.metadata.config.instructions) &&
|
|
284
|
+
this.block.id &&
|
|
285
|
+
!Uuid.test(this.block.id)
|
|
286
|
+
) {
|
|
287
|
+
this.block.metadata.config.instructions = this.$t(
|
|
288
|
+
'windward.games.components.settings.bucket_game.form.default_instructions'
|
|
289
|
+
)
|
|
296
290
|
}
|
|
297
291
|
if (_.isEmpty(this.block.metadata.config.feedback_correct)) {
|
|
298
|
-
this.block.metadata.config.feedback_correct =
|
|
299
|
-
'windward.games.components.settings.bucket_game.form.feedback.correct_default'
|
|
300
|
-
)
|
|
292
|
+
this.block.metadata.config.feedback_correct = ''
|
|
301
293
|
}
|
|
302
294
|
if (_.isEmpty(this.block.metadata.config.feedback_incorrect)) {
|
|
303
|
-
this.block.metadata.config.feedback_incorrect =
|
|
304
|
-
'windward.games.components.settings.bucket_game.form.feedback.incorrect_default'
|
|
305
|
-
)
|
|
295
|
+
this.block.metadata.config.feedback_incorrect = ''
|
|
306
296
|
}
|
|
307
297
|
if (_.isEmpty(this.block.metadata.config.bucket_titles)) {
|
|
308
298
|
this.block.metadata.config.bucket_titles = []
|
|
@@ -331,20 +321,28 @@ export default {
|
|
|
331
321
|
],
|
|
332
322
|
validation: {
|
|
333
323
|
titleRule: [
|
|
334
|
-
(v) =>
|
|
335
|
-
v.length
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
324
|
+
(v) => {
|
|
325
|
+
if (v && v.length >= 50) {
|
|
326
|
+
return this.$t(
|
|
327
|
+
'windward.games.shared.settings.errors.input_limitations',
|
|
328
|
+
[50]
|
|
329
|
+
)
|
|
330
|
+
} else {
|
|
331
|
+
return true
|
|
332
|
+
}
|
|
333
|
+
},
|
|
340
334
|
],
|
|
341
335
|
instructionsRule: [
|
|
342
|
-
(v) =>
|
|
343
|
-
v.length
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
336
|
+
(v) => {
|
|
337
|
+
if (v && v.length >= 255) {
|
|
338
|
+
return this.$t(
|
|
339
|
+
'windward.games.shared.settings.errors.input_limitations',
|
|
340
|
+
[255]
|
|
341
|
+
)
|
|
342
|
+
} else {
|
|
343
|
+
return true
|
|
344
|
+
}
|
|
345
|
+
},
|
|
348
346
|
],
|
|
349
347
|
},
|
|
350
348
|
}
|
|
@@ -402,7 +400,6 @@ export default {
|
|
|
402
400
|
const answerObject = {
|
|
403
401
|
bucket_index: mainBucketIndex,
|
|
404
402
|
display: '',
|
|
405
|
-
display_value: '',
|
|
406
403
|
feedback: '',
|
|
407
404
|
expand: true,
|
|
408
405
|
id: this.block.metadata.config.bucket_answers.length + 1,
|
|
@@ -128,6 +128,7 @@
|
|
|
128
128
|
import _ from 'lodash'
|
|
129
129
|
import BaseContentSettings from '~/components/Content/Settings/BaseContentSettings.js'
|
|
130
130
|
import SortableExpansionPanel from '~/components/Core/SortableExpansionPanel.vue'
|
|
131
|
+
import Uuid from '~/helpers/Uuid'
|
|
131
132
|
|
|
132
133
|
export default {
|
|
133
134
|
name: 'CrosswordPuzzleSettingsManager',
|
|
@@ -148,8 +149,14 @@ export default {
|
|
|
148
149
|
'windward.games.components.content.blocks.crossword.crossword'
|
|
149
150
|
)
|
|
150
151
|
}
|
|
151
|
-
if (
|
|
152
|
-
this.block.metadata.config.instructions
|
|
152
|
+
if (
|
|
153
|
+
_.isEmpty(this.block.metadata.config.instructions) &&
|
|
154
|
+
this.block.id &&
|
|
155
|
+
!Uuid.test(this.block.id)
|
|
156
|
+
) {
|
|
157
|
+
this.block.metadata.config.instructions = this.$t(
|
|
158
|
+
'windward.games.components.settings.crossword.instructions'
|
|
159
|
+
)
|
|
153
160
|
}
|
|
154
161
|
if (_.isEmpty(this.block.metadata.config.words)) {
|
|
155
162
|
this.block.metadata.config.words = []
|
|
@@ -172,36 +179,52 @@ export default {
|
|
|
172
179
|
loading: false,
|
|
173
180
|
validation: {
|
|
174
181
|
titleRule: [
|
|
175
|
-
(v) =>
|
|
176
|
-
v.length
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
182
|
+
(v) => {
|
|
183
|
+
if (v && v.length >= 50) {
|
|
184
|
+
return this.$t(
|
|
185
|
+
'windward.games.shared.settings.errors.input_limitations',
|
|
186
|
+
[50]
|
|
187
|
+
)
|
|
188
|
+
} else {
|
|
189
|
+
return true
|
|
190
|
+
}
|
|
191
|
+
},
|
|
181
192
|
],
|
|
182
193
|
instructionRule: [
|
|
183
|
-
(v) =>
|
|
184
|
-
v.length
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
194
|
+
(v) => {
|
|
195
|
+
if (v && v.length >= 255) {
|
|
196
|
+
return this.$t(
|
|
197
|
+
'windward.games.shared.settings.errors.input_limitations',
|
|
198
|
+
[255]
|
|
199
|
+
)
|
|
200
|
+
} else {
|
|
201
|
+
return true
|
|
202
|
+
}
|
|
203
|
+
},
|
|
189
204
|
],
|
|
190
205
|
wordRule: [
|
|
191
|
-
(v) =>
|
|
192
|
-
v.length
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
206
|
+
(v) => {
|
|
207
|
+
if (v && v.length >= 20) {
|
|
208
|
+
return this.$t(
|
|
209
|
+
'windward.games.shared.settings.errors.input_limitations',
|
|
210
|
+
[20]
|
|
211
|
+
)
|
|
212
|
+
} else {
|
|
213
|
+
return true
|
|
214
|
+
}
|
|
215
|
+
},
|
|
197
216
|
],
|
|
198
217
|
clueRule: [
|
|
199
|
-
(v) =>
|
|
200
|
-
v.length
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
218
|
+
(v) => {
|
|
219
|
+
if (v && v.length >= 155) {
|
|
220
|
+
return this.$t(
|
|
221
|
+
'windward.games.shared.settings.errors.input_limitations',
|
|
222
|
+
[155]
|
|
223
|
+
)
|
|
224
|
+
} else {
|
|
225
|
+
return true
|
|
226
|
+
}
|
|
227
|
+
},
|
|
205
228
|
],
|
|
206
229
|
},
|
|
207
230
|
}
|
|
@@ -370,20 +370,28 @@ export default {
|
|
|
370
370
|
valid: true,
|
|
371
371
|
validation: {
|
|
372
372
|
shortInputRules: [
|
|
373
|
-
(v) =>
|
|
374
|
-
v.length
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
373
|
+
(v) => {
|
|
374
|
+
if (v && v.length >= 50) {
|
|
375
|
+
return this.$t(
|
|
376
|
+
'windward.games.shared.settings.errors.input_limitations',
|
|
377
|
+
[50]
|
|
378
|
+
)
|
|
379
|
+
} else {
|
|
380
|
+
return true
|
|
381
|
+
}
|
|
382
|
+
},
|
|
379
383
|
],
|
|
380
384
|
instructionRule: [
|
|
381
|
-
(v) =>
|
|
382
|
-
v.length
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
385
|
+
(v) => {
|
|
386
|
+
if (v && v.length >= 255) {
|
|
387
|
+
return this.$t(
|
|
388
|
+
'windward.games.shared.settings.errors.input_limitations',
|
|
389
|
+
[255]
|
|
390
|
+
)
|
|
391
|
+
} else {
|
|
392
|
+
return true
|
|
393
|
+
}
|
|
394
|
+
},
|
|
387
395
|
],
|
|
388
396
|
},
|
|
389
397
|
}
|
|
@@ -403,11 +411,17 @@ export default {
|
|
|
403
411
|
'windward.games.components.content.blocks.flashcard.title'
|
|
404
412
|
)
|
|
405
413
|
}
|
|
406
|
-
if (
|
|
407
|
-
this.block.metadata.config
|
|
414
|
+
if (
|
|
415
|
+
_.isEmpty(this.block.metadata.config.instructions) &&
|
|
416
|
+
this.block.id &&
|
|
417
|
+
!Uuid.test(this.block.id)
|
|
418
|
+
) {
|
|
419
|
+
this.block.metadata.config.instructions = this.$t(
|
|
420
|
+
'windward.games.components.settings.flashcard.form.instructions'
|
|
421
|
+
)
|
|
422
|
+
}
|
|
423
|
+
if (_.isEmpty(this.block.metadata.config.currentSlide)) {
|
|
408
424
|
this.block.metadata.config.currentSlide = 0
|
|
409
|
-
this.block.metadata.config.title = ''
|
|
410
|
-
this.block.metadata.config.instructions = ''
|
|
411
425
|
}
|
|
412
426
|
},
|
|
413
427
|
|
|
@@ -334,6 +334,7 @@
|
|
|
334
334
|
import BaseContentSettings from '~/components/Content/Settings/BaseContentSettings.js'
|
|
335
335
|
import _ from 'lodash'
|
|
336
336
|
import SortableExpansionPanel from '~/components/Core/SortableExpansionPanel.vue'
|
|
337
|
+
import Uuid from '~/helpers/Uuid'
|
|
337
338
|
|
|
338
339
|
export default {
|
|
339
340
|
name: 'MatchingGameManager',
|
|
@@ -359,8 +360,14 @@ export default {
|
|
|
359
360
|
'windward.games.components.settings.matching_game.form.title'
|
|
360
361
|
)
|
|
361
362
|
}
|
|
362
|
-
if (
|
|
363
|
-
this.block.metadata.config.instructions
|
|
363
|
+
if (
|
|
364
|
+
_.isEmpty(this.block.metadata.config.instructions) &&
|
|
365
|
+
this.block.id &&
|
|
366
|
+
!Uuid.test(this.block.id)
|
|
367
|
+
) {
|
|
368
|
+
this.block.metadata.config.instructions = this.$t(
|
|
369
|
+
'windward.games.components.settings.matching_game.form.default_instructions'
|
|
370
|
+
)
|
|
364
371
|
}
|
|
365
372
|
if (_.isEmpty(this.block.metadata.config.feedback_correct)) {
|
|
366
373
|
this.block.metadata.config.feedback_correct = this.$t(
|
|
@@ -391,28 +398,40 @@ export default {
|
|
|
391
398
|
loading: false,
|
|
392
399
|
validation: {
|
|
393
400
|
shortInputRules: [
|
|
394
|
-
(v) =>
|
|
395
|
-
v.length
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
401
|
+
(v) => {
|
|
402
|
+
if (v && v.length >= 50) {
|
|
403
|
+
return this.$t(
|
|
404
|
+
'windward.games.shared.settings.errors.input_limitations',
|
|
405
|
+
[50]
|
|
406
|
+
)
|
|
407
|
+
} else {
|
|
408
|
+
return true
|
|
409
|
+
}
|
|
410
|
+
},
|
|
400
411
|
],
|
|
401
412
|
instructionRule: [
|
|
402
|
-
(v) =>
|
|
403
|
-
v.length
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
413
|
+
(v) => {
|
|
414
|
+
if (v && v.length >= 255) {
|
|
415
|
+
return this.$t(
|
|
416
|
+
'windward.games.shared.settings.errors.input_limitations',
|
|
417
|
+
[255]
|
|
418
|
+
)
|
|
419
|
+
} else {
|
|
420
|
+
return true
|
|
421
|
+
}
|
|
422
|
+
},
|
|
408
423
|
],
|
|
409
424
|
promptRule: [
|
|
410
|
-
(v) =>
|
|
411
|
-
v.length
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
425
|
+
(v) => {
|
|
426
|
+
if (v && v.length >= 200) {
|
|
427
|
+
return this.$t(
|
|
428
|
+
'windward.games.shared.settings.errors.input_limitations',
|
|
429
|
+
[50]
|
|
430
|
+
)
|
|
431
|
+
} else {
|
|
432
|
+
return true
|
|
433
|
+
}
|
|
434
|
+
},
|
|
416
435
|
],
|
|
417
436
|
},
|
|
418
437
|
}
|
|
@@ -114,6 +114,7 @@ import SortableExpansionPanel from '~/components/Core/SortableExpansionPanel.vue
|
|
|
114
114
|
import DialogBox from '~/components/Core/DialogBox.vue'
|
|
115
115
|
import QuestionDialog from '../content/blocks/multipleChoice/QuestionDialog.vue'
|
|
116
116
|
import Crypto from '~/helpers/Crypto'
|
|
117
|
+
import Uuid from '~/helpers/Uuid'
|
|
117
118
|
|
|
118
119
|
export default {
|
|
119
120
|
name: 'MultipleChoiceSettingsManager',
|
|
@@ -134,8 +135,14 @@ export default {
|
|
|
134
135
|
'windward.games.components.content.blocks.multiple_choice.game_title'
|
|
135
136
|
)
|
|
136
137
|
}
|
|
137
|
-
if (
|
|
138
|
-
this.block.metadata.config.instructions
|
|
138
|
+
if (
|
|
139
|
+
_.isEmpty(this.block.metadata.config.instructions) &&
|
|
140
|
+
this.block.id &&
|
|
141
|
+
!Uuid.test(this.block.id)
|
|
142
|
+
) {
|
|
143
|
+
this.block.metadata.config.instructions = this.$t(
|
|
144
|
+
'windward.games.components.settings.multiple_choice.default_instructions'
|
|
145
|
+
)
|
|
139
146
|
}
|
|
140
147
|
if (_.isEmpty(this.block.metadata.config.questions)) {
|
|
141
148
|
this.block.metadata.config.questions = []
|
|
@@ -152,20 +159,28 @@ export default {
|
|
|
152
159
|
loading: false,
|
|
153
160
|
validation: {
|
|
154
161
|
titleRule: [
|
|
155
|
-
(v) =>
|
|
156
|
-
v.length
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
162
|
+
(v) => {
|
|
163
|
+
if (v && v.length >= 50) {
|
|
164
|
+
return this.$t(
|
|
165
|
+
'windward.games.shared.settings.errors.input_limitations',
|
|
166
|
+
[50]
|
|
167
|
+
)
|
|
168
|
+
} else {
|
|
169
|
+
return true
|
|
170
|
+
}
|
|
171
|
+
},
|
|
161
172
|
],
|
|
162
173
|
instructionRule: [
|
|
163
|
-
(v) =>
|
|
164
|
-
v.length
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
174
|
+
(v) => {
|
|
175
|
+
if (v && v.length >= 255) {
|
|
176
|
+
return this.$t(
|
|
177
|
+
'windward.games.shared.settings.errors.input_limitations',
|
|
178
|
+
[50]
|
|
179
|
+
)
|
|
180
|
+
} else {
|
|
181
|
+
return true
|
|
182
|
+
}
|
|
183
|
+
},
|
|
169
184
|
],
|
|
170
185
|
},
|
|
171
186
|
}
|