@windward/games 0.17.1 → 0.19.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 (34) hide show
  1. package/CHANGELOG.md +5 -13
  2. package/components/content/blocks/crosswordPuzzle/CrosswordPuzzle.vue +11 -2
  3. package/components/content/blocks/dragDrop/BucketGame.vue +7 -1
  4. package/components/content/blocks/dragDrop/SortingGame.vue +10 -1
  5. package/components/content/blocks/flashcards/CardFace.vue +15 -11
  6. package/components/content/blocks/flashcards/Flashcard.vue +0 -3
  7. package/components/content/blocks/flashcards/FlashcardSlides.vue +54 -6
  8. package/components/content/blocks/matchingGame/MatchingGame.vue +7 -1
  9. package/components/content/blocks/multipleChoice/MultipleChoice.vue +34 -19
  10. package/components/content/blocks/multipleChoice/QuestionDialog.vue +335 -112
  11. package/components/content/blocks/quizshowGame/QuizShow.vue +7 -0
  12. package/components/content/blocks/sevenStrikes/SevenStikes.vue +9 -1
  13. package/components/content/blocks/slideshow/SlideShow.vue +7 -2
  14. package/components/content/blocks/wordJumble/WordJumble.vue +9 -1
  15. package/components/settings/BucketGameSettingsManager.vue +151 -28
  16. package/components/settings/CrosswordPuzzleSettingsManager.vue +8 -29
  17. package/components/settings/FlashCardSlidesManager.vue +8 -27
  18. package/components/settings/MatchingGameManager.vue +12 -29
  19. package/components/settings/MultipleChoiceSettingsManager.vue +37 -30
  20. package/components/settings/QuizShowSettingsManager.vue +11 -28
  21. package/components/settings/SevenStrikesSettingsManager.vue +13 -29
  22. package/components/settings/SlideShowManager.vue +8 -26
  23. package/components/settings/SortingGameSettingsManager.vue +8 -29
  24. package/components/settings/WordJumbleSettingsManager.vue +8 -28
  25. package/i18n/en-US/components/content/blocks/flashcard.ts +1 -0
  26. package/i18n/en-US/components/settings/bucket_game.ts +5 -0
  27. package/i18n/en-US/components/settings/multiple_choice.ts +4 -3
  28. package/i18n/es-ES/components/settings/bucket_game.ts +5 -0
  29. package/i18n/es-ES/components/settings/multiple_choice.ts +2 -3
  30. package/i18n/sv-SE/components/settings/bucket_game.ts +5 -0
  31. package/i18n/sv-SE/components/settings/multiple_choice.ts +2 -2
  32. package/package.json +1 -1
  33. package/test/blocks/crossword/CrosswordPuzzle.spec.js +0 -21
  34. package/test/blocks/dragDrop/SortingGame.spec.js +0 -21
@@ -1,35 +1,10 @@
1
1
  <template>
2
2
  <div>
3
3
  <v-container class="pa-0">
4
- <v-text-field
5
- ref="title"
6
- id="block-settings-title"
7
- v-model="block.metadata.config.title"
8
- :rules="$Validation.getRule('block.title')"
9
- :counter="$Validation.getLimit('block.title')"
10
- outlined
11
- :autofocus="true"
12
- :label="
13
- $t(
14
- 'windward.games.components.settings.bucket_game.form.title'
15
- )
16
- "
4
+ <BaseContentBlockSettings
5
+ v-model="block.metadata.config"
17
6
  :disabled="render"
18
- ></v-text-field>
19
- <v-textarea
20
- id="block-settings-instructions"
21
- v-model="block.metadata.config.instructions"
22
- outlined
23
- auto-grow
24
- :rules="$Validation.getRule('block.instructions')"
25
- :counter="$Validation.getLimit('block.instructions')"
26
- :label="
27
- $t(
28
- 'windward.games.components.settings.bucket_game.form.instructions'
29
- )
30
- "
31
- :disabled="render"
32
- ></v-textarea>
7
+ ></BaseContentBlockSettings>
33
8
  </v-container>
34
9
  <v-divider class="my-4 primary"></v-divider>
35
10
  <v-container class="pa-0">
@@ -218,18 +193,35 @@
218
193
  indeterminate
219
194
  ></v-progress-circular>
220
195
  </div>
196
+ <v-container class="pa-4 mb-6">
197
+ <v-row>
198
+ <v-col cols="12">
199
+ <GenerateAIQuestionButton
200
+ :course="course"
201
+ :content="content"
202
+ :block="block"
203
+ question-type="bucket_game"
204
+ :replace-existing-mode="replaceExisting"
205
+ @click:generate="onGeneratedBucketGame"
206
+ ></GenerateAIQuestionButton>
207
+ </v-col>
208
+ </v-row>
209
+ </v-container>
221
210
  </div>
222
211
  </template>
223
212
 
224
213
  <script>
225
214
  import _ from 'lodash'
215
+ import { mapGetters } from 'vuex'
226
216
  import {
227
217
  MathExpressionEditor,
228
218
  MathLiveWrapper,
229
219
  ContentViewer,
220
+ GenerateAIQuestionButton
230
221
  } from '@windward/core/utils'
231
222
  import colors from 'vuetify/lib/util/colors'
232
223
  import TextEditor from '~/components/Text/TextEditor'
224
+ import BaseContentBlockSettings from '~/components/Content/Settings/BaseContentBlockSettings.vue'
233
225
  import Crypto from '~/helpers/Crypto'
234
226
  import BaseContentSettings from '~/components/Content/Settings/BaseContentSettings.js'
235
227
  import SortableExpansionPanel from '~/components/Core/SortableExpansionPanel.vue'
@@ -243,7 +235,9 @@ export default {
243
235
  MathLiveWrapper,
244
236
  ContentViewer,
245
237
  SortableExpansionPanel,
238
+ BaseContentBlockSettings,
246
239
  TextEditor,
240
+ GenerateAIQuestionButton,
247
241
  },
248
242
  beforeMount() {
249
243
  if (_.isEmpty(this.block)) {
@@ -264,6 +258,9 @@ export default {
264
258
  'windward.games.components.content.blocks.bucket_game.game_title'
265
259
  )
266
260
  }
261
+ if (!_.isBoolean(this.block.metadata.config.display_title)) {
262
+ this.$set(this.block.metadata.config, 'display_title', true)
263
+ }
267
264
  if (
268
265
  _.isEmpty(this.block.metadata.config.instructions) &&
269
266
  this.block.id &&
@@ -291,6 +288,7 @@ export default {
291
288
  loading: false,
292
289
  panel: 0,
293
290
  expansionPanelKey: '0',
291
+ replaceExisting: false,
294
292
  swatches: [
295
293
  [colors.grey.lighten1, colors.blueGrey.lighten5],
296
294
  [colors.brown.lighten3, colors.red.lighten3],
@@ -300,6 +298,12 @@ export default {
300
298
  ],
301
299
  }
302
300
  },
301
+ computed: {
302
+ ...mapGetters({
303
+ course: 'course/get',
304
+ content: 'content/get',
305
+ }),
306
+ },
303
307
  methods: {
304
308
  onDragged(panels, oldPanelOrder) {
305
309
  const oldAnswerArray = _.cloneDeep(
@@ -420,6 +424,125 @@ export default {
420
424
  return htmlString.replace(/(<([^>]+)>)/gi, '')
421
425
  }
422
426
  },
427
+ // Handler for receiving bucket game data from GenerateAIQuestionButton
428
+ onGeneratedBucketGame(activityData, replaceMode) {
429
+ this.loading = true
430
+ try {
431
+ // Process the activity data
432
+ if (activityData && activityData.metadata &&
433
+ activityData.metadata.config &&
434
+ activityData.metadata.config.bucket_titles &&
435
+ activityData.metadata.config.bucket_answers &&
436
+ Array.isArray(activityData.metadata.config.bucket_titles) &&
437
+ Array.isArray(activityData.metadata.config.bucket_answers)) {
438
+
439
+ // Save new buckets and answers
440
+ const newBuckets = activityData.metadata.config.bucket_titles
441
+ const newAnswers = activityData.metadata.config.bucket_answers
442
+
443
+ if (replaceMode) {
444
+ // Replace mode: Clear existing buckets and answers
445
+ this.block.metadata.config.bucket_titles.splice(0, this.block.metadata.config.bucket_titles.length)
446
+ this.block.metadata.config.bucket_answers.splice(0, this.block.metadata.config.bucket_answers.length)
447
+
448
+ // Add all new buckets
449
+ newBuckets.forEach(bucket => {
450
+ this.block.metadata.config.bucket_titles.push({
451
+ title: bucket.title || '',
452
+ color: bucket.color || colors.blueGrey.lighten5,
453
+ expand: false
454
+ })
455
+ })
456
+
457
+ // Add all new answers
458
+ newAnswers.forEach((bucketAnswers, index) => {
459
+ this.block.metadata.config.bucket_answers[index] = []
460
+ if (Array.isArray(bucketAnswers)) {
461
+ bucketAnswers.forEach(answer => {
462
+ this.block.metadata.config.bucket_answers[index].push({
463
+ bucket_index: index,
464
+ display: answer.display || '',
465
+ feedback: answer.feedback || '',
466
+ expand: false,
467
+ id: Crypto.id()
468
+ })
469
+ })
470
+ }
471
+ })
472
+ } else {
473
+ // Merge mode: Add new buckets and answers to existing ones
474
+ const existingBucketCount = this.block.metadata.config.bucket_titles.length
475
+
476
+ // Add new buckets
477
+ newBuckets.forEach(bucket => {
478
+ this.block.metadata.config.bucket_titles.push({
479
+ title: bucket.title || '',
480
+ color: bucket.color || colors.blueGrey.lighten5,
481
+ expand: false
482
+ })
483
+ })
484
+
485
+ // Add new answers with adjusted bucket indices
486
+ newAnswers.forEach((bucketAnswers, index) => {
487
+ const adjustedIndex = existingBucketCount + index
488
+ if (!this.block.metadata.config.bucket_answers[adjustedIndex]) {
489
+ this.block.metadata.config.bucket_answers[adjustedIndex] = []
490
+ }
491
+ if (Array.isArray(bucketAnswers)) {
492
+ bucketAnswers.forEach(answer => {
493
+ this.block.metadata.config.bucket_answers[adjustedIndex].push({
494
+ bucket_index: adjustedIndex,
495
+ display: answer.display || '',
496
+ feedback: answer.feedback || '',
497
+ expand: false,
498
+ id: Crypto.id()
499
+ })
500
+ })
501
+ }
502
+ })
503
+ }
504
+
505
+ // Update title and instructions if provided and we're in replace mode
506
+ if (replaceMode) {
507
+ if (activityData.metadata.config.title) {
508
+ this.block.metadata.config.title = activityData.metadata.config.title
509
+ }
510
+
511
+ if (activityData.metadata.config.instructions) {
512
+ this.block.metadata.config.instructions = activityData.metadata.config.instructions
513
+ }
514
+
515
+ // Update feedback messages if provided
516
+ if (activityData.metadata.config.feedback_correct) {
517
+ this.block.metadata.config.feedback_correct = activityData.metadata.config.feedback_correct
518
+ }
519
+
520
+ if (activityData.metadata.config.feedback_incorrect) {
521
+ this.block.metadata.config.feedback_incorrect = activityData.metadata.config.feedback_incorrect
522
+ }
523
+ }
524
+
525
+ this.$toast.success(
526
+ replaceMode
527
+ ? this.$t('windward.games.components.settings.bucket_game.form.replaced_successfully')
528
+ : this.$t('windward.games.components.settings.bucket_game.form.added_successfully'),
529
+ { duration: 3000 }
530
+ )
531
+ } else {
532
+ this.$toast.error(this.$t('windward.games.components.settings.bucket_game.form.invalid_response'), {
533
+ duration: 5000
534
+ })
535
+ }
536
+ } catch (error) {
537
+ // Extract error message from the response
538
+ const errorMessage = error.message || 'Unknown error occurred'
539
+ this.$toast.error(`${this.$t('windward.games.components.settings.bucket_game.form.failed_to_process')}: ${errorMessage}`, {
540
+ duration: 5000
541
+ })
542
+ } finally {
543
+ this.loading = false
544
+ }
545
+ }
423
546
  },
424
547
  }
425
548
  </script>
@@ -1,35 +1,10 @@
1
1
  <template>
2
2
  <div>
3
3
  <v-container class="pa-0">
4
- <v-text-field
5
- ref="title"
6
- id="block-settings-title"
7
- v-model="block.metadata.config.title"
8
- :rules="$Validation.getRule('block.title')"
9
- :counter="$Validation.getLimit('block.title')"
10
- outlined
11
- :autofocus="true"
12
- :label="
13
- $t(
14
- 'windward.games.components.settings.bucket_game.form.title'
15
- )
16
- "
17
- :disabled="render"
18
- ></v-text-field>
19
- <v-textarea
20
- id="block-settings-instructions"
21
- outlined
22
- auto-grow
23
- v-model="block.metadata.config.instructions"
24
- :rules="$Validation.getRule('block.instructions')"
25
- :counter="$Validation.getLimit('block.instructions')"
26
- :label="
27
- $t(
28
- 'windward.games.components.settings.bucket_game.form.instructions'
29
- )
30
- "
4
+ <BaseContentBlockSettings
5
+ v-model="block.metadata.config"
31
6
  :disabled="render"
32
- ></v-textarea>
7
+ ></BaseContentBlockSettings>
33
8
  </v-container>
34
9
  <v-divider class="my-4 primary"></v-divider>
35
10
  <v-container class="pa-0">
@@ -128,6 +103,7 @@
128
103
 
129
104
  <script>
130
105
  import _ from 'lodash'
106
+ import BaseContentBlockSettings from '~/components/Content/Settings/BaseContentBlockSettings.vue'
131
107
  import BaseContentSettings from '~/components/Content/Settings/BaseContentSettings.js'
132
108
  import SortableExpansionPanel from '~/components/Core/SortableExpansionPanel.vue'
133
109
  import Uuid from '~/helpers/Uuid'
@@ -135,7 +111,7 @@ import Uuid from '~/helpers/Uuid'
135
111
  export default {
136
112
  name: 'CrosswordPuzzleSettingsManager',
137
113
  extends: BaseContentSettings,
138
- components: { SortableExpansionPanel },
114
+ components: { SortableExpansionPanel, BaseContentBlockSettings },
139
115
  beforeMount() {
140
116
  if (_.isEmpty(this.block)) {
141
117
  this.block = {}
@@ -151,6 +127,9 @@ export default {
151
127
  'windward.games.components.content.blocks.crossword.crossword'
152
128
  )
153
129
  }
130
+ if (!_.isBoolean(this.block.metadata.config.display_title)) {
131
+ this.$set(this.block.metadata.config, 'display_title', true)
132
+ }
154
133
  if (
155
134
  _.isEmpty(this.block.metadata.config.instructions) &&
156
135
  this.block.id &&
@@ -1,34 +1,10 @@
1
1
  <template>
2
2
  <div>
3
3
  <v-container class="pa-0">
4
- <v-text-field
5
- ref="title"
6
- id="block-settings-title"
7
- v-model="block.metadata.config.title"
8
- :rules="$Validation.getRule('block.title')"
9
- :counter="$Validation.getLimit('block.title')"
10
- outlined
11
- :label="
12
- $t(
13
- 'windward.games.components.settings.bucket_game.form.title'
14
- )
15
- "
16
- :disabled="render"
17
- ></v-text-field>
18
- <v-textarea
19
- id="block-settings-instructions"
20
- v-model="block.metadata.config.instructions"
21
- :rules="$Validation.getRule('block.instructions')"
22
- :counter="$Validation.getLimit('block.instructions')"
23
- outlined
24
- auto-grow
25
- :label="
26
- $t(
27
- 'windward.games.components.settings.bucket_game.form.instructions'
28
- )
29
- "
4
+ <BaseContentBlockSettings
5
+ v-model="block.metadata.config"
30
6
  :disabled="render"
31
- ></v-textarea>
7
+ ></BaseContentBlockSettings>
32
8
  </v-container>
33
9
  <v-divider class="my-4 primary"></v-divider>
34
10
  <v-container class="pa-0">
@@ -308,6 +284,7 @@ import ContentBlockAsset from '~/components/Content/ContentBlockAsset.vue'
308
284
  import TextEditor from '~/components/Text/TextEditor.vue'
309
285
  import SortableExpansionPanel from '~/components/Core/SortableExpansionPanel.vue'
310
286
  import Uuid from '~/helpers/Uuid'
287
+ import BaseContentBlockSettings from '~/components/Content/Settings/BaseContentBlockSettings.vue'
311
288
  import ImageAssetSettings from '~/components/Content/Settings/ImageAssetSettings.vue'
312
289
 
313
290
  export default {
@@ -320,6 +297,7 @@ export default {
320
297
  ContentBlockAsset,
321
298
  TextEditor,
322
299
  SortableExpansionPanel,
300
+ BaseContentBlockSettings,
323
301
  ImageAssetSettings,
324
302
  GenerateAIQuestionButton,
325
303
  },
@@ -345,6 +323,9 @@ export default {
345
323
  'windward.games.components.content.blocks.flashcard.title'
346
324
  )
347
325
  }
326
+ if (!_.isBoolean(this.block.metadata.config.display_title)) {
327
+ this.$set(this.block.metadata.config, 'display_title', true)
328
+ }
348
329
  if (
349
330
  _.isEmpty(this.block.metadata.config.instructions) &&
350
331
  this.block.id &&
@@ -1,35 +1,10 @@
1
1
  <template>
2
2
  <div>
3
3
  <v-container class="pa-0">
4
- <v-text-field
5
- ref="title"
6
- id="block-settings-title"
7
- v-model="block.metadata.config.title"
8
- :rules="$Validation.getRule('block.title')"
9
- :counter="$Validation.getLimit('block.title')"
10
- :autofocus="true"
11
- outlined
12
- :label="
13
- $t(
14
- 'windward.games.components.settings.matching_game.form.title'
15
- )
16
- "
4
+ <BaseContentBlockSettings
5
+ v-model="block.metadata.config"
17
6
  :disabled="render"
18
- ></v-text-field>
19
- <v-textarea
20
- id="block-settings-instructions"
21
- v-model="block.metadata.config.instructions"
22
- :rules="$Validation.getRule('block.instructions')"
23
- :counter="$Validation.getLimit('block.instructions')"
24
- outlined
25
- auto-grow
26
- :label="
27
- $t(
28
- 'windward.games.components.settings.matching_game.form.instructions'
29
- )
30
- "
31
- :disabled="render"
32
- ></v-textarea>
7
+ ></BaseContentBlockSettings>
33
8
  </v-container>
34
9
  <v-divider class="my-4 primary"></v-divider>
35
10
  <v-container class="pa-0">
@@ -279,6 +254,7 @@
279
254
  <script>
280
255
  import BaseContentSettings from '~/components/Content/Settings/BaseContentSettings.js'
281
256
  import _ from 'lodash'
257
+ import BaseContentBlockSettings from '~/components/Content/Settings/BaseContentBlockSettings.vue'
282
258
  import SortableExpansionPanel from '~/components/Core/SortableExpansionPanel.vue'
283
259
  import Uuid from '~/helpers/Uuid'
284
260
  import ImageAssetSettings from '~/components/Content/Settings/ImageAssetSettings.vue'
@@ -286,7 +262,11 @@ import ImageAssetSettings from '~/components/Content/Settings/ImageAssetSettings
286
262
  export default {
287
263
  name: 'MatchingGameManager',
288
264
  extends: BaseContentSettings,
289
- components: { SortableExpansionPanel, ImageAssetSettings },
265
+ components: {
266
+ SortableExpansionPanel,
267
+ ImageAssetSettings,
268
+ BaseContentBlockSettings,
269
+ },
290
270
  beforeMount() {
291
271
  if (_.isEmpty(this.block)) {
292
272
  this.block = {}
@@ -307,6 +287,9 @@ export default {
307
287
  'windward.games.components.settings.matching_game.form.title'
308
288
  )
309
289
  }
290
+ if (!_.isBoolean(this.block.metadata.config.display_title)) {
291
+ this.$set(this.block.metadata.config, 'display_title', true)
292
+ }
310
293
  if (
311
294
  _.isEmpty(this.block.metadata.config.instructions) &&
312
295
  this.block.id &&
@@ -1,34 +1,10 @@
1
1
  <template>
2
2
  <div>
3
3
  <v-container class="pa-0">
4
- <v-text-field
5
- id="block-settings-title"
6
- v-model="block.metadata.config.title"
7
- outlined
8
- :autofocus="true"
9
- :rules="$Validation.getRule('block.title')"
10
- :counter="$Validation.getLimit('block.title')"
11
- :label="
12
- $t(
13
- 'windward.games.components.settings.multiple_choice.title_placeholder'
14
- )
15
- "
4
+ <BaseContentBlockSettings
5
+ v-model="block.metadata.config"
16
6
  :disabled="render"
17
- ></v-text-field>
18
- <v-textarea
19
- id="block-settings-instructions"
20
- v-model="block.metadata.config.instructions"
21
- outlined
22
- :rules="$Validation.getRule('block.instructions')"
23
- :counter="$Validation.getLimit('block.instructions')"
24
- auto-grow
25
- :label="
26
- $t(
27
- 'windward.games.components.settings.multiple_choice.instructions'
28
- )
29
- "
30
- :disabled="render"
31
- ></v-textarea>
7
+ ></BaseContentBlockSettings>
32
8
  </v-container>
33
9
  <v-divider class="my-4 primary"></v-divider>
34
10
  <v-container class="pa-0">
@@ -48,8 +24,8 @@
48
24
  >
49
25
  <template #header="{ item }">
50
26
  {{
51
- item.body
52
- ? item.body
27
+ stripHtml(item.body)
28
+ ? stripHtml(item.body)
53
29
  : $t(
54
30
  'windward.games.components.settings.bucket_game.form.enter_text'
55
31
  )
@@ -92,6 +68,7 @@
92
68
  v-bind="attrs"
93
69
  v-on="on"
94
70
  v-model="block.metadata.config.questions[editingIndex]"
71
+ :block="block"
95
72
  :disabled="render"
96
73
  @saveAndNew="saveAndNewCalled"
97
74
  ></QuestionDialog>
@@ -116,12 +93,18 @@ import SortableExpansionPanel from '~/components/Core/SortableExpansionPanel.vue
116
93
  import DialogBox from '~/components/Core/DialogBox.vue'
117
94
  import QuestionDialog from '../content/blocks/multipleChoice/QuestionDialog.vue'
118
95
  import Crypto from '~/helpers/Crypto'
96
+ import BaseContentBlockSettings from '~/components/Content/Settings/BaseContentBlockSettings.vue'
119
97
  import Uuid from '~/helpers/Uuid'
120
98
 
121
99
  export default {
122
100
  name: 'MultipleChoiceSettingsManager',
123
101
  extends: BaseContentSettings,
124
- components: { SortableExpansionPanel, QuestionDialog, DialogBox },
102
+ components: {
103
+ SortableExpansionPanel,
104
+ QuestionDialog,
105
+ DialogBox,
106
+ BaseContentBlockSettings,
107
+ },
125
108
  beforeMount() {
126
109
  if (_.isEmpty(this.block)) {
127
110
  this.block = {}
@@ -137,6 +120,9 @@ export default {
137
120
  'windward.games.components.content.blocks.multiple_choice.game_title'
138
121
  )
139
122
  }
123
+ if (!_.isBoolean(this.block.metadata.config.display_title)) {
124
+ this.$set(this.block.metadata.config, 'display_title', true)
125
+ }
140
126
  if (
141
127
  _.isEmpty(this.block.metadata.config.instructions) &&
142
128
  this.block.id &&
@@ -165,6 +151,11 @@ export default {
165
151
  this.emittedQuestion = {}
166
152
  },
167
153
  methods: {
154
+ stripHtml(htmlString) {
155
+ if (htmlString) {
156
+ return htmlString.replace(/(<([^>]+)>)/gi, '')
157
+ }
158
+ },
168
159
  onOpenModal(e, questionIndex = null) {
169
160
  //checks if modal is opening to edit or create new
170
161
  if (questionIndex !== null) {
@@ -194,6 +185,14 @@ export default {
194
185
  focus: false,
195
186
  },
196
187
  ],
188
+ question_metadata: {
189
+ body_asset: null,
190
+ },
191
+ metadata: {
192
+ config: {
193
+ single_feedback: false,
194
+ },
195
+ },
197
196
  correctAnswer: firstAnswerId,
198
197
  body: '',
199
198
  hint: '',
@@ -226,6 +225,14 @@ export default {
226
225
  chosen: false,
227
226
  },
228
227
  ],
228
+ question_metadata: {
229
+ body_asset: null,
230
+ },
231
+ metadata: {
232
+ config: {
233
+ single_feedback: false,
234
+ },
235
+ },
229
236
  // needed to add this bc radio group needs the id of the answer in answerobjects array to set correct value
230
237
  correctAnswer: firstAnswerId,
231
238
  body: '',
@@ -1,18 +1,11 @@
1
1
  <template>
2
2
  <div>
3
- <v-text-field
4
- id="block-settings-title"
5
- v-model="block.metadata.config.title"
6
- :rules="$Validation.getRule('block.title')"
7
- :counter="$Validation.getLimit('block.title')"
8
- outlined
9
- :label="
10
- $t(
11
- 'windward.games.components.settings.quizshow_game.form.title'
12
- )
13
- "
14
- :disabled="render"
15
- ></v-text-field>
3
+ <v-container class="pa-0">
4
+ <BaseContentBlockSettings
5
+ v-model="block.metadata.config"
6
+ :disabled="render"
7
+ ></BaseContentBlockSettings>
8
+ </v-container>
16
9
  <br />
17
10
  <v-checkbox
18
11
  v-model="block.metadata.config.responsive"
@@ -24,21 +17,6 @@
24
17
  :disabled="render"
25
18
  ></v-checkbox>
26
19
  <br />
27
- <v-textarea
28
- id="block-settings-instructions"
29
- outlined
30
- auto-grow
31
- v-model="block.metadata.config.instructions"
32
- :rules="$Validation.getRule('block.instructions')"
33
- :counter="$Validation.getLimit('block.instructions')"
34
- :label="
35
- $t(
36
- 'windward.games.components.settings.multiple_choice.instructions'
37
- )
38
- "
39
- :disabled="render"
40
- ></v-textarea>
41
- <br />
42
20
  <v-expansion-panels outlined tile flat>
43
21
  <v-divider class="cardOutline primary"></v-divider>
44
22
  <v-expansion-panel>
@@ -221,6 +199,7 @@
221
199
  </template>
222
200
 
223
201
  <script>
202
+ import BaseContentBlockSettings from '~/components/Content/Settings/BaseContentBlockSettings.vue'
224
203
  import TextEditor from '~/components/Text/TextEditor.vue'
225
204
  import BaseContentSettings from '~/components/Content/Settings/BaseContentSettings.js'
226
205
  export default {
@@ -228,6 +207,7 @@ export default {
228
207
  extends: BaseContentSettings,
229
208
  components: {
230
209
  TextEditor,
210
+ BaseContentBlockSettings,
231
211
  },
232
212
  watch: {
233
213
  'block.metadata.config.maxCategories'(newValue, oldValue) {
@@ -290,6 +270,9 @@ export default {
290
270
  if (_.isEmpty(this.block.metadata.config)) {
291
271
  this.block.metadata.config = _.cloneDeep(this.quizShowSettings)
292
272
  }
273
+ if (!_.isBoolean(this.block.metadata.config.display_title)) {
274
+ this.$set(this.block.metadata.config, 'display_title', true)
275
+ }
293
276
  },
294
277
  methods: {
295
278
  changeMaxCategories() {