@windward/games 0.0.10 → 0.1.1

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 (80) hide show
  1. package/components/content/CrudTable.vue +2 -2
  2. package/components/content/blocks/crosswordPuzzle/CrosswordClues.vue +4 -2
  3. package/components/content/blocks/crosswordPuzzle/CrosswordPuzzle.vue +14 -12
  4. package/components/content/blocks/dragDrop/BucketGame.vue +14 -15
  5. package/components/content/blocks/dragDrop/SortingGame.vue +4 -4
  6. package/components/content/blocks/flashcards/CardFace.vue +38 -39
  7. package/components/content/blocks/flashcards/Flashcard.vue +109 -28
  8. package/components/content/blocks/flashcards/FlashcardSlides.vue +1 -2
  9. package/components/content/blocks/matchingGame/MatchingGame.vue +15 -14
  10. package/components/content/blocks/multipleChoice/MultipleChoice.vue +186 -225
  11. package/components/content/blocks/multipleChoice/QuestionDialog.vue +7 -7
  12. package/components/content/blocks/quizshowGame/AnswerPanel.vue +9 -9
  13. package/components/content/blocks/quizshowGame/Gridview.vue +20 -24
  14. package/components/content/blocks/quizshowGame/QuizShow.vue +6 -6
  15. package/components/content/blocks/quizshowGame/feedbackIcons.vue +4 -2
  16. package/components/content/blocks/sevenStrikes/SevenStikes.vue +165 -111
  17. package/components/content/blocks/sevenStrikes/keyboard.vue +9 -2
  18. package/components/content/blocks/slideshow/SlideShow.vue +9 -5
  19. package/components/content/blocks/wordJumble/Jumble.vue +0 -2
  20. package/components/content/blocks/wordJumble/WordJumble.vue +121 -60
  21. package/components/settings/BucketGameSettingsManager.vue +20 -20
  22. package/components/settings/CrosswordPuzzleSettingsManager.vue +114 -181
  23. package/components/settings/FlashCardSlidesManager.vue +46 -63
  24. package/components/settings/MatchingGameManager.vue +19 -19
  25. package/components/settings/MultipleChoiceSettingsManager.vue +130 -140
  26. package/components/settings/QuizShowSettingsManager.vue +17 -17
  27. package/components/settings/SevenStrikesSettingsManager.vue +139 -193
  28. package/components/settings/SlideShowManager.vue +17 -9
  29. package/components/settings/SortingGameSettingsManager.vue +11 -11
  30. package/components/settings/WordJumbleSettingsManager.vue +48 -12
  31. package/i18n/en-US/components/content/blocks/flashcard.ts +1 -0
  32. package/i18n/en-US/components/content/blocks/word_jumble.ts +2 -0
  33. package/i18n/en-US/components/settings/bucket_game.ts +3 -2
  34. package/i18n/en-US/components/settings/flashcard.ts +1 -0
  35. package/i18n/en-US/components/settings/seven_strikes.ts +1 -1
  36. package/i18n/en-US/index.ts +2 -1
  37. package/i18n/es-ES/components/content/blocks/flashcard.ts +1 -0
  38. package/i18n/es-ES/components/content/blocks/word_jumble.ts +2 -0
  39. package/i18n/es-ES/components/settings/bucket_game.ts +3 -2
  40. package/i18n/es-ES/components/settings/flashcard.ts +1 -0
  41. package/i18n/es-ES/components/settings/seven_strikes.ts +2 -2
  42. package/i18n/es-ES/index.ts +2 -1
  43. package/i18n/index.ts +11 -0
  44. package/i18n/sv-SE/components/content/blocks/flashcard.ts +1 -0
  45. package/i18n/sv-SE/components/content/blocks/word_jumble.ts +2 -0
  46. package/i18n/sv-SE/components/settings/bucket_game.ts +2 -2
  47. package/i18n/sv-SE/components/settings/flashcard.ts +1 -0
  48. package/i18n/sv-SE/components/settings/seven_strikes.ts +1 -1
  49. package/i18n/sv-SE/index.ts +2 -1
  50. package/package.json +1 -1
  51. package/plugin.js +33 -34
  52. package/test/Feature/LocaleKeys.spec.js +11 -0
  53. package/test/__mocks__/componentsMock.js +12 -0
  54. package/test/__mocks__/fileMock.js +1 -0
  55. package/test/__mocks__/modelMock.js +88 -0
  56. package/test/__mocks__/styleMock.js +1 -0
  57. package/test/blocks/crossword/CrosswordPuzzle.spec.js +1 -1
  58. package/test/blocks/dragDrop/BucketGame.spec.js +1 -1
  59. package/test/blocks/dragDrop/SortingGame.spec.js +1 -1
  60. package/test/blocks/flashcards/CardFace.spec.js +1 -1
  61. package/test/blocks/flashcards/FlashCardSlides.spec.js +1 -1
  62. package/test/blocks/flashcards/Flashcard.spec.js +1 -1
  63. package/test/blocks/matchingGame/MatchingGame.spec.js +1 -1
  64. package/test/blocks/multipleChoice/MultipleChoice.spec.js +1 -1
  65. package/test/blocks/multipleChoice/QuestionDialog.spec.js +1 -1
  66. package/test/blocks/quizShow/quizShow.spec.js +1 -1
  67. package/test/blocks/sevenStrikes/sevenStrikes.spec.js +1 -1
  68. package/test/blocks/slideshow/slideshow.spec.js +1 -1
  69. package/test/blocks/wordJumble/Jumble.spec.js +1 -1
  70. package/test/blocks/wordJumble/WordJumble.spec.js +1 -1
  71. package/test/mocks.js +8 -2
  72. package/test/settings/BucketGameManager.spec.js +4 -4
  73. package/test/settings/CrosswordPuzzleManager.spec.js +6 -11
  74. package/test/settings/FlashCardSlidesManager.spec.js +1 -1
  75. package/test/settings/MatchingGameManager.spec.js +1 -1
  76. package/test/settings/MultipleChoiceGameManager.spec.js +1 -1
  77. package/test/settings/SevenStrikesManager.spec.js +1 -1
  78. package/test/settings/SlideShowManager.spec.js +1 -1
  79. package/test/settings/SortingGameManager.spec.js +1 -1
  80. package/test/settings/WordJumbleManager.spec.js +1 -4
@@ -6,7 +6,7 @@
6
6
  block.metadata.config.title
7
7
  ? block.metadata.config.title
8
8
  : $t(
9
- 'plugin.games.components.content.blocks.seven_strikes.title'
9
+ 'windward.games.components.content.blocks.seven_strikes.title'
10
10
  )
11
11
  }}
12
12
  </h3>
@@ -15,7 +15,7 @@
15
15
  <v-col class="pa-0">
16
16
  <template>
17
17
  <v-carousel
18
- v-model="carouselIndex"
18
+ v-model="block.metadata.config.currentWord"
19
19
  @change="onSlideChanged($event)"
20
20
  >
21
21
  <v-carousel-item
@@ -23,107 +23,139 @@
23
23
  :key="index"
24
24
  >
25
25
  <v-row class="d-flex justify-center ma-2">
26
- <p class="pa-3 mb-0 clueAndJumble">
26
+ <p class="pa-3 mb-0 p-clue-jumble">
27
27
  {{ word.hint }}
28
28
  </p>
29
29
  </v-row>
30
30
  <v-container
31
31
  v-if="showFeedback"
32
+ fluid
32
33
  :key="'feedback'"
33
34
  :class="feedbackStatus"
34
- class="mb-8"
35
35
  >
36
- <v-row class="d-flex" align="center">
37
- <v-col cols="4"></v-col>
38
- <v-col cols="4" class="d-flex justify-center">
39
- <p class="">{{ feedback }}</p>
40
- </v-col>
41
- <v-col cols="4" class="d-flex justify-end">
42
- <v-icon @click="onHideFeedback">
43
- mdi-alpha-x-circle-outline</v-icon
44
- >
36
+ <v-row class="pa-4">
37
+ <v-col></v-col>
38
+ <v-col
39
+ class="d-flex justify-center align-center"
40
+ >{{
41
+ feedback
42
+ ? feedback
43
+ : $t(
44
+ 'windward.games.components.content.blocks.bucket_game.form.feedback.feedback_here'
45
+ )
46
+ }}</v-col
47
+ >
48
+ <v-col class="d-flex justify-end pl-4">
49
+ <v-btn
50
+ v-if="
51
+ feedbackStatus === 'successOutline'
52
+ "
53
+ class="mr-5"
54
+ color="success"
55
+ @click="onChangeSlide(index + 1)"
56
+ >{{ $t('shared.forms.continue') }}
57
+ </v-btn>
58
+ <v-container
59
+ v-if="feedbackStatus === 'errorOutline'"
60
+ class="d-flex justify-end"
61
+ @click="onHideFeedback"
62
+ ><v-icon
63
+ class="icon--error"
64
+ color="error"
65
+ >mdi-close-circle</v-icon
66
+ >
67
+ </v-container>
45
68
  </v-col>
46
69
  </v-row>
47
70
  </v-container>
48
- <v-row class="justify-center">
49
- <div
50
- v-for="(
51
- strike, strikeIndex
52
- ) in sevenStrikesCounter"
53
- :key="strikeIndex"
71
+ <v-container>
72
+ <v-row
73
+ class="justify-center mt-2"
74
+ v-if="word.splitWord"
54
75
  >
55
76
  <div
56
- v-if="strike.strike === false"
57
- :ref="'strike' + strikeIndex"
58
- class="strikeArea ml-1 mr-1 d-flex justify-center align-center"
59
- maxlength="1"
60
- ></div>
61
- <div
62
- class="strike"
63
- v-if="strike.strike === true"
77
+ v-for="(
78
+ letter, splitIndex
79
+ ) in word.splitWord"
80
+ :key="splitIndex"
64
81
  >
65
- X
82
+ <div
83
+ :ref="'input' + splitIndex"
84
+ class="container-text-area ml-1 mr-1"
85
+ maxlength="1"
86
+ >
87
+ <div v-if="letter.show === true">
88
+ {{ letter.letter }}
89
+ </div>
90
+ </div>
66
91
  </div>
67
- </div>
68
- </v-row>
69
- <v-row
70
- class="justify-center mt-12"
71
- v-if="word.splitWord"
72
- >
73
- <div
74
- v-for="(letter, splitIndex) in word.splitWord"
75
- :key="splitIndex"
76
- >
92
+ </v-row>
93
+ <v-row class="justify-center mt-8">
77
94
  <div
78
- :ref="'input' + splitIndex"
79
- class="textArea ml-1 mr-1"
80
- maxlength="1"
95
+ v-for="(
96
+ strike, strikeIndex
97
+ ) in sevenStrikesCounter"
98
+ :key="strikeIndex"
81
99
  >
82
- <div v-if="letter.show === true">
83
- {{ letter.letter }}
100
+ <div
101
+ v-if="strike.strike === false"
102
+ :ref="'strike' + strikeIndex"
103
+ class="container-strike-area d-flex justify-center align-center"
104
+ maxlength="1"
105
+ >
106
+ X
107
+ </div>
108
+ <div
109
+ class="container-strike"
110
+ v-if="strike.strike === true"
111
+ >
112
+ X
84
113
  </div>
85
114
  </div>
115
+ </v-row>
116
+ <div>
117
+ <keyboard
118
+ v-if="!showFeedback"
119
+ :key="index"
120
+ :keyboardClass="keyBoardClass + index"
121
+ @onChange="onChange"
122
+ @onKeyPress="onKeyPress"
123
+ :input="input"
124
+ />
86
125
  </div>
87
- </v-row>
88
- <div>
89
- <keyboard
90
- v-if="!showFeedback"
91
- :key="index"
92
- :keyboardClass="keyBoardClass + index"
93
- @onChange="onChange"
94
- @onKeyPress="onKeyPress"
95
- :input="input"
96
- />
97
- </div>
98
- <v-row class="justify-center mt-12" v-if="showFeedback">
99
- <v-btn
100
- color="primary ml-4"
101
- @click="onRevealAnswer"
102
- >{{
103
- $t(
104
- 'plugin.games.components.content.blocks.seven_strikes.reveal'
105
- )
106
- }}</v-btn
107
- >
108
- <v-btn
109
- color="primary ml-4"
110
- @click="onSlideChanged(index)"
111
- >{{
112
- $t(
113
- 'plugin.games.components.content.blocks.seven_strikes.again'
114
- )
115
- }}</v-btn
116
- >
117
- <v-btn
118
- @click="onChangeSlide(index + 1)"
119
- color="primary ml-4"
120
- >{{
121
- $t(
122
- 'plugin.games.components.content.blocks.seven_strikes.next'
123
- )
124
- }}</v-btn
126
+ <v-row
127
+ class="justify-center mt-12"
128
+ v-if="showFeedback"
125
129
  >
126
- </v-row>
130
+ <v-btn
131
+ color="primary ml-4"
132
+ @click="onRevealAnswer"
133
+ >{{
134
+ $t(
135
+ 'windward.games.components.content.blocks.seven_strikes.reveal'
136
+ )
137
+ }}</v-btn
138
+ >
139
+ <v-btn
140
+ color="primary ml-4"
141
+ @click="onSlideChanged(index)"
142
+ >{{
143
+ $t(
144
+ 'windward.games.components.content.blocks.seven_strikes.again'
145
+ )
146
+ }}</v-btn
147
+ >
148
+ <v-btn
149
+ @click="onChangeSlide(index + 1)"
150
+ color="primary ml-4"
151
+ >{{
152
+ $t(
153
+ 'windward.games.components.content.blocks.seven_strikes.next'
154
+ )
155
+ }}</v-btn
156
+ >
157
+ </v-row>
158
+ </v-container>
127
159
  </v-carousel-item>
128
160
  </v-carousel>
129
161
  </template>
@@ -152,6 +184,29 @@ export default {
152
184
  if (_.isEmpty(this.block.metadata.config)) {
153
185
  this.block.metadata.config = {}
154
186
  }
187
+ if (_.isEmpty(this.block.metadata.config.currentWord)) {
188
+ this.block.metadata.config.currentWord = 0
189
+ }
190
+ if (_.isEmpty(this.block.metadata.config.title)) {
191
+ this.block.metadata.config.title = this.$t(
192
+ 'windward.games.components.settings.seven_strikes.title'
193
+ )
194
+ }
195
+ if (_.isEmpty(this.block.metadata.config.instructions)) {
196
+ this.block.metadata.config.instructions = this.$t(
197
+ 'windward.games.components.settings.seven_strikes.instructions'
198
+ )
199
+ }
200
+ if (_.isEmpty(this.block.metadata.config.feedback_correct)) {
201
+ this.block.metadata.config.feedback_correct = this.$t(
202
+ 'windward.games.components.settings.bucket_game.form.feedback.correct_default'
203
+ )
204
+ }
205
+ if (_.isEmpty(this.block.metadata.config.feedback_correct)) {
206
+ this.block.metadata.config.feedback_incorrect = this.$t(
207
+ 'windward.games.components.settings.bucket_game.form.feedback.incorrect_default'
208
+ )
209
+ }
155
210
  if (_.isEmpty(this.block.metadata.config.words)) {
156
211
  this.block.metadata.config.words = []
157
212
  }
@@ -174,16 +229,22 @@ export default {
174
229
  keyBoardClass: 'simple-keyboard',
175
230
  onSlide: 0,
176
231
  onStrike: 0,
177
- carouselIndex: 0,
178
232
  }
179
233
  },
234
+ watch: {
235
+ render(newValue) {
236
+ if (newValue) {
237
+ this.block.metadata.config.currentWord = 0
238
+ }
239
+ },
240
+ },
180
241
  mounted() {},
181
242
  methods: {
182
243
  onChangeSlide(newIndex) {
183
244
  if (newIndex >= this.block.metadata.config.words.length) {
184
245
  newIndex = 0
185
246
  }
186
- this.carouselIndex = newIndex
247
+ this.block.metadata.config.currentWord = newIndex
187
248
  this.onSlideChanged(newIndex)
188
249
  },
189
250
  onChange(input) {
@@ -250,7 +311,7 @@ export default {
250
311
  thatIsIncorrect() {
251
312
  this.showFeedback = true
252
313
  // updates class
253
- this.feedbackStatus = 'error'
314
+ this.feedbackStatus = 'errorOutline'
254
315
  // gets custom or standard feedback
255
316
  if (
256
317
  !_.isEmpty(this.block.metadata.config.feedback_incorrect) &&
@@ -259,13 +320,13 @@ export default {
259
320
  this.feedback = this.block.metadata.config.feedback_incorrect
260
321
  } else {
261
322
  this.feedback = this.$t(
262
- 'plugin.games.components.content.blocks.word_jumble.incorrect'
323
+ 'windward.games.components.content.blocks.word_jumble.incorrect'
263
324
  )
264
325
  }
265
326
  },
266
327
  thatIsCorrect() {
267
328
  this.showFeedback = true
268
- this.feedbackStatus = 'success'
329
+ this.feedbackStatus = 'successOutline'
269
330
  if (
270
331
  !_.isEmpty(this.block.metadata.config.feedback_correct) &&
271
332
  this.block.metadata.config.feedback_correct !== ''
@@ -273,7 +334,7 @@ export default {
273
334
  this.feedback = this.block.metadata.config.feedback_correct
274
335
  } else {
275
336
  this.feedback = this.$t(
276
- 'plugin.games.components.content.blocks.word_jumble.correct'
337
+ 'windward.games.components.content.blocks.word_jumble.correct'
277
338
  )
278
339
  }
279
340
  },
@@ -296,7 +357,7 @@ export default {
296
357
  this.feedbackStatus = ''
297
358
  this.onStrike = 0
298
359
  this.feedback = this.$t(
299
- 'plugin.games.components.content.blocks.word_jumble.feedback'
360
+ 'windward.games.components.content.blocks.word_jumble.feedback'
300
361
  )
301
362
  // resets strikes
302
363
  this.sevenStrikesCounter.forEach((element) => {
@@ -329,39 +390,32 @@ export default {
329
390
  </script>
330
391
 
331
392
  <style scoped>
332
- .outline {
333
- border: 2px solid black;
334
- border-radius: 10px;
335
- }
336
- .clueAndJumble {
393
+ .p-clue-jumble {
337
394
  font-size: 20px;
338
395
  }
339
- .spanBold {
340
- font-weight: 900;
341
- }
342
- .error {
343
- border: dashed 2px #dc3d1a;
344
- background-color: #fff1f1;
396
+ .errorOutline {
397
+ border: 4px solid var(--v-error-base);
398
+ color: var(--v-error-base);
345
399
  }
346
- .success {
347
- border: dashed 2px #76b778;
348
- background-color: #f1fff3;
400
+ .successOutline {
401
+ border: 4px solid var(--v-success-base);
402
+ color: var(--v-success-base);
349
403
  }
350
- .textArea {
404
+ .container-text-area {
351
405
  width: 20px;
352
406
  height: 20px;
353
- border-bottom: 2px solid black;
407
+ border-bottom: 2px solid var(--v-primary-base);
354
408
  display: flex;
355
409
  justify-content: center;
356
410
  align-items: center;
357
411
  }
358
- .strikeArea {
359
- width: 40px;
360
- height: 40px;
361
- border: 2px solid black;
412
+ .container-strike-area {
413
+ color: gray;
414
+ font-size: 40px;
415
+ margin: 10px;
362
416
  }
363
- .strike {
364
- color: #dc3d1a;
417
+ .container-strike {
418
+ color: var(--v-error-base);
365
419
  font-size: 40px;
366
420
  margin: 10px;
367
421
  }
@@ -29,6 +29,13 @@ export default {
29
29
  'z x c v b n m',
30
30
  ],
31
31
  },
32
+ buttonTheme: [
33
+ {
34
+ class: 'primary',
35
+ buttons:
36
+ 'q w e r t y u i o p a s d f g h j k l z x c v b n m',
37
+ },
38
+ ],
32
39
  onChange: this.onChange,
33
40
  onKeyPress: this.onKeyPress,
34
41
  })
@@ -65,7 +72,7 @@ export default {
65
72
  <!-- Add "scoped" attribute to limit CSS to this component only -->
66
73
  <style scoped>
67
74
  .hg-theme-default {
68
- padding: 55px;
69
- margin-top: 25px;
75
+ padding: 25px 55px;
76
+ background-color: transparent !important;
70
77
  }
71
78
  </style>
@@ -4,7 +4,7 @@
4
4
  <h3
5
5
  :aria-label="
6
6
  $t(
7
- 'plugin.games.components.content.blocks.slideshow.slideshow_title'
7
+ 'windward.games.components.content.blocks.slideshow.slideshow_title'
8
8
  )
9
9
  "
10
10
  tabindex="0"
@@ -18,14 +18,14 @@
18
18
  <p tabindex="0">
19
19
  {{
20
20
  $t(
21
- 'plugin.games.components.content.blocks.slideshow.basic_instructions'
21
+ 'windward.games.components.content.blocks.slideshow.basic_instructions'
22
22
  )
23
23
  }}
24
24
  </p>
25
25
  </div>
26
26
  <div>
27
27
  <template v-if="block.metadata.config.slides.length !== 0">
28
- <v-carousel v-model="model">
28
+ <v-carousel v-model="block.metadata.config.currentSlide">
29
29
  <template #prev="{ on, attrs }">
30
30
  <v-btn
31
31
  variant="elevated"
@@ -104,7 +104,7 @@ export default {
104
104
  }
105
105
  if (_.isEmpty(this.block.metadata.config.title)) {
106
106
  this.block.metadata.config.title = this.$t(
107
- 'plugin.games.components.settings.slideshow.form.slideshow_title'
107
+ 'windward.games.components.settings.slideshow.form.slideshow_title'
108
108
  )
109
109
  }
110
110
 
@@ -120,7 +120,11 @@ export default {
120
120
  return {
121
121
  next: {},
122
122
  prev: {},
123
- model: null,
123
+ }
124
+ },
125
+ watch: {
126
+ render(newValue) {
127
+ this.block.metadata.config.currentSlide = 0
124
128
  }
125
129
  },
126
130
  methods: {},
@@ -76,8 +76,6 @@ export default {
76
76
  // handles focusing on next element after student enters a letter
77
77
  if (!_.isEmpty(event) && this.$refs['input' + (index + 1)]) {
78
78
  this.$refs['input' + (index + 1)][0].focus()
79
- } else if (index !== 0 && _.isEmpty(event)) {
80
- this.$refs['input' + (index - 1)][0].focus()
81
79
  }
82
80
  this.$emit('input', this.letterArray)
83
81
  },