@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.
Files changed (64) hide show
  1. package/CHANGELOG.md +8 -1
  2. package/components/content/blocks/crosswordPuzzle/CrosswordPuzzle.vue +10 -2
  3. package/components/content/blocks/dragDrop/BucketGame.vue +30 -9
  4. package/components/content/blocks/dragDrop/SortingGame.vue +4 -2
  5. package/components/content/blocks/flashcards/CardFace.vue +3 -3
  6. package/components/content/blocks/flashcards/FlashcardSlides.vue +2 -2
  7. package/components/content/blocks/matchingGame/MatchingGame.vue +34 -17
  8. package/components/content/blocks/multipleChoice/MultipleChoice.vue +10 -2
  9. package/components/content/blocks/multipleChoice/QuestionDialog.vue +4 -7
  10. package/components/content/blocks/quizshowGame/QuizShow.vue +0 -7
  11. package/components/content/blocks/sevenStrikes/SevenStikes.vue +2 -6
  12. package/components/content/blocks/slideshow/SlideShow.vue +6 -1
  13. package/components/content/blocks/wordJumble/WordJumble.vue +9 -8
  14. package/components/settings/BucketGameSettingsManager.vue +23 -50
  15. package/components/settings/CrosswordPuzzleSettingsManager.vue +35 -34
  16. package/components/settings/FlashCardSlidesManager.vue +22 -30
  17. package/components/settings/MatchingGameManager.vue +36 -37
  18. package/components/settings/MultipleChoiceSettingsManager.vue +15 -24
  19. package/components/settings/QuizShowSettingsManager.vue +12 -54
  20. package/components/settings/SevenStrikesSettingsManager.vue +18 -41
  21. package/components/settings/SlideShowManager.vue +29 -37
  22. package/components/settings/SortingGameSettingsManager.vue +18 -34
  23. package/components/settings/WordJumbleSettingsManager.vue +13 -41
  24. package/i18n/en-US/components/content/blocks/bucket_game.ts +1 -0
  25. package/i18n/en-US/components/content/blocks/flashcard.ts +2 -2
  26. package/i18n/en-US/components/content/blocks/quizshow_game.ts +1 -1
  27. package/i18n/en-US/components/settings/bucket_game.ts +2 -1
  28. package/i18n/en-US/components/settings/crossword.ts +1 -0
  29. package/i18n/en-US/components/settings/flashcard.ts +2 -1
  30. package/i18n/en-US/components/settings/matching_game.ts +1 -0
  31. package/i18n/en-US/components/settings/multiple_choice.ts +1 -0
  32. package/i18n/en-US/components/settings/quizshow_game.ts +1 -1
  33. package/i18n/en-US/components/settings/seven_strikes.ts +1 -1
  34. package/i18n/en-US/components/settings/slideshow.ts +3 -2
  35. package/i18n/en-US/components/settings/sorting_game.ts +1 -0
  36. package/i18n/en-US/components/settings/word_jumble.ts +1 -0
  37. package/i18n/en-US/shared/content_blocks.ts +1 -1
  38. package/i18n/en-US/shared/settings.ts +3 -0
  39. package/i18n/es-ES/components/content/blocks/bucket_game.ts +1 -0
  40. package/i18n/es-ES/components/settings/bucket_game.ts +3 -1
  41. package/i18n/es-ES/components/settings/crossword.ts +2 -0
  42. package/i18n/es-ES/components/settings/flashcard.ts +1 -0
  43. package/i18n/es-ES/components/settings/matching_game.ts +1 -0
  44. package/i18n/es-ES/components/settings/multiple_choice.ts +2 -0
  45. package/i18n/es-ES/components/settings/quizshow_game.ts +1 -1
  46. package/i18n/es-ES/components/settings/slideshow.ts +1 -0
  47. package/i18n/es-ES/components/settings/sorting_game.ts +1 -0
  48. package/i18n/es-ES/components/settings/word_jumble.ts +1 -0
  49. package/i18n/es-ES/shared/settings.ts +3 -0
  50. package/i18n/sv-SE/components/content/blocks/bucket_game.ts +1 -0
  51. package/i18n/sv-SE/components/content/blocks/quizshow_game.ts +1 -1
  52. package/i18n/sv-SE/components/settings/bucket_game.ts +2 -0
  53. package/i18n/sv-SE/components/settings/crossword.ts +1 -0
  54. package/i18n/sv-SE/components/settings/flashcard.ts +1 -0
  55. package/i18n/sv-SE/components/settings/matching_game.ts +1 -0
  56. package/i18n/sv-SE/components/settings/multiple_choice.ts +1 -0
  57. package/i18n/sv-SE/components/settings/quizshow_game.ts +1 -1
  58. package/i18n/sv-SE/components/settings/slideshow.ts +1 -0
  59. package/i18n/sv-SE/components/settings/sorting_game.ts +1 -0
  60. package/i18n/sv-SE/components/settings/word_jumble.ts +2 -1
  61. package/i18n/sv-SE/shared/content_blocks.ts +5 -5
  62. package/i18n/sv-SE/shared/settings.ts +9 -6
  63. package/package.json +2 -2
  64. package/test/settings/BucketGameManager.spec.js +0 -1
package/CHANGELOG.md CHANGED
@@ -1,4 +1,11 @@
1
1
  # Changelog
2
2
 
3
- ### Release [0.6.0] created - 2024-07-30
3
+ ## Release [0.7.0] - 2024-08-29
4
+
5
+ * Version bump to 0.7.0
6
+
4
7
 
8
+ ### Release [0.7.0] created - 2024-08-29
9
+
10
+
11
+ ### Release [0.6.0] created - 2024-07-30
@@ -1,8 +1,16 @@
1
1
  <template>
2
2
  <v-container class="pa-0">
3
3
  <div>
4
- <h2>{{ block.metadata.config.title }}</h2>
5
- <p>{{ block.metadata.config.instructions }}</p>
4
+ <h2 v-if="block.metadata.config.title" tabindex="0">
5
+ {{ block.metadata.config.title }}
6
+ </h2>
7
+ <p
8
+ v-if="block.metadata.config.instructions"
9
+ tabindex="0"
10
+ class="pt-3"
11
+ >
12
+ {{ block.metadata.config.instructions }}
13
+ </p>
6
14
  </div>
7
15
  <v-alert v-if="wordMap.length === 0" type="info" class="text-center">
8
16
  <p>
@@ -2,6 +2,7 @@
2
2
  <div>
3
3
  <div>
4
4
  <h2
5
+ v-if="block.metadata.config.title"
5
6
  :aria-label="
6
7
  $t(
7
8
  'windward.games.components.content.blocks.bucket_game.aria_title'
@@ -12,7 +13,11 @@
12
13
  {{ block.metadata.config.title }}
13
14
  </h2>
14
15
 
15
- <p tabindex="0">
16
+ <p
17
+ v-if="block.metadata.config.instructions"
18
+ tabindex="0"
19
+ class="pt-3"
20
+ >
16
21
  {{ block.metadata.config.instructions }}
17
22
  </p>
18
23
  <h4 v-if="!render" class="d-flex justify-center align-center">
@@ -253,6 +258,7 @@ import _ from 'lodash'
253
258
  import CrudTable from '../../CrudTable'
254
259
  import BaseContentBlock from '~/components/Content/Blocks/BaseContentBlock'
255
260
  import TextViewer from '~/components/Text/TextViewer.vue'
261
+ import Uuid from '~/helpers/Uuid'
256
262
 
257
263
  export default {
258
264
  name: 'BucketGame',
@@ -268,7 +274,11 @@ export default {
268
274
  if (_.isEmpty(this.block.metadata.config)) {
269
275
  this.block.metadata.config = {}
270
276
  }
271
- if (_.isEmpty(this.block.metadata.config.title)) {
277
+ if (
278
+ _.isEmpty(this.block.metadata.config.title) &&
279
+ this.block.id &&
280
+ !Uuid.test(this.block.id)
281
+ ) {
272
282
  this.block.metadata.config.title = this.$t(
273
283
  'windward.games.components.content.blocks.bucket_game.game_title'
274
284
  )
@@ -277,14 +287,10 @@ export default {
277
287
  this.block.metadata.config.instructions = ''
278
288
  }
279
289
  if (_.isEmpty(this.block.metadata.config.feedback_correct)) {
280
- this.block.metadata.config.feedback_correct = this.$t(
281
- 'windward.games.components.settings.bucket_game.form.feedback.correct_default'
282
- )
290
+ this.block.metadata.config.feedback_correct = ''
283
291
  }
284
292
  if (_.isEmpty(this.block.metadata.config.feedback_incorrect)) {
285
- this.block.metadata.config.feedback_incorrect = this.$t(
286
- 'windward.games.components.settings.bucket_game.form.feedback.incorrect_default'
287
- )
293
+ this.block.metadata.config.feedback_incorrect = ''
288
294
  }
289
295
  if (_.isEmpty(this.block.metadata.config.bucket_titles)) {
290
296
  this.block.metadata.config.bucket_titles = []
@@ -429,7 +435,6 @@ export default {
429
435
  if (
430
436
  element.bucket_index === item.bucket_index &&
431
437
  element.display === item.display &&
432
- element.display_value === item.display_value &&
433
438
  element.feedback === item.feedback &&
434
439
  element.id === item.id
435
440
  ) {
@@ -467,6 +472,17 @@ export default {
467
472
  )
468
473
  } else {
469
474
  this.status = 'successOutline'
475
+ // set correct feedback
476
+ if (evt.added.element.feedback) {
477
+ this.feedback = evt.added.element.feedback
478
+ } else {
479
+ this.feedback = this.block.metadata.config
480
+ .feedback_correct
481
+ ? this.block.metadata.config.feedback_correct
482
+ : this.$t(
483
+ 'windward.games.components.settings.bucket_game.form.feedback.correct_default'
484
+ )
485
+ }
470
486
  }
471
487
  } else {
472
488
  let items = this.items[bucket_index]
@@ -474,7 +490,12 @@ export default {
474
490
  this.items[bucket_index].splice(indexOfAddedElement, 1)
475
491
  // puts item back into mutable array for draggable component
476
492
  this.mainAnswer.push(evt.added.element)
493
+ // set incorrect feedback
477
494
  this.feedback = this.block.metadata.config.feedback_incorrect
495
+ ? this.block.metadata.config.feedback_incorrect
496
+ : this.$t(
497
+ 'windward.games.components.settings.bucket_game.form.feedback.incorrect_default'
498
+ )
478
499
  this.status = 'errorOutline'
479
500
  }
480
501
  },
@@ -1,7 +1,9 @@
1
1
  <template>
2
2
  <div>
3
- <h2>{{ block.metadata.config.title }}</h2>
4
- <p>
3
+ <h2 v-if="block.metadata.config.title" tabindex="0">
4
+ {{ block.metadata.config.title }}
5
+ </h2>
6
+ <p v-if="block.metadata.config.instructions" tabindex="0" class="pt-3">
5
7
  {{ block.metadata.config.instructions }}
6
8
  </p>
7
9
  <v-container :key="'feedback'" :class="feedbackClass()">
@@ -2,7 +2,7 @@
2
2
  <v-container>
3
3
  <br />
4
4
  <div class="card-content">
5
- <v-row align="center" justify="center">
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 'text-justify centered card-content--bold'
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-justify'
69
+ return 'px-6 text-left'
70
70
  },
71
71
  imageAsset() {
72
72
  if (!this.settings.imageAsset) {
@@ -1,10 +1,10 @@
1
1
  <template>
2
2
  <div>
3
- <h2 v-if="block.metadata.config.title">
3
+ <h2 v-if="block.metadata.config.title" tabindex="0">
4
4
  {{ block.metadata.config.title }}
5
5
  </h2>
6
6
 
7
- <p v-if="block.metadata.config.instructions">
7
+ <p v-if="block.metadata.config.instructions" tabindex="0" class="pt-3">
8
8
  {{ block.metadata.config.instructions }}
9
9
  </p>
10
10
  <br />
@@ -2,6 +2,7 @@
2
2
  <div>
3
3
  <div>
4
4
  <h2
5
+ v-if="block.metadata.config.title"
5
6
  :aria-label="
6
7
  $t(
7
8
  'windward.games.components.content.blocks.matching_game.match_game_title'
@@ -12,24 +13,21 @@
12
13
  {{ block.metadata.config.title }}
13
14
  </h2>
14
15
 
15
- <p>
16
+ <p
17
+ v-if="block.metadata.config.instructions"
18
+ tabindex="0"
19
+ class="pt-3"
20
+ >
16
21
  {{ block.metadata.config.instructions }}
17
22
  </p>
18
- <p>
19
- {{
20
- $t(
21
- 'windward.games.components.content.blocks.matching_game.description'
22
- )
23
- }}
24
- </p>
25
23
  <v-container :class="status">
26
- <v-row class="d-flex justify-center pa-2">{{
24
+ <v-alert class="d-flex justify-center pa-2">{{
27
25
  feedback
28
26
  ? feedback
29
27
  : $t(
30
28
  'windward.games.components.content.blocks.bucket_game.form.feedback.feedback_here'
31
29
  )
32
- }}</v-row>
30
+ }}</v-alert>
33
31
  <v-row class="d-flex justify-center pa-2">
34
32
  <v-btn
35
33
  v-if="status === 'successOutline'"
@@ -42,7 +40,9 @@
42
40
  v-if="status === 'errorOutline'"
43
41
  class="d-flex justify-center align-center"
44
42
  @click="onExitFeedback"
45
- ><v-icon class="icon--error">mdi-close-circle</v-icon>
43
+ ><v-btn class="error" elevation="0">{{
44
+ $t('shared.forms.try_again')
45
+ }}</v-btn>
46
46
  </v-container>
47
47
  </v-row>
48
48
  </v-container>
@@ -256,7 +256,10 @@
256
256
  v-for="(answer, aindex) in block.metadata.config
257
257
  .answerObjects"
258
258
  :key="aindex"
259
- class="pa-2 ma-2 answerCard container-outline"
259
+ :class="
260
+ 'pa-2 ma-2 answerCard container-outline ' +
261
+ answerColor(answer)
262
+ "
260
263
  outlined
261
264
  >
262
265
  <v-icon>mdi-drag-vertical</v-icon>
@@ -410,6 +413,7 @@ export default {
410
413
  },
411
414
  startingIndex: 0,
412
415
  flattenedPrompts: '',
416
+ droppedElement: null,
413
417
  }
414
418
  },
415
419
  watch: {
@@ -428,6 +432,15 @@ export default {
428
432
  this.setMainPrompt()
429
433
  },
430
434
  methods: {
435
+ answerColor(element) {
436
+ if (
437
+ !_.isEmpty(this.droppedElement) &&
438
+ element.display === this.droppedElement.display
439
+ ) {
440
+ return this.status
441
+ }
442
+ return ''
443
+ },
431
444
  shuffle(array) {
432
445
  let currentIndex = array.length,
433
446
  randomIndex
@@ -498,10 +511,12 @@ export default {
498
511
  }
499
512
  //set feedback information here
500
513
  if (_.isUndefined(target) || _.isEmpty(target)) {
501
- console.log('dragged to nowhere')
514
+ this.droppedElement = null
502
515
  } else if (draggedElement.id !== target.answer.id) {
503
516
  this.feedback = this.block.metadata.config.feedback_incorrect
504
517
  this.status = 'errorOutline'
518
+ this.allowDrag = false
519
+ this.droppedElement = draggedElement
505
520
  } else if (draggedElement.id === target.answer.id) {
506
521
  this.feedback = !_.isEmpty(target.matchExplanation)
507
522
  ? target.matchExplanation
@@ -509,6 +524,7 @@ export default {
509
524
  this.solvedQuestions.push(target)
510
525
  this.status = 'successOutline'
511
526
  this.allowDrag = false
527
+ this.droppedElement = draggedElement
512
528
  if (
513
529
  this.solvedQuestions.length === this.flattenedPrompts.length
514
530
  ) {
@@ -523,6 +539,7 @@ export default {
523
539
  onExitFeedback() {
524
540
  this.status = 'default'
525
541
  this.allowDrag = true
542
+ this.droppedElement = null
526
543
  this.feedback = this.$t(
527
544
  'windward.games.components.content.blocks.matching_game.default_feedback'
528
545
  )
@@ -534,6 +551,7 @@ export default {
534
551
  this.status = 'default'
535
552
  this.mainPrompt = this.shufflePrompts.shift()
536
553
  this.allowDrag = true
554
+ this.droppedElement = null
537
555
  this.feedback = this.$t(
538
556
  'windward.games.components.content.blocks.matching_game.default_feedback'
539
557
  )
@@ -583,18 +601,17 @@ export default {
583
601
  transition: 0.5s box-shadow;
584
602
  }
585
603
  .successOutline {
586
- border: 4px solid var(--v-success-base);
587
- color: var(--v-success-base);
604
+ border: 4px solid var(--v-success-base) !important;
588
605
  }
589
606
  .errorOutline {
590
- border: 4px solid var(--v-error-base);
591
- color: var(--v-error-base);
607
+ border: 4px solid var(--v-error-base) !important;
592
608
  }
593
609
  .card_text {
594
610
  font-size: large;
595
611
  }
596
612
  .answerCard {
597
613
  min-width: 23%;
614
+ cursor: grab;
598
615
  }
599
616
  .icon--error {
600
617
  color: var(--v-error-base);
@@ -2,8 +2,16 @@
2
2
  <v-container class="pa-0">
3
3
  <v-row>
4
4
  <v-col>
5
- <h2>{{ block.metadata.config.title }}</h2>
6
- <p class="mb-0">{{ block.metadata.config.instructions }}</p>
5
+ <h2 v-if="block.metadata.config.title" tabindex="0">
6
+ {{ block.metadata.config.title }}
7
+ </h2>
8
+ <p
9
+ v-if="block.metadata.config.instructions"
10
+ tabindex="0"
11
+ class="pt-3"
12
+ >
13
+ {{ block.metadata.config.instructions }}
14
+ </p>
7
15
  </v-col>
8
16
  </v-row>
9
17
  <v-carousel height="auto" :hide-delimiters="hideDeliminators">
@@ -11,7 +11,7 @@
11
11
  "
12
12
  :autofocus="true"
13
13
  rows="2"
14
- :rules="validation.textRules"
14
+ :rules="$Validation.getRule('exists')"
15
15
  prepend-inner-icon="mdi-help"
16
16
  :disabled="disabled"
17
17
  ></v-textarea>
@@ -23,7 +23,7 @@
23
23
  )
24
24
  "
25
25
  rows="2"
26
- :rules="validation.textRules"
26
+ :rules="$Validation.getRule('exists')"
27
27
  prepend-inner-icon="mdi-lightbulb-on-10"
28
28
  :disabled="disabled"
29
29
  ></v-textarea>
@@ -35,7 +35,7 @@
35
35
  )
36
36
  "
37
37
  rows="2"
38
- :rules="validation.textRules"
38
+ :rules="$Validation.getRule('exists')"
39
39
  prepend-inner-icon="mdi-comment"
40
40
  :disabled="disabled"
41
41
  ></v-textarea>
@@ -92,7 +92,7 @@
92
92
  )
93
93
  "
94
94
  rows="2"
95
- :rules="validation.textRules"
95
+ :rules="$Validation.getRule('exists')"
96
96
  :disabled="disabled"
97
97
  ></v-textarea>
98
98
  </v-col>
@@ -200,9 +200,6 @@ export default {
200
200
  return {
201
201
  question: {},
202
202
  validation: {
203
- textRules: [
204
- (v) => !!v || this.$t('shared.forms.errors.required'),
205
- ],
206
203
  optionRules: [
207
204
  (v) => {
208
205
  return (
@@ -26,13 +26,6 @@
26
26
  <p tabindex="0">
27
27
  <TextViewer v-model="block.metadata.config.instructions" />
28
28
  </p>
29
- <p tabindex="0">
30
- {{
31
- $t(
32
- 'windward.games.components.content.blocks.quizshow_game.basic_instructions'
33
- )
34
- }}
35
- </p>
36
29
 
37
30
  <v-container
38
31
  class="d-flex flex-row flex-wrap flex-fill pa-0"
@@ -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 = this.$t(
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 = this.$t(
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 = []
@@ -2,6 +2,7 @@
2
2
  <div>
3
3
  <div class="header-description pa-0">
4
4
  <h2
5
+ v-if="block.metadata.config.title"
5
6
  :aria-label="
6
7
  $t(
7
8
  'windward.games.components.content.blocks.slideshow.slideshow_title'
@@ -12,7 +13,11 @@
12
13
  {{ block.metadata.config.title }}
13
14
  </h2>
14
15
 
15
- <p tabindex="0" class="pt-3">
16
+ <p
17
+ v-if="block.metadata.config.instructions"
18
+ tabindex="0"
19
+ class="pt-3"
20
+ >
16
21
  {{ block.metadata.config.instructions }}
17
22
  </p>
18
23
  </div>
@@ -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.content.blocks.word_jumble.title'
187
+ 'windward.games.components.settings.word_jumble.title'
187
188
  )
188
189
  }
189
- if (_.isEmpty(this.block.metadata.config.instructions)) {
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 = this.$t(
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 = this.$t(
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 = []
@@ -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="validation.titleRule"
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,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
22
  outlined
21
23
  auto-grow
22
- :rules="validation.instructionsRule"
23
- :counter="255"
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'
@@ -146,24 +148,7 @@
146
148
  <p class="p-label mb-0">
147
149
  {{
148
150
  $t(
149
- 'windward.games.components.content.blocks.bucket_game.form.value'
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'
151
+ 'windward.games.components.content.blocks.bucket_game.form.feedback.explanation'
167
152
  )
168
153
  }}
169
154
  </p>
@@ -265,6 +250,7 @@ import TextEditor from '~/components/Text/TextEditor'
265
250
  import Crypto from '~/helpers/Crypto'
266
251
  import BaseContentSettings from '~/components/Content/Settings/BaseContentSettings.js'
267
252
  import SortableExpansionPanel from '~/components/Core/SortableExpansionPanel.vue'
253
+ import Uuid from '~/helpers/Uuid'
268
254
 
269
255
  export default {
270
256
  name: 'BucketGameSettingsManager',
@@ -286,23 +272,29 @@ export default {
286
272
  if (_.isEmpty(this.block.metadata.config)) {
287
273
  this.block.metadata.config = {}
288
274
  }
289
- if (_.isEmpty(this.block.metadata.config.title)) {
275
+ if (
276
+ _.isEmpty(this.block.metadata.config.title) &&
277
+ this.block.id &&
278
+ !Uuid.test(this.block.id)
279
+ ) {
290
280
  this.block.metadata.config.title = this.$t(
291
281
  'windward.games.components.content.blocks.bucket_game.game_title'
292
282
  )
293
283
  }
294
- if (_.isEmpty(this.block.metadata.config.instructions)) {
295
- this.block.metadata.config.instructions = ''
284
+ if (
285
+ _.isEmpty(this.block.metadata.config.instructions) &&
286
+ this.block.id &&
287
+ !Uuid.test(this.block.id)
288
+ ) {
289
+ this.block.metadata.config.instructions = this.$t(
290
+ 'windward.games.components.settings.bucket_game.form.default_instructions'
291
+ )
296
292
  }
297
293
  if (_.isEmpty(this.block.metadata.config.feedback_correct)) {
298
- this.block.metadata.config.feedback_correct = this.$t(
299
- 'windward.games.components.settings.bucket_game.form.feedback.correct_default'
300
- )
294
+ this.block.metadata.config.feedback_correct = ''
301
295
  }
302
296
  if (_.isEmpty(this.block.metadata.config.feedback_incorrect)) {
303
- this.block.metadata.config.feedback_incorrect = this.$t(
304
- 'windward.games.components.settings.bucket_game.form.feedback.incorrect_default'
305
- )
297
+ this.block.metadata.config.feedback_incorrect = ''
306
298
  }
307
299
  if (_.isEmpty(this.block.metadata.config.bucket_titles)) {
308
300
  this.block.metadata.config.bucket_titles = []
@@ -329,24 +321,6 @@ export default {
329
321
  [colors.lightGreen.lighten4, colors.teal.lighten4],
330
322
  [colors.lightBlue.lighten4, colors.deepPurple.lighten3],
331
323
  ],
332
- validation: {
333
- titleRule: [
334
- (v) =>
335
- v.length <= 50 ||
336
- this.$t(
337
- 'windward.games.shared.settings.errors.input_limitations',
338
- [50]
339
- ),
340
- ],
341
- instructionsRule: [
342
- (v) =>
343
- v.length <= 255 ||
344
- this.$t(
345
- 'windward.games.shared.settings.errors.input_limitations',
346
- [255]
347
- ),
348
- ],
349
- },
350
324
  }
351
325
  },
352
326
  methods: {
@@ -402,7 +376,6 @@ export default {
402
376
  const answerObject = {
403
377
  bucket_index: mainBucketIndex,
404
378
  display: '',
405
- display_value: '',
406
379
  feedback: '',
407
380
  expand: true,
408
381
  id: this.block.metadata.config.bucket_answers.length + 1,