@windward/games 0.6.0 → 0.8.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/crosswordPuzzle/CrosswordPuzzle.vue +10 -2
- package/components/content/blocks/dragDrop/BucketGame.vue +30 -9
- package/components/content/blocks/dragDrop/SortingGame.vue +4 -2
- package/components/content/blocks/flashcards/CardFace.vue +3 -3
- package/components/content/blocks/flashcards/FlashcardSlides.vue +2 -2
- package/components/content/blocks/matchingGame/MatchingGame.vue +34 -17
- package/components/content/blocks/multipleChoice/MultipleChoice.vue +10 -2
- package/components/content/blocks/multipleChoice/QuestionDialog.vue +4 -7
- package/components/content/blocks/quizshowGame/QuizShow.vue +0 -7
- package/components/content/blocks/sevenStrikes/SevenStikes.vue +2 -6
- package/components/content/blocks/slideshow/SlideShow.vue +6 -1
- package/components/content/blocks/wordJumble/WordJumble.vue +9 -8
- package/components/settings/BucketGameSettingsManager.vue +23 -50
- package/components/settings/CrosswordPuzzleSettingsManager.vue +35 -34
- package/components/settings/FlashCardSlidesManager.vue +22 -30
- package/components/settings/MatchingGameManager.vue +36 -37
- package/components/settings/MultipleChoiceSettingsManager.vue +15 -24
- package/components/settings/QuizShowSettingsManager.vue +12 -54
- package/components/settings/SevenStrikesSettingsManager.vue +18 -41
- package/components/settings/SlideShowManager.vue +29 -37
- package/components/settings/SortingGameSettingsManager.vue +18 -34
- package/components/settings/WordJumbleSettingsManager.vue +13 -41
- 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/en-US/shared/content_blocks.ts +1 -1
- package/i18n/en-US/shared/settings.ts +3 -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/es-ES/shared/settings.ts +3 -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 +9 -6
- package/package.json +2 -2
- package/test/settings/BucketGameManager.spec.js +0 -1
|
@@ -3,9 +3,10 @@
|
|
|
3
3
|
<v-container class="pa-0">
|
|
4
4
|
<v-text-field
|
|
5
5
|
ref="title"
|
|
6
|
+
id="block-settings-title"
|
|
6
7
|
v-model="block.metadata.config.title"
|
|
7
|
-
:
|
|
8
|
-
:
|
|
8
|
+
:rules="$Validation.getRule('block.title')"
|
|
9
|
+
:counter="$Validation.getLimit('block.title')"
|
|
9
10
|
outlined
|
|
10
11
|
:autofocus="true"
|
|
11
12
|
:label="
|
|
@@ -16,11 +17,12 @@
|
|
|
16
17
|
:disabled="render"
|
|
17
18
|
></v-text-field>
|
|
18
19
|
<v-textarea
|
|
20
|
+
id="block-settings-instructions"
|
|
19
21
|
outlined
|
|
20
22
|
auto-grow
|
|
21
23
|
v-model="block.metadata.config.instructions"
|
|
22
|
-
:rules="
|
|
23
|
-
:counter="
|
|
24
|
+
:rules="$Validation.getRule('block.instructions')"
|
|
25
|
+
:counter="$Validation.getLimit('block.instructions')"
|
|
24
26
|
:label="
|
|
25
27
|
$t(
|
|
26
28
|
'windward.games.components.settings.bucket_game.form.instructions'
|
|
@@ -128,6 +130,7 @@
|
|
|
128
130
|
import _ from 'lodash'
|
|
129
131
|
import BaseContentSettings from '~/components/Content/Settings/BaseContentSettings.js'
|
|
130
132
|
import SortableExpansionPanel from '~/components/Core/SortableExpansionPanel.vue'
|
|
133
|
+
import Uuid from '~/helpers/Uuid'
|
|
131
134
|
|
|
132
135
|
export default {
|
|
133
136
|
name: 'CrosswordPuzzleSettingsManager',
|
|
@@ -148,8 +151,14 @@ export default {
|
|
|
148
151
|
'windward.games.components.content.blocks.crossword.crossword'
|
|
149
152
|
)
|
|
150
153
|
}
|
|
151
|
-
if (
|
|
152
|
-
this.block.metadata.config.instructions
|
|
154
|
+
if (
|
|
155
|
+
_.isEmpty(this.block.metadata.config.instructions) &&
|
|
156
|
+
this.block.id &&
|
|
157
|
+
!Uuid.test(this.block.id)
|
|
158
|
+
) {
|
|
159
|
+
this.block.metadata.config.instructions = this.$t(
|
|
160
|
+
'windward.games.components.settings.crossword.instructions'
|
|
161
|
+
)
|
|
153
162
|
}
|
|
154
163
|
if (_.isEmpty(this.block.metadata.config.words)) {
|
|
155
164
|
this.block.metadata.config.words = []
|
|
@@ -171,37 +180,29 @@ export default {
|
|
|
171
180
|
valid: true,
|
|
172
181
|
loading: false,
|
|
173
182
|
validation: {
|
|
174
|
-
titleRule: [
|
|
175
|
-
(v) =>
|
|
176
|
-
v.length <= 50 ||
|
|
177
|
-
this.$t(
|
|
178
|
-
'windward.games.shared.settings.errors.input_limitations',
|
|
179
|
-
[50]
|
|
180
|
-
),
|
|
181
|
-
],
|
|
182
|
-
instructionRule: [
|
|
183
|
-
(v) =>
|
|
184
|
-
v.length <= 255 ||
|
|
185
|
-
this.$t(
|
|
186
|
-
'windward.games.shared.settings.errors.input_limitations',
|
|
187
|
-
[255]
|
|
188
|
-
),
|
|
189
|
-
],
|
|
190
183
|
wordRule: [
|
|
191
|
-
(v) =>
|
|
192
|
-
v.length
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
184
|
+
(v) => {
|
|
185
|
+
if (v && v.length >= 20) {
|
|
186
|
+
return this.$t(
|
|
187
|
+
'windward.games.shared.settings.errors.input_limitations',
|
|
188
|
+
[20]
|
|
189
|
+
)
|
|
190
|
+
} else {
|
|
191
|
+
return true
|
|
192
|
+
}
|
|
193
|
+
},
|
|
197
194
|
],
|
|
198
195
|
clueRule: [
|
|
199
|
-
(v) =>
|
|
200
|
-
v.length
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
196
|
+
(v) => {
|
|
197
|
+
if (v && v.length >= 155) {
|
|
198
|
+
return this.$t(
|
|
199
|
+
'windward.games.shared.settings.errors.input_limitations',
|
|
200
|
+
[155]
|
|
201
|
+
)
|
|
202
|
+
} else {
|
|
203
|
+
return true
|
|
204
|
+
}
|
|
205
|
+
},
|
|
205
206
|
],
|
|
206
207
|
},
|
|
207
208
|
}
|
|
@@ -3,10 +3,11 @@
|
|
|
3
3
|
<v-container class="pa-0">
|
|
4
4
|
<v-text-field
|
|
5
5
|
ref="title"
|
|
6
|
+
id="block-settings-title"
|
|
6
7
|
v-model="block.metadata.config.title"
|
|
8
|
+
:rules="$Validation.getRule('block.title')"
|
|
9
|
+
:counter="$Validation.getLimit('block.title')"
|
|
7
10
|
outlined
|
|
8
|
-
:counter="50"
|
|
9
|
-
:rules="validation.shortInputRules"
|
|
10
11
|
:label="
|
|
11
12
|
$t(
|
|
12
13
|
'windward.games.components.settings.bucket_game.form.title'
|
|
@@ -15,9 +16,10 @@
|
|
|
15
16
|
:disabled="render"
|
|
16
17
|
></v-text-field>
|
|
17
18
|
<v-textarea
|
|
19
|
+
id="block-settings-instructions"
|
|
18
20
|
v-model="block.metadata.config.instructions"
|
|
19
|
-
:rules="
|
|
20
|
-
:counter="
|
|
21
|
+
:rules="$Validation.getRule('block.instructions')"
|
|
22
|
+
:counter="$Validation.getLimit('block.instructions')"
|
|
21
23
|
outlined
|
|
22
24
|
auto-grow
|
|
23
25
|
:label="
|
|
@@ -116,8 +118,8 @@
|
|
|
116
118
|
"
|
|
117
119
|
outlined
|
|
118
120
|
auto-grow
|
|
119
|
-
:rules="
|
|
120
|
-
:counter="
|
|
121
|
+
:rules="$Validation.getRule('shortInput')"
|
|
122
|
+
:counter="$Validation.getLimit('shortInput')"
|
|
121
123
|
:label="
|
|
122
124
|
$t(
|
|
123
125
|
'windward.games.components.settings.flashcard.form.header'
|
|
@@ -162,13 +164,14 @@
|
|
|
162
164
|
.imageAsset
|
|
163
165
|
"
|
|
164
166
|
mimes="image/png,image/jpeg"
|
|
167
|
+
outlined
|
|
165
168
|
:assets.sync="block.assets"
|
|
166
169
|
:disabled="render"
|
|
167
170
|
>
|
|
168
171
|
<template #title>
|
|
169
172
|
{{
|
|
170
173
|
$t(
|
|
171
|
-
'windward.games.
|
|
174
|
+
'windward.games.shared.settings.file_picker.image'
|
|
172
175
|
)
|
|
173
176
|
}}
|
|
174
177
|
</template>
|
|
@@ -233,13 +236,14 @@
|
|
|
233
236
|
.imageAsset
|
|
234
237
|
"
|
|
235
238
|
mimes="image/png,image/jpeg"
|
|
239
|
+
outlined
|
|
236
240
|
:assets.sync="block.assets"
|
|
237
241
|
:disabled="render"
|
|
238
242
|
>
|
|
239
243
|
<template #title>
|
|
240
244
|
{{
|
|
241
245
|
$t(
|
|
242
|
-
'windward.games.
|
|
246
|
+
'windward.games.shared.settings.file_picker.image'
|
|
243
247
|
)
|
|
244
248
|
}}
|
|
245
249
|
</template>
|
|
@@ -368,24 +372,6 @@ export default {
|
|
|
368
372
|
return {
|
|
369
373
|
loading: false,
|
|
370
374
|
valid: true,
|
|
371
|
-
validation: {
|
|
372
|
-
shortInputRules: [
|
|
373
|
-
(v) =>
|
|
374
|
-
v.length <= 50 ||
|
|
375
|
-
this.$t(
|
|
376
|
-
'windward.games.shared.settings.errors.input_limitations',
|
|
377
|
-
[50]
|
|
378
|
-
),
|
|
379
|
-
],
|
|
380
|
-
instructionRule: [
|
|
381
|
-
(v) =>
|
|
382
|
-
v.length <= 255 ||
|
|
383
|
-
this.$t(
|
|
384
|
-
'windward.games.shared.settings.errors.input_limitations',
|
|
385
|
-
[255]
|
|
386
|
-
),
|
|
387
|
-
],
|
|
388
|
-
},
|
|
389
375
|
}
|
|
390
376
|
},
|
|
391
377
|
beforeMount() {
|
|
@@ -403,11 +389,17 @@ export default {
|
|
|
403
389
|
'windward.games.components.content.blocks.flashcard.title'
|
|
404
390
|
)
|
|
405
391
|
}
|
|
406
|
-
if (
|
|
407
|
-
this.block.metadata.config
|
|
392
|
+
if (
|
|
393
|
+
_.isEmpty(this.block.metadata.config.instructions) &&
|
|
394
|
+
this.block.id &&
|
|
395
|
+
!Uuid.test(this.block.id)
|
|
396
|
+
) {
|
|
397
|
+
this.block.metadata.config.instructions = this.$t(
|
|
398
|
+
'windward.games.components.settings.flashcard.form.instructions'
|
|
399
|
+
)
|
|
400
|
+
}
|
|
401
|
+
if (_.isEmpty(this.block.metadata.config.currentSlide)) {
|
|
408
402
|
this.block.metadata.config.currentSlide = 0
|
|
409
|
-
this.block.metadata.config.title = ''
|
|
410
|
-
this.block.metadata.config.instructions = ''
|
|
411
403
|
}
|
|
412
404
|
},
|
|
413
405
|
|
|
@@ -3,11 +3,12 @@
|
|
|
3
3
|
<v-container class="pa-0">
|
|
4
4
|
<v-text-field
|
|
5
5
|
ref="title"
|
|
6
|
+
id="block-settings-title"
|
|
6
7
|
v-model="block.metadata.config.title"
|
|
7
|
-
:rules="
|
|
8
|
+
:rules="$Validation.getRule('block.title')"
|
|
9
|
+
:counter="$Validation.getLimit('block.title')"
|
|
8
10
|
:autofocus="true"
|
|
9
11
|
outlined
|
|
10
|
-
:counter="50"
|
|
11
12
|
:label="
|
|
12
13
|
$t(
|
|
13
14
|
'windward.games.components.settings.matching_game.form.title'
|
|
@@ -16,11 +17,12 @@
|
|
|
16
17
|
:disabled="render"
|
|
17
18
|
></v-text-field>
|
|
18
19
|
<v-textarea
|
|
20
|
+
id="block-settings-instructions"
|
|
19
21
|
v-model="block.metadata.config.instructions"
|
|
20
|
-
:rules="
|
|
22
|
+
:rules="$Validation.getRule('block.instructions')"
|
|
23
|
+
:counter="$Validation.getLimit('block.instructions')"
|
|
21
24
|
outlined
|
|
22
25
|
auto-grow
|
|
23
|
-
:counter="255"
|
|
24
26
|
:label="
|
|
25
27
|
$t(
|
|
26
28
|
'windward.games.components.settings.matching_game.form.instructions'
|
|
@@ -68,8 +70,8 @@
|
|
|
68
70
|
block.metadata.config.answerObjects[index]
|
|
69
71
|
.display
|
|
70
72
|
"
|
|
71
|
-
:
|
|
72
|
-
:
|
|
73
|
+
:rules="$Validation.getRule('shortInput')"
|
|
74
|
+
:counter="$Validation.getLimit('shortInput')"
|
|
73
75
|
outlined
|
|
74
76
|
:disabled="render"
|
|
75
77
|
></v-text-field>
|
|
@@ -175,8 +177,14 @@
|
|
|
175
177
|
index
|
|
176
178
|
][indexPrompt].prompt
|
|
177
179
|
"
|
|
178
|
-
:
|
|
179
|
-
|
|
180
|
+
:rules="
|
|
181
|
+
$Validation.getRule('longInput')
|
|
182
|
+
"
|
|
183
|
+
:counter="
|
|
184
|
+
$Validation.getLimit(
|
|
185
|
+
'longInput'
|
|
186
|
+
)
|
|
187
|
+
"
|
|
180
188
|
:label="
|
|
181
189
|
$t(
|
|
182
190
|
'windward.games.components.settings.matching_game.form.prompt_body'
|
|
@@ -259,11 +267,20 @@
|
|
|
259
267
|
index
|
|
260
268
|
][indexPrompt].file
|
|
261
269
|
"
|
|
270
|
+
outlined
|
|
262
271
|
:assets.sync="block.assets"
|
|
263
272
|
class="content-block-asset"
|
|
264
273
|
mimes="image/png,image/jpeg"
|
|
265
274
|
:disabled="render"
|
|
266
|
-
|
|
275
|
+
>
|
|
276
|
+
<template #title>
|
|
277
|
+
{{
|
|
278
|
+
$t(
|
|
279
|
+
'windward.games.shared.settings.file_picker.image'
|
|
280
|
+
)
|
|
281
|
+
}}
|
|
282
|
+
</template>
|
|
283
|
+
</ContentBlockAsset>
|
|
267
284
|
</v-container>
|
|
268
285
|
<v-container class="pa-0">
|
|
269
286
|
<v-text-field
|
|
@@ -278,6 +295,7 @@
|
|
|
278
295
|
)
|
|
279
296
|
"
|
|
280
297
|
outlined
|
|
298
|
+
:disabled="render"
|
|
281
299
|
></v-text-field>
|
|
282
300
|
</v-container>
|
|
283
301
|
</v-container>
|
|
@@ -334,6 +352,7 @@
|
|
|
334
352
|
import BaseContentSettings from '~/components/Content/Settings/BaseContentSettings.js'
|
|
335
353
|
import _ from 'lodash'
|
|
336
354
|
import SortableExpansionPanel from '~/components/Core/SortableExpansionPanel.vue'
|
|
355
|
+
import Uuid from '~/helpers/Uuid'
|
|
337
356
|
|
|
338
357
|
export default {
|
|
339
358
|
name: 'MatchingGameManager',
|
|
@@ -359,8 +378,14 @@ export default {
|
|
|
359
378
|
'windward.games.components.settings.matching_game.form.title'
|
|
360
379
|
)
|
|
361
380
|
}
|
|
362
|
-
if (
|
|
363
|
-
this.block.metadata.config.instructions
|
|
381
|
+
if (
|
|
382
|
+
_.isEmpty(this.block.metadata.config.instructions) &&
|
|
383
|
+
this.block.id &&
|
|
384
|
+
!Uuid.test(this.block.id)
|
|
385
|
+
) {
|
|
386
|
+
this.block.metadata.config.instructions = this.$t(
|
|
387
|
+
'windward.games.components.settings.matching_game.form.default_instructions'
|
|
388
|
+
)
|
|
364
389
|
}
|
|
365
390
|
if (_.isEmpty(this.block.metadata.config.feedback_correct)) {
|
|
366
391
|
this.block.metadata.config.feedback_correct = this.$t(
|
|
@@ -389,32 +414,6 @@ export default {
|
|
|
389
414
|
return {
|
|
390
415
|
valid: true,
|
|
391
416
|
loading: false,
|
|
392
|
-
validation: {
|
|
393
|
-
shortInputRules: [
|
|
394
|
-
(v) =>
|
|
395
|
-
v.length <= 50 ||
|
|
396
|
-
this.$t(
|
|
397
|
-
'windward.games.shared.settings.errors.input_limitations',
|
|
398
|
-
[50]
|
|
399
|
-
),
|
|
400
|
-
],
|
|
401
|
-
instructionRule: [
|
|
402
|
-
(v) =>
|
|
403
|
-
v.length <= 255 ||
|
|
404
|
-
this.$t(
|
|
405
|
-
'windward.games.shared.settings.errors.input_limitations',
|
|
406
|
-
[255]
|
|
407
|
-
),
|
|
408
|
-
],
|
|
409
|
-
promptRule: [
|
|
410
|
-
(v) =>
|
|
411
|
-
v.length <= 200 ||
|
|
412
|
-
this.$t(
|
|
413
|
-
'windward.games.shared.settings.errors.input_limitations',
|
|
414
|
-
[200]
|
|
415
|
-
),
|
|
416
|
-
],
|
|
417
|
-
},
|
|
418
417
|
}
|
|
419
418
|
},
|
|
420
419
|
mounted() {},
|
|
@@ -2,11 +2,12 @@
|
|
|
2
2
|
<div>
|
|
3
3
|
<v-container class="pa-0">
|
|
4
4
|
<v-text-field
|
|
5
|
+
id="block-settings-title"
|
|
5
6
|
v-model="block.metadata.config.title"
|
|
6
7
|
outlined
|
|
7
8
|
:autofocus="true"
|
|
8
|
-
:rules="
|
|
9
|
-
:counter="
|
|
9
|
+
:rules="$Validation.getRule('block.title')"
|
|
10
|
+
:counter="$Validation.getLimit('block.title')"
|
|
10
11
|
:label="
|
|
11
12
|
$t(
|
|
12
13
|
'windward.games.components.settings.multiple_choice.title_placeholder'
|
|
@@ -15,11 +16,12 @@
|
|
|
15
16
|
:disabled="render"
|
|
16
17
|
></v-text-field>
|
|
17
18
|
<v-textarea
|
|
19
|
+
id="block-settings-instructions"
|
|
18
20
|
v-model="block.metadata.config.instructions"
|
|
19
21
|
outlined
|
|
20
|
-
:rules="
|
|
22
|
+
:rules="$Validation.getRule('block.instructions')"
|
|
23
|
+
:counter="$Validation.getLimit('block.instructions')"
|
|
21
24
|
auto-grow
|
|
22
|
-
:counter="255"
|
|
23
25
|
:label="
|
|
24
26
|
$t(
|
|
25
27
|
'windward.games.components.settings.multiple_choice.instructions'
|
|
@@ -114,6 +116,7 @@ import SortableExpansionPanel from '~/components/Core/SortableExpansionPanel.vue
|
|
|
114
116
|
import DialogBox from '~/components/Core/DialogBox.vue'
|
|
115
117
|
import QuestionDialog from '../content/blocks/multipleChoice/QuestionDialog.vue'
|
|
116
118
|
import Crypto from '~/helpers/Crypto'
|
|
119
|
+
import Uuid from '~/helpers/Uuid'
|
|
117
120
|
|
|
118
121
|
export default {
|
|
119
122
|
name: 'MultipleChoiceSettingsManager',
|
|
@@ -134,8 +137,14 @@ export default {
|
|
|
134
137
|
'windward.games.components.content.blocks.multiple_choice.game_title'
|
|
135
138
|
)
|
|
136
139
|
}
|
|
137
|
-
if (
|
|
138
|
-
this.block.metadata.config.instructions
|
|
140
|
+
if (
|
|
141
|
+
_.isEmpty(this.block.metadata.config.instructions) &&
|
|
142
|
+
this.block.id &&
|
|
143
|
+
!Uuid.test(this.block.id)
|
|
144
|
+
) {
|
|
145
|
+
this.block.metadata.config.instructions = this.$t(
|
|
146
|
+
'windward.games.components.settings.multiple_choice.default_instructions'
|
|
147
|
+
)
|
|
139
148
|
}
|
|
140
149
|
if (_.isEmpty(this.block.metadata.config.questions)) {
|
|
141
150
|
this.block.metadata.config.questions = []
|
|
@@ -150,24 +159,6 @@ export default {
|
|
|
150
159
|
isNotEditing: false,
|
|
151
160
|
valid: true,
|
|
152
161
|
loading: false,
|
|
153
|
-
validation: {
|
|
154
|
-
titleRule: [
|
|
155
|
-
(v) =>
|
|
156
|
-
v.length <= 50 ||
|
|
157
|
-
this.$t(
|
|
158
|
-
'windward.games.shared.settings.errors.input_limitations',
|
|
159
|
-
[50]
|
|
160
|
-
),
|
|
161
|
-
],
|
|
162
|
-
instructionRule: [
|
|
163
|
-
(v) =>
|
|
164
|
-
v.length <= 255 ||
|
|
165
|
-
this.$t(
|
|
166
|
-
'windward.games.shared.settings.errors.input_limitations',
|
|
167
|
-
[255]
|
|
168
|
-
),
|
|
169
|
-
],
|
|
170
|
-
},
|
|
171
162
|
}
|
|
172
163
|
},
|
|
173
164
|
mounted() {
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<div>
|
|
3
3
|
<v-text-field
|
|
4
|
+
id="block-settings-title"
|
|
4
5
|
v-model="block.metadata.config.title"
|
|
5
|
-
:rules="
|
|
6
|
-
:counter="
|
|
6
|
+
:rules="$Validation.getRule('block.title')"
|
|
7
|
+
:counter="$Validation.getLimit('block.title')"
|
|
7
8
|
outlined
|
|
8
9
|
:label="
|
|
9
10
|
$t(
|
|
@@ -24,11 +25,12 @@
|
|
|
24
25
|
></v-checkbox>
|
|
25
26
|
<br />
|
|
26
27
|
<v-textarea
|
|
28
|
+
id="block-settings-instructions"
|
|
27
29
|
outlined
|
|
28
30
|
auto-grow
|
|
29
31
|
v-model="block.metadata.config.instructions"
|
|
30
|
-
:rules="
|
|
31
|
-
:counter="
|
|
32
|
+
:rules="$Validation.getRule('block.instructions')"
|
|
33
|
+
:counter="$Validation.getLimit('block.instructions')"
|
|
32
34
|
:label="
|
|
33
35
|
$t(
|
|
34
36
|
'windward.games.components.settings.multiple_choice.instructions'
|
|
@@ -75,8 +77,12 @@
|
|
|
75
77
|
index - 1
|
|
76
78
|
]
|
|
77
79
|
"
|
|
78
|
-
:rules="
|
|
79
|
-
|
|
80
|
+
:rules="
|
|
81
|
+
$Validation.getRule('shortInput')
|
|
82
|
+
"
|
|
83
|
+
:counter="
|
|
84
|
+
$Validation.getLimit('shortInput')
|
|
85
|
+
"
|
|
80
86
|
:label="
|
|
81
87
|
$tc(
|
|
82
88
|
'windward.games.components.settings.quizshow_game.form.category',
|
|
@@ -241,54 +247,6 @@ export default {
|
|
|
241
247
|
},
|
|
242
248
|
data() {
|
|
243
249
|
return {
|
|
244
|
-
validation: {
|
|
245
|
-
lengthRules: [
|
|
246
|
-
(v) => !!v || this.$t('shared.forms.errors.required'),
|
|
247
|
-
(v) =>
|
|
248
|
-
(!!v && v.length >= 1) ||
|
|
249
|
-
this.$t('shared.forms.errors.required'),
|
|
250
|
-
(v) => {
|
|
251
|
-
if (!!v && v <= 10) {
|
|
252
|
-
return true
|
|
253
|
-
} else {
|
|
254
|
-
return this.$t('shared.forms.errors.number_lt', [
|
|
255
|
-
10,
|
|
256
|
-
])
|
|
257
|
-
}
|
|
258
|
-
},
|
|
259
|
-
],
|
|
260
|
-
pointsRules: [
|
|
261
|
-
(v) => !!v || this.$t('shared.forms.errors.required'),
|
|
262
|
-
(v) =>
|
|
263
|
-
(!!v && v.length >= 1) ||
|
|
264
|
-
this.$t('shared.forms.errors.required'),
|
|
265
|
-
(v) => {
|
|
266
|
-
if (!!v && v <= 9999) {
|
|
267
|
-
return true
|
|
268
|
-
} else {
|
|
269
|
-
return this.$t('shared.forms.errors.number_lt', [
|
|
270
|
-
9999,
|
|
271
|
-
])
|
|
272
|
-
}
|
|
273
|
-
},
|
|
274
|
-
],
|
|
275
|
-
shortInputRules: [
|
|
276
|
-
(v) =>
|
|
277
|
-
v.length <= 50 ||
|
|
278
|
-
this.$t(
|
|
279
|
-
'windward.games.shared.settings.errors.input_limitations',
|
|
280
|
-
[50]
|
|
281
|
-
),
|
|
282
|
-
],
|
|
283
|
-
instructionRule: [
|
|
284
|
-
(v) =>
|
|
285
|
-
v.length <= 255 ||
|
|
286
|
-
this.$t(
|
|
287
|
-
'windward.games.shared.settings.errors.input_limitations',
|
|
288
|
-
[255]
|
|
289
|
-
),
|
|
290
|
-
],
|
|
291
|
-
},
|
|
292
250
|
loading: false,
|
|
293
251
|
cursor: 'changePointer',
|
|
294
252
|
quizShowSettings: {
|
|
@@ -3,10 +3,11 @@
|
|
|
3
3
|
<v-container class="pa-0">
|
|
4
4
|
<v-text-field
|
|
5
5
|
ref="title"
|
|
6
|
+
id="block-settings-title"
|
|
6
7
|
v-model="block.metadata.config.title"
|
|
7
|
-
:rules="
|
|
8
|
+
:rules="$Validation.getRule('block.title')"
|
|
9
|
+
:counter="$Validation.getLimit('block.title')"
|
|
8
10
|
outlined
|
|
9
|
-
:counter="50"
|
|
10
11
|
:autofocus="true"
|
|
11
12
|
:label="
|
|
12
13
|
$t(
|
|
@@ -16,9 +17,10 @@
|
|
|
16
17
|
:disabled="render"
|
|
17
18
|
></v-text-field>
|
|
18
19
|
<v-textarea
|
|
20
|
+
id="block-settings-instructions"
|
|
19
21
|
v-model="block.metadata.config.instructions"
|
|
20
|
-
:
|
|
21
|
-
:
|
|
22
|
+
:rules="$Validation.getRule('block.instructions')"
|
|
23
|
+
:counter="$Validation.getLimit('block.instructions')"
|
|
22
24
|
outlined
|
|
23
25
|
auto-grow
|
|
24
26
|
:label="
|
|
@@ -65,8 +67,8 @@
|
|
|
65
67
|
v-model="
|
|
66
68
|
block.metadata.config.words[index].value
|
|
67
69
|
"
|
|
68
|
-
:rules="
|
|
69
|
-
:counter="
|
|
70
|
+
:rules="$Validation.getRule('shortInput')"
|
|
71
|
+
:counter="$Validation.getLimit('shortInput')"
|
|
70
72
|
outlined
|
|
71
73
|
:autofocus="true"
|
|
72
74
|
:disabled="render"
|
|
@@ -82,8 +84,8 @@
|
|
|
82
84
|
v-model="
|
|
83
85
|
block.metadata.config.words[index].hint
|
|
84
86
|
"
|
|
85
|
-
:rules="
|
|
86
|
-
:counter="
|
|
87
|
+
:rules="$Validation.getRule('mediumInput')"
|
|
88
|
+
:counter="$Validation.getLimit('mediumInput')"
|
|
87
89
|
outlined
|
|
88
90
|
class="pt-4"
|
|
89
91
|
:disabled="render"
|
|
@@ -144,6 +146,7 @@ import draggable from 'vuedraggable'
|
|
|
144
146
|
import BaseContentSettings from '~/components/Content/Settings/BaseContentSettings.js'
|
|
145
147
|
import CrudTable from '../content/CrudTable.vue'
|
|
146
148
|
import SortableExpansionPanel from '~/components/Core/SortableExpansionPanel.vue'
|
|
149
|
+
import Uuid from '~/helpers/Uuid'
|
|
147
150
|
|
|
148
151
|
export default {
|
|
149
152
|
name: 'SevenStrikesSettingsManager',
|
|
@@ -167,20 +170,20 @@ export default {
|
|
|
167
170
|
'windward.games.components.settings.seven_strikes.title'
|
|
168
171
|
)
|
|
169
172
|
}
|
|
170
|
-
if (
|
|
173
|
+
if (
|
|
174
|
+
_.isEmpty(this.block.metadata.config.instructions) &&
|
|
175
|
+
this.block.id &&
|
|
176
|
+
!Uuid.test(this.block.id)
|
|
177
|
+
) {
|
|
171
178
|
this.block.metadata.config.instructions = this.$t(
|
|
172
179
|
'windward.games.components.settings.seven_strikes.instructions'
|
|
173
180
|
)
|
|
174
181
|
}
|
|
175
182
|
if (_.isEmpty(this.block.metadata.config.feedback_correct)) {
|
|
176
|
-
this.block.metadata.config.feedback_correct =
|
|
177
|
-
'windward.games.components.settings.bucket_game.form.feedback.correct_default'
|
|
178
|
-
)
|
|
183
|
+
this.block.metadata.config.feedback_correct = ''
|
|
179
184
|
}
|
|
180
185
|
if (_.isEmpty(this.block.metadata.config.feedback_incorrect)) {
|
|
181
|
-
this.block.metadata.config.feedback_incorrect =
|
|
182
|
-
'windward.games.components.settings.bucket_game.form.feedback.incorrect_default'
|
|
183
|
-
)
|
|
186
|
+
this.block.metadata.config.feedback_incorrect = ''
|
|
184
187
|
}
|
|
185
188
|
if (_.isEmpty(this.block.metadata.config.words)) {
|
|
186
189
|
this.block.metadata.config.words = []
|
|
@@ -197,32 +200,6 @@ export default {
|
|
|
197
200
|
return {
|
|
198
201
|
valid: true,
|
|
199
202
|
loading: false,
|
|
200
|
-
validation: {
|
|
201
|
-
shortInputRules: [
|
|
202
|
-
(v) =>
|
|
203
|
-
v.length <= 50 ||
|
|
204
|
-
this.$t(
|
|
205
|
-
'windward.games.shared.settings.errors.input_limitations',
|
|
206
|
-
[50]
|
|
207
|
-
),
|
|
208
|
-
],
|
|
209
|
-
instructionRule: [
|
|
210
|
-
(v) =>
|
|
211
|
-
v.length <= 255 ||
|
|
212
|
-
this.$t(
|
|
213
|
-
'windward.games.shared.settings.errors.input_limitations',
|
|
214
|
-
[255]
|
|
215
|
-
),
|
|
216
|
-
],
|
|
217
|
-
clueRule: [
|
|
218
|
-
(v) =>
|
|
219
|
-
v.length <= 155 ||
|
|
220
|
-
this.$t(
|
|
221
|
-
'windward.games.shared.settings.errors.input_limitations',
|
|
222
|
-
[155]
|
|
223
|
-
),
|
|
224
|
-
],
|
|
225
|
-
},
|
|
226
203
|
}
|
|
227
204
|
},
|
|
228
205
|
methods: {
|