@windward/games 0.0.8 → 0.0.10

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 (88) hide show
  1. package/components/content/blocks/dragDrop/BucketGame.vue +41 -87
  2. package/components/content/blocks/dragDrop/SortingGame.vue +43 -29
  3. package/components/content/blocks/flashcards/FlashcardSlides.vue +3 -1
  4. package/components/content/blocks/matchingGame/MatchingGame.vue +94 -51
  5. package/components/content/blocks/quizshowGame/AnswerPanel.vue +93 -96
  6. package/components/content/blocks/quizshowGame/QuizShow.vue +54 -31
  7. package/components/content/blocks/slideshow/SlideShow.vue +3 -1
  8. package/components/content/blocks/wordJumble/Jumble.vue +4 -2
  9. package/components/content/blocks/wordJumble/WordJumble.vue +11 -2
  10. package/components/settings/BucketGameSettingsManager.vue +175 -349
  11. package/components/settings/FlashCardSlidesManager.vue +335 -414
  12. package/components/settings/MatchingGameManager.vue +357 -618
  13. package/components/settings/QuizShowSettingsManager.vue +228 -201
  14. package/components/settings/SlideShowManager.vue +89 -127
  15. package/components/settings/SortingGameSettingsManager.vue +32 -144
  16. package/components/settings/WordJumbleSettingsManager.vue +48 -142
  17. package/i18n/en-US/components/content/blocks/bucket_game.ts +1 -0
  18. package/i18n/en-US/components/content/blocks/flashcard.ts +2 -0
  19. package/i18n/en-US/components/content/blocks/quizshow_game.ts +1 -1
  20. package/i18n/en-US/components/settings/matching_game.ts +1 -1
  21. package/i18n/en-US/components/settings/quizshow_game.ts +8 -2
  22. package/i18n/en-US/components/settings/slideshow.ts +2 -0
  23. package/i18n/es-ES/components/content/blocks/bucket_game.ts +40 -0
  24. package/i18n/es-ES/components/content/blocks/crossword.ts +25 -0
  25. package/i18n/es-ES/components/content/blocks/flashcard.ts +7 -0
  26. package/i18n/es-ES/components/content/blocks/index.ts +23 -0
  27. package/i18n/es-ES/components/content/blocks/matching_game.ts +26 -0
  28. package/i18n/es-ES/components/content/blocks/multiple_choice.ts +9 -0
  29. package/i18n/es-ES/components/content/blocks/quizshow_game.ts +35 -0
  30. package/i18n/es-ES/components/content/blocks/seven_strikes.ts +6 -0
  31. package/i18n/es-ES/components/content/blocks/slideshow.ts +13 -0
  32. package/i18n/es-ES/components/content/blocks/sorting_game.ts +5 -0
  33. package/i18n/es-ES/components/content/blocks/word_jumble.ts +9 -0
  34. package/i18n/es-ES/components/content/crud_table.ts +6 -0
  35. package/i18n/es-ES/components/content/index.ts +7 -0
  36. package/i18n/es-ES/components/index.ts +9 -0
  37. package/i18n/es-ES/components/navigation/index.ts +5 -0
  38. package/i18n/es-ES/components/settings/bucket_game.ts +38 -0
  39. package/i18n/es-ES/components/settings/crossword.ts +7 -0
  40. package/i18n/es-ES/components/settings/flashcard.ts +28 -0
  41. package/i18n/es-ES/components/settings/index.ts +23 -0
  42. package/i18n/es-ES/components/settings/matching_game.ts +15 -0
  43. package/i18n/es-ES/components/settings/multiple_choice.ts +17 -0
  44. package/i18n/es-ES/components/settings/quizshow_game.ts +20 -0
  45. package/i18n/es-ES/components/settings/seven_strikes.ts +8 -0
  46. package/i18n/es-ES/components/settings/slideshow.ts +13 -0
  47. package/i18n/es-ES/components/settings/sorting_game.ts +5 -0
  48. package/i18n/es-ES/components/settings/word_jumble.ts +11 -0
  49. package/i18n/es-ES/index.ts +15 -0
  50. package/i18n/es-ES/modules/index.ts +5 -0
  51. package/i18n/es-ES/pages/index.ts +5 -0
  52. package/i18n/es-ES/shared/content_blocks.ts +18 -0
  53. package/i18n/es-ES/shared/index.ts +7 -0
  54. package/i18n/es-ES/shared/settings.ts +14 -0
  55. package/i18n/sv-SE/components/content/blocks/bucket_game.ts +40 -0
  56. package/i18n/sv-SE/components/content/blocks/crossword.ts +20 -0
  57. package/i18n/sv-SE/components/content/blocks/flashcard.ts +7 -0
  58. package/i18n/sv-SE/components/content/blocks/index.ts +23 -0
  59. package/i18n/sv-SE/components/content/blocks/matching_game.ts +25 -0
  60. package/i18n/sv-SE/components/content/blocks/multiple_choice.ts +9 -0
  61. package/i18n/sv-SE/components/content/blocks/quizshow_game.ts +35 -0
  62. package/i18n/sv-SE/components/content/blocks/seven_strikes.ts +6 -0
  63. package/i18n/sv-SE/components/content/blocks/slideshow.ts +13 -0
  64. package/i18n/sv-SE/components/content/blocks/sorting_game.ts +5 -0
  65. package/i18n/sv-SE/components/content/blocks/word_jumble.ts +9 -0
  66. package/i18n/sv-SE/components/content/crud_table.ts +6 -0
  67. package/i18n/sv-SE/components/content/index.ts +7 -0
  68. package/i18n/sv-SE/components/index.ts +9 -0
  69. package/i18n/sv-SE/components/navigation/index.ts +5 -0
  70. package/i18n/sv-SE/components/settings/bucket_game.ts +38 -0
  71. package/i18n/sv-SE/components/settings/crossword.ts +7 -0
  72. package/i18n/sv-SE/components/settings/flashcard.ts +28 -0
  73. package/i18n/sv-SE/components/settings/index.ts +23 -0
  74. package/i18n/sv-SE/components/settings/matching_game.ts +15 -0
  75. package/i18n/sv-SE/components/settings/multiple_choice.ts +16 -0
  76. package/i18n/sv-SE/components/settings/quizshow_game.ts +20 -0
  77. package/i18n/sv-SE/components/settings/seven_strikes.ts +8 -0
  78. package/i18n/sv-SE/components/settings/slideshow.ts +13 -0
  79. package/i18n/sv-SE/components/settings/sorting_game.ts +5 -0
  80. package/i18n/sv-SE/components/settings/word_jumble.ts +11 -0
  81. package/i18n/sv-SE/index.ts +15 -0
  82. package/i18n/sv-SE/modules/index.ts +5 -0
  83. package/i18n/sv-SE/pages/index.ts +5 -0
  84. package/i18n/sv-SE/shared/content_blocks.ts +18 -0
  85. package/i18n/sv-SE/shared/index.ts +7 -0
  86. package/i18n/sv-SE/shared/settings.ts +14 -0
  87. package/package.json +1 -1
  88. package/i18n/en-US.ts +0 -5
@@ -1,9 +1,16 @@
1
1
  <template>
2
2
  <div>
3
3
  <div>
4
- <h1 aria-label="bucket game title" tabindex="0">
4
+ <h3
5
+ :aria-label="
6
+ $t(
7
+ 'plugin.games.components.content.blocks.bucket_game.aria_title'
8
+ )
9
+ "
10
+ tabindex="0"
11
+ >
5
12
  {{ block.metadata.config.title }}
6
- </h1>
13
+ </h3>
7
14
 
8
15
  <p tabindex="0">
9
16
  {{ block.metadata.config.instructions }}
@@ -28,18 +35,21 @@
28
35
  }}</v-col>
29
36
  <v-col class="d-flex justify-end pl-4">
30
37
  <v-btn
31
- v-if="
32
- status === 'successOutline' ||
33
- status === 'errorOutline'
34
- "
38
+ v-if="status === 'successOutline'"
35
39
  class="mr-5"
36
- :color="
37
- status == 'successOutline' ? 'success' : 'error'
38
- "
40
+ color="success"
39
41
  @click="continueGame"
40
42
  >{{ $t('shared.forms.continue') }}
41
- </v-btn></v-col
42
- >
43
+ </v-btn>
44
+ <v-container
45
+ v-if="status === 'errorOutline'"
46
+ class="d-flex justify-end"
47
+ @click="continueGame"
48
+ ><v-icon class="icon--error" color="error"
49
+ >mdi-close-circle</v-icon
50
+ >
51
+ </v-container>
52
+ </v-col>
43
53
  </v-row>
44
54
  <br />
45
55
  </v-container>
@@ -54,14 +64,14 @@
54
64
  >
55
65
  <v-row align="center" class="col-md-10">
56
66
  <v-card
67
+ v-if="mainAnswer[0]"
57
68
  class="pa-2 flex-fill"
58
69
  outlined
59
70
  tile
60
- v-if="mainAnswer[0]"
61
71
  >
62
72
  <v-icon>mdi-drag-vertical</v-icon>
63
73
 
64
- <span class="text-justify">{{
74
+ <span class="text-justify span-bold">{{
65
75
  mainAnswer[counter].display
66
76
  ? mainAnswer[counter].display
67
77
  : ''
@@ -84,15 +94,18 @@
84
94
  tile
85
95
  :color="
86
96
  block.metadata.config.bucket_titles[bindex]
87
- .color
97
+ ? block.metadata.config.bucket_titles[
98
+ bindex
99
+ ].color
100
+ : ''
88
101
  "
89
102
  >
90
103
  <v-card-text class="text-center">
91
104
  <draggable
105
+ v-model="items[bindex]"
92
106
  :key="'bucket - ' + bindex"
93
107
  disabled
94
108
  group="people"
95
- v-model="items[bindex]"
96
109
  @change="change($event, bindex)"
97
110
  :move="checkMove"
98
111
  tabindex="0"
@@ -100,7 +113,11 @@
100
113
  <div class="card_text">
101
114
  {{
102
115
  block.metadata.config
103
- .bucket_titles[bindex].title
116
+ .bucket_titles[bindex]
117
+ ? block.metadata.config
118
+ .bucket_titles[bindex]
119
+ .title
120
+ : ''
104
121
  }}
105
122
  </div>
106
123
  </draggable></v-card-text
@@ -122,14 +139,14 @@
122
139
  >
123
140
  <v-row align="center" class="col-md-10">
124
141
  <v-card
125
- class="pa-2 flex-fill"
126
- outlined
127
- tile
128
142
  v-if="
129
143
  block.metadata.config.bucket_answers[
130
144
  startingIndex
131
145
  ]
132
146
  "
147
+ class="pa-2 flex-fill"
148
+ outlined
149
+ tile
133
150
  >
134
151
  <v-icon>mdi-drag-vertical</v-icon>
135
152
 
@@ -212,9 +229,9 @@
212
229
  )
213
230
  }}
214
231
  <v-progress-linear
232
+ v-model="completedPercent"
215
233
  color="primary"
216
234
  outlined
217
- v-model="completedPercent"
218
235
  rounded
219
236
  height="15"
220
237
  ></v-progress-linear>
@@ -285,28 +302,7 @@ export default {
285
302
  instructions: '',
286
303
  feedback: '',
287
304
  counter: 0,
288
- headers: [
289
- {
290
- text: 'Bucket display text',
291
- align: 'start',
292
- sortable: false,
293
- value: 'display',
294
- draggable: true,
295
- },
296
- { text: 'bucket value', value: 'value', sortable: false },
297
- { text: 'feedback', value: 'feedback', sortable: false },
298
- ],
299
- default_item: {
300
- id: 0,
301
- value: '',
302
- display_value: '',
303
- feedback: '',
304
- },
305
- bucket_titles: [],
306
- bucket_colors: [],
307
305
  items: [],
308
- dialogDelete: false,
309
- bucketDeleteIndex: 0,
310
306
  status: 'default',
311
307
  allow_drag: true,
312
308
  mainAnswer: [],
@@ -356,6 +352,8 @@ export default {
356
352
  return false
357
353
  },
358
354
  setUpGame() {
355
+ // reset so we don't carry over any empty arrays
356
+ this.items = []
359
357
  this.block.metadata.config.bucket_titles.forEach((element) => {
360
358
  let index =
361
359
  this.block.metadata.config.bucket_titles.indexOf(element)
@@ -399,32 +397,6 @@ export default {
399
397
  }
400
398
  return this.shuffle(_.flatten(result))
401
399
  },
402
- closeDelete() {
403
- this.dialogDelete = false
404
- },
405
- next() {
406
- console.log(
407
- 'index' + this.index,
408
- 'bucket length' +
409
- this.block.metadata.config.bucket_answers.length
410
- )
411
-
412
- if (
413
- this.index <
414
- this.block.metadata.config.bucket_answers.length - 1
415
- ) {
416
- this.index = this.index + 1
417
- } else {
418
- this.index = 0
419
- }
420
- },
421
- onCloneCallback(item) {
422
- // Create a fresh copy of item
423
- const cloneMe = JSON.parse(JSON.stringify(item))
424
- console.log('cloned')
425
-
426
- return cloneMe
427
- },
428
400
  onMoveCallback(evt, originalEvent) {
429
401
  const item = evt.draggedContext.element
430
402
  const itemIdx = evt.draggedContext.futureIndex
@@ -441,9 +413,6 @@ export default {
441
413
 
442
414
  return false
443
415
  },
444
- onDropCallback(evt, originalEvent) {
445
- console.log('dropped', evt)
446
- },
447
416
  change(evt, bucket_index) {
448
417
  this.allow_drag = false
449
418
  if (
@@ -500,23 +469,8 @@ export default {
500
469
  border: 4px solid var(--v-error-base);
501
470
  color: var(--v-error-base);
502
471
  }
503
- .white-bg {
504
- background-color: #ffffff;
505
- }
506
- .feedback--error {
507
- background-color: #ff8383;
508
- color: black;
509
- }
510
- .feedback--success {
511
- background-color: #8cfa54;
512
- color: black;
513
- }
514
- .body {
515
- background-color: #d8ebfe;
516
- color: black;
517
- }
518
- .title {
519
- color: #04709f;
472
+ .span-bold {
473
+ font-weight: bold;
520
474
  }
521
475
  .bucket {
522
476
  line-height: 1.1em;
@@ -1,7 +1,6 @@
1
1
  <template>
2
2
  <div>
3
3
  <h3>{{ block.metadata.config.title }}</h3>
4
-
5
4
  <p>
6
5
  {{ block.metadata.config.instructions }}
7
6
  </p>
@@ -10,36 +9,54 @@
10
9
  class="d-flex justify-space-around pa-4"
11
10
  align="center"
12
11
  justify="center"
13
- >{{ feedback }}
12
+ >
13
+ <v-col cols="2"></v-col>
14
+ <v-col cols="8" class="d-flex justify-center">{{
15
+ feedback
16
+ }}</v-col>
17
+ <v-col cols="2">
18
+ <v-row
19
+ v-if="isFail() || isSuccess()"
20
+ class="d-flex justify-end"
21
+ >
22
+ <v-btn
23
+ v-if="isSuccess()"
24
+ class="success"
25
+ elevation="0"
26
+ @click="reset"
27
+ >{{ $t('shared.forms.continue') }}
28
+ </v-btn>
29
+ <v-container
30
+ v-if="isFail()"
31
+ @click="continueGame"
32
+ class="d-flex justify-end"
33
+ ><v-icon class="icon--error"
34
+ >mdi-close-circle</v-icon
35
+ >
36
+ </v-container>
37
+ </v-row>
38
+ </v-col>
14
39
  </v-row>
15
40
  </v-container>
16
- <v-container v-if="render">
41
+ <v-container v-if="render" class="mt-2">
17
42
  <draggable
18
43
  v-model="input"
19
44
  :disabled="disabled"
20
- class="d-flex flex-column mb-6"
45
+ class="d-flex flex-column"
21
46
  group="cards"
22
47
  v-bind="dragOptions"
23
48
  @change="onDragChange"
24
49
  >
25
- <v-row
26
- class="justify-center align-center"
27
- v-for="index in input.length"
28
- :key="'bucket_' + index"
29
- >
30
- <v-col
31
- cols="1"
32
- v-if="graded"
33
- class="d-flex justify-end pa-0"
34
- >
50
+ <v-row v-for="index in input.length" :key="'bucket_' + index">
51
+ <v-col cols="1" md="1" class="d-flex justify-end pa-0">
35
52
  <v-icon v-if="success[index - 1]" class="icon--success"
36
- >mdi-check
53
+ >mdi-check-circle
37
54
  </v-icon>
38
55
  <v-icon v-if="fail[index - 1]" class="icon--error ma-0"
39
- >mdi-close</v-icon
56
+ >mdi-close-circle</v-icon
40
57
  >
41
58
  </v-col>
42
- <v-col cols="11">
59
+ <v-col cols="10">
43
60
  <v-card
44
61
  :class="
45
62
  'pa-2 flex-fill bucket ' +
@@ -54,15 +71,16 @@
54
71
  {{ input[index - 1].value }}
55
72
  </v-card>
56
73
  </v-col>
74
+ <v-col cols="1"></v-col>
57
75
  </v-row>
58
76
  </draggable>
59
- <v-container>
77
+ <v-container class="mt-3">
60
78
  <v-row
61
79
  v-if="!isFail() && !isSuccess()"
62
- class="d-flex justify-end"
80
+ class="d-flex justify-center"
63
81
  >
64
82
  <v-spacer class="col-lg-1" />
65
- <v-btn color="primary" @click="checkAnswers">
83
+ <v-btn color="primary" elevation="0" @click="checkAnswers">
66
84
  {{
67
85
  $t(
68
86
  'plugin.games.components.content.blocks.sorting_game.check_answers'
@@ -72,17 +90,16 @@
72
90
  </v-row>
73
91
  <v-row
74
92
  v-if="isFail() || isSuccess()"
75
- class="d-flex justify-end"
93
+ class="d-flex justify-center"
76
94
  >
77
95
  <v-btn
78
96
  v-if="isFail()"
79
97
  color="primary"
80
98
  outlined
81
- class=" "
82
99
  @click="continueGame"
83
100
  >{{ $t('shared.forms.continue') }} </v-btn
84
101
  >&nbsp;&nbsp;
85
- <v-btn color="primary" class="" @click="reset"
102
+ <v-btn color="primary" elevation="0" @click="reset"
86
103
  >{{ $t('shared.forms.reset') }}
87
104
  </v-btn>
88
105
  </v-row>
@@ -350,6 +367,7 @@ export default {
350
367
  border: solid 1px black;
351
368
  border-radius: 4px !important;
352
369
  cursor: pointer;
370
+ font-weight: bold;
353
371
  }
354
372
  .bucket--error {
355
373
  background-color: var(--v-error-base);
@@ -363,13 +381,9 @@ export default {
363
381
  color: white;
364
382
  }
365
383
  .icon--error {
366
- background-color: var(--v-error-base);
367
- color: white;
368
- border-radius: 25px;
384
+ color: var(--v-error-base);
369
385
  }
370
386
  .icon--success {
371
- background-color: var(--v-success-base);
372
- color: white;
373
- border-radius: 25px;
387
+ color: var(--v-success-base);
374
388
  }
375
389
  </style>
@@ -87,7 +87,9 @@ export default {
87
87
  if (_.isEmpty(this.block.metadata.config)) {
88
88
  this.block.metadata.config = {}
89
89
  this.block.metadata.config.currentSlide = 0
90
- this.block.metadata.config.title = ''
90
+ this.block.metadata.config.title = this.$t(
91
+ 'plugin.games.components.content.blocks.flashcard.title'
92
+ )
91
93
  this.block.metadata.config.instructions = ''
92
94
  }
93
95