@windward/games 0.0.9 → 0.1.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 (137) 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 +54 -101
  5. package/components/content/blocks/dragDrop/SortingGame.vue +47 -33
  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 +3 -2
  9. package/components/content/blocks/matchingGame/MatchingGame.vue +105 -61
  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 +31 -24
  13. package/components/content/blocks/quizshowGame/Gridview.vue +20 -24
  14. package/components/content/blocks/quizshowGame/QuizShow.vue +22 -9
  15. package/components/content/blocks/quizshowGame/feedbackIcons.vue +4 -2
  16. package/components/content/blocks/sevenStrikes/SevenStikes.vue +153 -108
  17. package/components/content/blocks/sevenStrikes/keyboard.vue +9 -2
  18. package/components/content/blocks/slideshow/SlideShow.vue +5 -3
  19. package/components/content/blocks/wordJumble/Jumble.vue +4 -4
  20. package/components/content/blocks/wordJumble/WordJumble.vue +128 -62
  21. package/components/settings/BucketGameSettingsManager.vue +185 -359
  22. package/components/settings/CrosswordPuzzleSettingsManager.vue +114 -181
  23. package/components/settings/FlashCardSlidesManager.vue +323 -419
  24. package/components/settings/MatchingGameManager.vue +357 -618
  25. package/components/settings/MultipleChoiceSettingsManager.vue +130 -140
  26. package/components/settings/QuizShowSettingsManager.vue +17 -17
  27. package/components/settings/SevenStrikesSettingsManager.vue +131 -193
  28. package/components/settings/SlideShowManager.vue +91 -129
  29. package/components/settings/SortingGameSettingsManager.vue +41 -153
  30. package/components/settings/WordJumbleSettingsManager.vue +84 -150
  31. package/i18n/en-US/components/content/blocks/bucket_game.ts +1 -0
  32. package/i18n/en-US/components/content/blocks/flashcard.ts +3 -0
  33. package/i18n/en-US/components/content/blocks/word_jumble.ts +2 -0
  34. package/i18n/en-US/components/settings/bucket_game.ts +3 -2
  35. package/i18n/en-US/components/settings/flashcard.ts +1 -0
  36. package/i18n/en-US/components/settings/matching_game.ts +1 -1
  37. package/i18n/en-US/components/settings/quizshow_game.ts +1 -1
  38. package/i18n/en-US/components/settings/seven_strikes.ts +1 -1
  39. package/i18n/en-US/components/settings/slideshow.ts +2 -0
  40. package/i18n/en-US/index.ts +2 -1
  41. package/i18n/es-ES/components/content/blocks/bucket_game.ts +40 -0
  42. package/i18n/es-ES/components/content/blocks/crossword.ts +25 -0
  43. package/i18n/es-ES/components/content/blocks/flashcard.ts +8 -0
  44. package/i18n/es-ES/components/content/blocks/index.ts +23 -0
  45. package/i18n/es-ES/components/content/blocks/matching_game.ts +26 -0
  46. package/i18n/es-ES/components/content/blocks/multiple_choice.ts +9 -0
  47. package/i18n/es-ES/components/content/blocks/quizshow_game.ts +35 -0
  48. package/i18n/es-ES/components/content/blocks/seven_strikes.ts +6 -0
  49. package/i18n/es-ES/components/content/blocks/slideshow.ts +13 -0
  50. package/i18n/es-ES/components/content/blocks/sorting_game.ts +5 -0
  51. package/i18n/es-ES/components/content/blocks/word_jumble.ts +11 -0
  52. package/i18n/es-ES/components/content/crud_table.ts +6 -0
  53. package/i18n/es-ES/components/content/index.ts +7 -0
  54. package/i18n/es-ES/components/index.ts +9 -0
  55. package/i18n/es-ES/components/navigation/index.ts +5 -0
  56. package/i18n/es-ES/components/settings/bucket_game.ts +39 -0
  57. package/i18n/es-ES/components/settings/crossword.ts +7 -0
  58. package/i18n/es-ES/components/settings/flashcard.ts +29 -0
  59. package/i18n/es-ES/components/settings/index.ts +23 -0
  60. package/i18n/es-ES/components/settings/matching_game.ts +15 -0
  61. package/i18n/es-ES/components/settings/multiple_choice.ts +17 -0
  62. package/i18n/es-ES/components/settings/quizshow_game.ts +20 -0
  63. package/i18n/es-ES/components/settings/seven_strikes.ts +8 -0
  64. package/i18n/es-ES/components/settings/slideshow.ts +13 -0
  65. package/i18n/es-ES/components/settings/sorting_game.ts +5 -0
  66. package/i18n/es-ES/components/settings/word_jumble.ts +11 -0
  67. package/i18n/es-ES/index.ts +16 -0
  68. package/i18n/es-ES/modules/index.ts +5 -0
  69. package/i18n/es-ES/pages/index.ts +5 -0
  70. package/i18n/es-ES/shared/content_blocks.ts +18 -0
  71. package/i18n/es-ES/shared/index.ts +7 -0
  72. package/i18n/es-ES/shared/settings.ts +14 -0
  73. package/i18n/index.ts +11 -0
  74. package/i18n/sv-SE/components/content/blocks/bucket_game.ts +40 -0
  75. package/i18n/sv-SE/components/content/blocks/crossword.ts +20 -0
  76. package/i18n/sv-SE/components/content/blocks/flashcard.ts +8 -0
  77. package/i18n/sv-SE/components/content/blocks/index.ts +23 -0
  78. package/i18n/sv-SE/components/content/blocks/matching_game.ts +25 -0
  79. package/i18n/sv-SE/components/content/blocks/multiple_choice.ts +9 -0
  80. package/i18n/sv-SE/components/content/blocks/quizshow_game.ts +35 -0
  81. package/i18n/sv-SE/components/content/blocks/seven_strikes.ts +6 -0
  82. package/i18n/sv-SE/components/content/blocks/slideshow.ts +13 -0
  83. package/i18n/sv-SE/components/content/blocks/sorting_game.ts +5 -0
  84. package/i18n/sv-SE/components/content/blocks/word_jumble.ts +11 -0
  85. package/i18n/sv-SE/components/content/crud_table.ts +6 -0
  86. package/i18n/sv-SE/components/content/index.ts +7 -0
  87. package/i18n/sv-SE/components/index.ts +9 -0
  88. package/i18n/sv-SE/components/navigation/index.ts +5 -0
  89. package/i18n/sv-SE/components/settings/bucket_game.ts +38 -0
  90. package/i18n/sv-SE/components/settings/crossword.ts +7 -0
  91. package/i18n/sv-SE/components/settings/flashcard.ts +29 -0
  92. package/i18n/sv-SE/components/settings/index.ts +23 -0
  93. package/i18n/sv-SE/components/settings/matching_game.ts +15 -0
  94. package/i18n/sv-SE/components/settings/multiple_choice.ts +16 -0
  95. package/i18n/sv-SE/components/settings/quizshow_game.ts +20 -0
  96. package/i18n/sv-SE/components/settings/seven_strikes.ts +8 -0
  97. package/i18n/sv-SE/components/settings/slideshow.ts +13 -0
  98. package/i18n/sv-SE/components/settings/sorting_game.ts +5 -0
  99. package/i18n/sv-SE/components/settings/word_jumble.ts +11 -0
  100. package/i18n/sv-SE/index.ts +16 -0
  101. package/i18n/sv-SE/modules/index.ts +5 -0
  102. package/i18n/sv-SE/pages/index.ts +5 -0
  103. package/i18n/sv-SE/shared/content_blocks.ts +18 -0
  104. package/i18n/sv-SE/shared/index.ts +7 -0
  105. package/i18n/sv-SE/shared/settings.ts +14 -0
  106. package/package.json +1 -1
  107. package/plugin.js +33 -34
  108. package/test/Feature/LocaleKeys.spec.js +11 -0
  109. package/test/__mocks__/componentsMock.js +12 -0
  110. package/test/__mocks__/fileMock.js +1 -0
  111. package/test/__mocks__/modelMock.js +88 -0
  112. package/test/__mocks__/styleMock.js +1 -0
  113. package/test/blocks/crossword/CrosswordPuzzle.spec.js +1 -1
  114. package/test/blocks/dragDrop/BucketGame.spec.js +1 -1
  115. package/test/blocks/dragDrop/SortingGame.spec.js +1 -1
  116. package/test/blocks/flashcards/CardFace.spec.js +1 -1
  117. package/test/blocks/flashcards/FlashCardSlides.spec.js +1 -1
  118. package/test/blocks/flashcards/Flashcard.spec.js +1 -1
  119. package/test/blocks/matchingGame/MatchingGame.spec.js +1 -1
  120. package/test/blocks/multipleChoice/MultipleChoice.spec.js +1 -1
  121. package/test/blocks/multipleChoice/QuestionDialog.spec.js +1 -1
  122. package/test/blocks/quizShow/quizShow.spec.js +1 -1
  123. package/test/blocks/sevenStrikes/sevenStrikes.spec.js +1 -1
  124. package/test/blocks/slideshow/slideshow.spec.js +1 -1
  125. package/test/blocks/wordJumble/Jumble.spec.js +1 -1
  126. package/test/blocks/wordJumble/WordJumble.spec.js +1 -1
  127. package/test/mocks.js +8 -2
  128. package/test/settings/BucketGameManager.spec.js +4 -4
  129. package/test/settings/CrosswordPuzzleManager.spec.js +6 -11
  130. package/test/settings/FlashCardSlidesManager.spec.js +1 -1
  131. package/test/settings/MatchingGameManager.spec.js +1 -1
  132. package/test/settings/MultipleChoiceGameManager.spec.js +1 -1
  133. package/test/settings/SevenStrikesManager.spec.js +1 -1
  134. package/test/settings/SlideShowManager.spec.js +1 -1
  135. package/test/settings/SortingGameManager.spec.js +1 -1
  136. package/test/settings/WordJumbleManager.spec.js +1 -4
  137. package/i18n/en-US.ts +0 -5
@@ -9,7 +9,7 @@
9
9
  :counter="50"
10
10
  :label="
11
11
  $t(
12
- 'plugin.games.components.settings.bucket_game.form.title'
12
+ 'windward.games.components.settings.bucket_game.form.title'
13
13
  )
14
14
  "
15
15
  ref="title"
@@ -21,7 +21,7 @@
21
21
  :counter="255"
22
22
  :label="
23
23
  $t(
24
- 'plugin.games.components.settings.bucket_game.form.instructions'
24
+ 'windward.games.components.settings.bucket_game.form.instructions'
25
25
  )
26
26
  "
27
27
  ></v-textarea>
@@ -31,81 +31,42 @@
31
31
  <p>
32
32
  {{
33
33
  $t(
34
- 'plugin.games.components.settings.sorting_game.sortable_items'
34
+ 'windward.games.components.settings.sorting_game.sortable_items'
35
35
  )
36
36
  }}
37
37
  </p>
38
- <draggable
38
+ <SortableExpansionPanel
39
39
  v-model="block.metadata.config.answer"
40
- group="cards"
41
- @change="onDragged"
40
+ @click:close="onDelete($event)"
42
41
  >
43
- <v-container
44
- v-for="(item, index) in block.metadata.config.answer"
45
- :key="'bucket_' + index"
46
- class="container-card-outline"
47
- elevation="0"
48
- outlined
49
- tile
50
- >
51
- <v-layout row wrap outlined>
52
- <v-flex xs10 :class="bottomBorder(index)">
53
- <p
54
- class="text-truncate mb-0 p-header"
55
- @click="onOpenEditor(index)"
56
- v-on:keyup.enter="onOpenEditor(index)"
57
- @mouseover="onHover"
58
- @mouseleave="onHoverLeave"
59
- :class="cursor"
60
- tabindex="0"
61
- >
62
- <v-icon>mdi-drag-vertical</v-icon>
63
- <span class="span-text-ellipsis">
64
- {{
65
- item.value
66
- ? block.metadata.config.answer[
67
- index
68
- ].value
69
- : $t(
70
- 'plugin.games.components.settings.bucket_game.form.enter_text'
71
- )
72
- }}
73
- </span>
74
- </p>
75
- </v-flex>
76
- <v-flex
77
- xs2
78
- class="btn-header-delete d-flex justify-center"
79
- :class="bottomBorder(index)"
80
- >
81
- <v-icon
82
- class="btn-delete-icon"
83
- @click="onDelete(index)"
84
- >mdi-delete-outline</v-icon
85
- >
86
- </v-flex>
87
- <v-container v-if="item.expand">
88
- <v-flex xs12>
89
- <p class="p-label">
90
- {{
91
- $t(
92
- 'plugin.games.components.settings.sorting_game.word'
93
- )
94
- }}
95
- </p>
96
- <v-textarea
97
- outlined
98
- v-model="
99
- block.metadata.config.answer[index]
100
- .value
101
- "
102
- :autofocus="true"
103
- ></v-textarea>
104
- </v-flex>
105
- </v-container>
106
- </v-layout>
107
- </v-container>
108
- </draggable>
42
+ <template #header="{ item, index }">
43
+ {{
44
+ item.value
45
+ ? block.metadata.config.answer[index].value
46
+ : $t(
47
+ 'windward.games.components.settings.bucket_game.form.enter_text'
48
+ )
49
+ }}
50
+ </template>
51
+ <template #body="{ item, index }">
52
+ <v-container>
53
+ <p class="p-label">
54
+ {{
55
+ $t(
56
+ 'windward.games.components.settings.sorting_game.word'
57
+ )
58
+ }}
59
+ </p>
60
+ <v-textarea
61
+ outlined
62
+ v-model="
63
+ block.metadata.config.answer[index].value
64
+ "
65
+ :autofocus="true"
66
+ ></v-textarea>
67
+ </v-container>
68
+ </template>
69
+ </SortableExpansionPanel>
109
70
  </v-container>
110
71
  <v-container class="pa-0">
111
72
  <v-row justify="center" class="my-4">
@@ -113,7 +74,7 @@
113
74
  <v-icon>mdi-plus</v-icon>
114
75
  {{
115
76
  $t(
116
- 'plugin.games.components.settings.bucket_game.form.add_answer'
77
+ 'windward.games.components.settings.bucket_game.form.add_answer'
117
78
  )
118
79
  }}
119
80
  </v-btn>
@@ -125,7 +86,7 @@
125
86
  :counter="255"
126
87
  :label="
127
88
  $t(
128
- 'plugin.games.components.settings.bucket_game.form.feedback.correct'
89
+ 'windward.games.components.settings.bucket_game.form.feedback.correct'
129
90
  )
130
91
  "
131
92
  ></v-textarea>
@@ -136,7 +97,7 @@
136
97
  :counter="255"
137
98
  :label="
138
99
  $t(
139
- 'plugin.games.components.settings.bucket_game.form.feedback.incorrect'
100
+ 'windward.games.components.settings.bucket_game.form.feedback.incorrect'
140
101
  )
141
102
  "
142
103
  ></v-textarea>
@@ -155,13 +116,12 @@
155
116
 
156
117
  <script>
157
118
  import _ from 'lodash'
158
- import draggable from 'vuedraggable'
159
119
  import BaseContentSettings from '~/components/Content/Tool/BaseContentSettings.js'
160
- import CrudTable from '../content/CrudTable.vue'
120
+ import SortableExpansionPanel from '~/components/SortableExpansionPanel.vue'
161
121
  export default {
162
122
  name: 'SortingGameSettingsManager',
163
123
  extends: BaseContentSettings,
164
- components: { CrudTable, draggable },
124
+ components: { SortableExpansionPanel },
165
125
  beforeMount() {
166
126
  if (_.isEmpty(this.block)) {
167
127
  this.block = {}
@@ -174,17 +134,17 @@ export default {
174
134
  }
175
135
  if (_.isEmpty(this.block.metadata.config.title)) {
176
136
  this.block.metadata.config.title = this.$t(
177
- 'plugin.games.components.settings.sorting_game.sortable_game'
137
+ 'windward.games.components.settings.sorting_game.sortable_game'
178
138
  )
179
139
  }
180
140
  if (_.isEmpty(this.block.metadata.config.feedback_correct)) {
181
141
  this.block.metadata.config.feedback_correct = this.$t(
182
- 'plugin.games.components.settings.bucket_game.form.feedback.correct_default'
142
+ 'windward.games.components.settings.bucket_game.form.feedback.correct_default'
183
143
  )
184
144
  }
185
145
  if (_.isEmpty(this.block.metadata.config.feedback_incorrect)) {
186
146
  this.block.metadata.config.feedback_incorrect = this.$t(
187
- 'plugin.games.components.settings.bucket_game.form.feedback.incorrect_default'
147
+ 'windward.games.components.settings.bucket_game.form.feedback.incorrect_default'
188
148
  )
189
149
  }
190
150
  if (_.isEmpty(this.block.metadata.config.answer)) {
@@ -214,13 +174,6 @@ export default {
214
174
  }
215
175
  },
216
176
  methods: {
217
- bottomBorder(index) {
218
- if (this.block.metadata.config.answer[index].expand === true) {
219
- return 'container-header-border'
220
- } else {
221
- return null
222
- }
223
- },
224
177
  onAddElement() {
225
178
  this.block.metadata.config.answer.forEach((element) => {
226
179
  element.expand = false
@@ -240,28 +193,6 @@ export default {
240
193
  return (element.id = startingIndex)
241
194
  })
242
195
  },
243
- onOpenEditor(index) {
244
- this.block.metadata.config.answer[index].expand =
245
- !this.block.metadata.config.answer[index].expand
246
- this.block.metadata.config.answer.forEach((element) => {
247
- if (index + 1 !== element.id) {
248
- element.expand = false
249
- }
250
- })
251
- },
252
- onHover(index) {
253
- this.cursor = 'change-pointer'
254
- },
255
- onHoverLeave() {
256
- this.cursor = ''
257
- },
258
- onDragged() {
259
- let counter = 1
260
- this.block.metadata.config.answer.forEach((element) => {
261
- element.id = counter
262
- counter = counter + 1
263
- })
264
- },
265
196
  },
266
197
  }
267
198
  </script>
@@ -270,49 +201,6 @@ export default {
270
201
  .v-progress-circular {
271
202
  margin: 1rem;
272
203
  }
273
- .container-card-outline {
274
- border: solid 1px var(--v-primary-base);
275
- border-radius: 3px !important;
276
- margin-bottom: 8px;
277
- }
278
- .container-header-border {
279
- border-bottom: 1px solid var(--v-primary-base);
280
- }
281
- .fullWidth {
282
- display: flex;
283
- justify-content: center;
284
- align-items: center;
285
- font-weight: bold;
286
- font-size: 16px;
287
- }
288
- .change-pointer {
289
- cursor: pointer !important;
290
- }
291
- .p-header {
292
- height: 45px;
293
- display: flex;
294
- align-items: center;
295
- }
296
- .p-header:hover {
297
- background-color: rgb(243, 243, 243);
298
- }
299
- .span-text-ellipsis {
300
- white-space: nowrap;
301
- overflow: hidden;
302
- text-overflow: ellipsis;
303
- }
304
- .btn-header-delete {
305
- border-left: 1px solid var(--v-primary-base);
306
- }
307
- .btn-header-delete:hover {
308
- background-color: rgb(243, 243, 243);
309
- }
310
- .btn-delete-icon {
311
- color: var(--v-primary-base);
312
- }
313
- .addIcon {
314
- margin-right: 5px;
315
- }
316
204
  .p-label {
317
205
  font-size: 16px;
318
206
  font-weight: 500;
@@ -9,7 +9,7 @@
9
9
  :autofocus="true"
10
10
  :label="
11
11
  $t(
12
- 'plugin.games.components.settings.word_jumble.title_input'
12
+ 'windward.games.components.settings.word_jumble.title_input'
13
13
  )
14
14
  "
15
15
  ref="title"
@@ -20,7 +20,7 @@
20
20
  v-model="block.metadata.config.instructions"
21
21
  :label="
22
22
  $t(
23
- 'plugin.games.components.settings.word_jumble.instructions'
23
+ 'windward.games.components.settings.word_jumble.instructions'
24
24
  )
25
25
  "
26
26
  ></v-textarea>
@@ -30,91 +30,59 @@
30
30
  <p>
31
31
  {{
32
32
  $t(
33
- 'plugin.games.components.settings.word_jumble.word_jumble'
33
+ 'windward.games.components.settings.word_jumble.word_jumble'
34
34
  )
35
35
  }}
36
36
  </p>
37
- <draggable v-model="block.metadata.config.words" group="cards">
38
- <v-container
39
- v-for="(word, index) in block.metadata.config.words"
40
- :key="index"
41
- class="container-card-outline"
42
- elevation="0"
43
- outlined
44
- tile
45
- >
46
- <v-layout row wrap outlined>
47
- <v-flex xs10 :class="bottomBorder(index)">
48
- <p
49
- class="text-truncate mb-0 p-header"
50
- @click="onOpenEditor(index)"
51
- v-on:keyup.enter="onOpenEditor(index)"
52
- @mouseover="onHover"
53
- @mouseleave="onHoverLeave"
54
- :class="cursor"
55
- tabindex="0"
56
- >
57
- <v-icon>mdi-drag-vertical</v-icon>
58
- <span class="span-text-ellipsis">
59
- {{
60
- word.value
61
- ? word.value
62
- : $t(
63
- 'plugin.games.components.settings.word_jumble.click'
64
- )
65
- }}
66
- </span>
37
+ <SortableExpansionPanel
38
+ v-model="block.metadata.config.words"
39
+ @click:close="onDelete($event)"
40
+ >
41
+ <template #header="{ item, index }">
42
+ {{
43
+ item.value
44
+ ? item.value
45
+ : $t(
46
+ 'windward.games.components.settings.word_jumble.click'
47
+ )
48
+ }}
49
+ </template>
50
+ <template #body="{ item, index }">
51
+ <v-container>
52
+ <v-flex xs12>
53
+ <p class="p-label">
54
+ {{
55
+ $t(
56
+ 'windward.games.components.settings.word_jumble.word_jumble'
57
+ )
58
+ }}
67
59
  </p>
60
+ <v-textarea
61
+ outlined
62
+ :autofocus="true"
63
+ v-model="
64
+ block.metadata.config.words[index].value
65
+ "
66
+ ></v-textarea>
68
67
  </v-flex>
69
- <v-flex
70
- xs2
71
- class="btn-header-delete d-flex justify-center"
72
- :class="bottomBorder(index)"
73
- >
74
- <v-icon
75
- class="btn-delete-icon"
76
- @click="onDelete(index)"
77
- >mdi-delete-outline</v-icon
78
- >
68
+ <v-flex xs12>
69
+ <p class="p-label">
70
+ {{
71
+ $t(
72
+ 'windward.games.components.settings.word_jumble.hint'
73
+ )
74
+ }}
75
+ </p>
76
+ <v-textarea
77
+ outlined
78
+ v-model="
79
+ block.metadata.config.words[index].hint
80
+ "
81
+ ></v-textarea>
79
82
  </v-flex>
80
- <v-container v-if="word.expand">
81
- <v-flex xs12>
82
- <p class="p-label">
83
- {{
84
- $t(
85
- 'plugin.games.components.settings.word_jumble.word_jumble'
86
- )
87
- }}
88
- </p>
89
- <v-textarea
90
- outlined
91
- :autofocus="true"
92
- v-model="
93
- block.metadata.config.words[index]
94
- .value
95
- "
96
- ></v-textarea>
97
- </v-flex>
98
- <v-flex xs12>
99
- <p class="p-label">
100
- {{
101
- $t(
102
- 'plugin.games.components.settings.word_jumble.hint'
103
- )
104
- }}
105
- </p>
106
- <v-textarea
107
- outlined
108
- v-model="
109
- block.metadata.config.words[index]
110
- .hint
111
- "
112
- ></v-textarea>
113
- </v-flex>
114
- </v-container>
115
- </v-layout>
116
- </v-container>
117
- </draggable>
83
+ </v-container>
84
+ </template>
85
+ </SortableExpansionPanel>
118
86
  </v-container>
119
87
  <v-container class="pa-0">
120
88
  <v-row justify="center" class="my-4">
@@ -122,7 +90,7 @@
122
90
  <v-icon>mdi-plus</v-icon>
123
91
  {{
124
92
  $t(
125
- 'plugin.games.components.settings.word_jumble.add'
93
+ 'windward.games.components.settings.word_jumble.add'
126
94
  )
127
95
  }}
128
96
  </v-btn>
@@ -134,7 +102,7 @@
134
102
  :counter="50"
135
103
  :label="
136
104
  $t(
137
- 'plugin.games.components.settings.word_jumble.feedback_correct'
105
+ 'windward.games.components.settings.word_jumble.feedback_correct'
138
106
  )
139
107
  "
140
108
  ref="title"
@@ -145,7 +113,7 @@
145
113
  v-model="block.metadata.config.feedback_incorrect"
146
114
  :label="
147
115
  $t(
148
- 'plugin.games.components.settings.word_jumble.feedback_incorrect'
116
+ 'windward.games.components.settings.word_jumble.feedback_incorrect'
149
117
  )
150
118
  "
151
119
  ></v-textarea>
@@ -164,13 +132,13 @@
164
132
  <script>
165
133
  import _ from 'lodash'
166
134
  import BaseContentSettings from '~/components/Content/Tool/BaseContentSettings.js'
167
- import draggable from 'vuedraggable'
135
+ import SortableExpansionPanel from '~/components/SortableExpansionPanel.vue'
168
136
 
169
137
  export default {
170
138
  name: 'WordJumbleSettings',
171
139
  extends: BaseContentSettings,
172
140
  components: {
173
- draggable,
141
+ SortableExpansionPanel,
174
142
  },
175
143
  beforeMount() {
176
144
  if (_.isEmpty(this.block)) {
@@ -184,7 +152,7 @@ export default {
184
152
  }
185
153
  if (_.isEmpty(this.block.metadata.config.title)) {
186
154
  this.block.metadata.config.title = this.$t(
187
- 'plugin.games.components.content.blocks.word_jumble.title'
155
+ 'windward.games.components.content.blocks.word_jumble.title'
188
156
  )
189
157
  }
190
158
  if (_.isEmpty(this.block.metadata.config.instructions)) {
@@ -192,12 +160,12 @@ export default {
192
160
  }
193
161
  if (_.isEmpty(this.block.metadata.config.feedback_correct)) {
194
162
  this.block.metadata.config.feedback_correct = this.$t(
195
- 'plugin.games.components.settings.bucket_game.form.feedback.correct_default'
163
+ 'windward.games.components.settings.bucket_game.form.feedback.correct_default'
196
164
  )
197
165
  }
198
166
  if (_.isEmpty(this.block.metadata.config.feedback_incorrect)) {
199
167
  this.block.metadata.config.feedback_incorrect = this.$t(
200
- 'plugin.games.components.settings.bucket_game.form.feedback.incorrect_default'
168
+ 'windward.games.components.settings.bucket_game.form.feedback.incorrect_default'
201
169
  )
202
170
  }
203
171
  if (_.isEmpty(this.block.metadata.config.words)) {
@@ -208,28 +176,43 @@ export default {
208
176
  data() {
209
177
  return {
210
178
  valid: true,
211
- debounce: null,
212
- cursor: null,
213
179
  loading: false,
214
180
  }
215
181
  },
216
182
  methods: {
217
- bottomBorder(index) {
218
- if (this.block.metadata.config.words[index].expand === true) {
219
- return 'container-header-border'
220
- } else {
221
- return null
222
- }
223
- },
224
- onAddWord() {
183
+ onBeforeSave() {
225
184
  this.block.metadata.config.words.forEach((element) => {
226
- element.expand = false
185
+ element.shuffledWord = this.shuffle(element.value)
227
186
  })
187
+ },
188
+ shuffle(str) {
189
+ var a = str
190
+ var newArr = []
191
+ var neww = ''
192
+ var text = a.replace(/[\r\n]/g, '').split(' ')
193
+
194
+ text.map(function (v) {
195
+ v.split('').map(function () {
196
+ var hash = Math.floor(Math.random() * v.length)
197
+ neww += v[hash]
198
+ v = v.replace(v.charAt(hash), '')
199
+ })
200
+ newArr.push(neww)
201
+ neww = ''
202
+ })
203
+ var x = newArr.map((v) => v.split('').join(' ')).join('\n')
204
+ str = x
205
+ .split('')
206
+ .map((v) => v.toUpperCase())
207
+ .join('')
208
+ return str
209
+ },
210
+ onAddWord() {
228
211
  let defaultWord = {
229
212
  id: this.block.metadata.config.words.length + 1,
230
213
  value: '',
231
214
  hint: '',
232
- expand: true,
215
+ shuffledWord: '',
233
216
  }
234
217
  this.block.metadata.config.words.push(defaultWord)
235
218
  },
@@ -241,22 +224,6 @@ export default {
241
224
  return (element.id = startingIndex)
242
225
  })
243
226
  },
244
- onOpenEditor(index) {
245
- // expands editing area of clicked upon word jumble
246
- this.block.metadata.config.words[index].expand =
247
- !this.block.metadata.config.words[index].expand
248
- this.block.metadata.config.words.forEach((element) => {
249
- if (index + 1 !== element.id) {
250
- element.expand = false
251
- }
252
- })
253
- },
254
- onHover(index) {
255
- this.cursor = 'change-pointer'
256
- },
257
- onHoverLeave() {
258
- this.cursor = ''
259
- },
260
227
  },
261
228
  }
262
229
  </script>
@@ -264,39 +231,6 @@ export default {
264
231
  .v-progress-circular {
265
232
  margin: 1rem;
266
233
  }
267
- .container-card-outline {
268
- border: solid 1px var(--v-primary-base);
269
- border-radius: 3px !important;
270
- margin-bottom: 8px;
271
- }
272
- .container-header-border {
273
- border-bottom: 1px solid var(--v-primary-base);
274
- }
275
- .change-pointer {
276
- cursor: pointer !important;
277
- }
278
- .p-header {
279
- height: 45px;
280
- display: flex;
281
- align-items: center;
282
- }
283
- .p-header:hover {
284
- background-color: rgb(243, 243, 243);
285
- }
286
- .span-text-ellipsis {
287
- white-space: nowrap;
288
- overflow: hidden;
289
- text-overflow: ellipsis;
290
- }
291
- .btn-header-delete {
292
- border-left: 1px solid var(--v-primary-base);
293
- }
294
- .btn-header-delete:hover {
295
- background-color: rgb(243, 243, 243);
296
- }
297
- .btn-delete-icon {
298
- color: var(--v-primary-base);
299
- }
300
234
  .p-label {
301
235
  font-size: 16px;
302
236
  font-weight: 500;
@@ -3,6 +3,7 @@ export default {
3
3
  completed: 'Completed!',
4
4
  name: 'Bucket Name',
5
5
  game_title: 'Bucket Game',
6
+ aria_title: 'Bucket Game Title',
6
7
  answers: 'Answers',
7
8
  cannot: 'Cannot drag when editing!',
8
9
  form: {
@@ -1,5 +1,8 @@
1
1
  export default {
2
+ title: 'FlashCards',
3
+ items: 'FlashCard Items',
2
4
  img_alt: 'card image',
5
+ flip_card: 'Click to flip card',
3
6
  click_to_show_front: 'Click to show Front',
4
7
  click_to_show_back: 'Click to show Back',
5
8
  }
@@ -1,5 +1,7 @@
1
1
  export default {
2
2
  title: 'Word Jumble Game',
3
+ instructions:
4
+ 'Unscramble the clue and type your answer into the empty spaces and select Check Answer.',
3
5
  clue: 'Clue: ',
4
6
  check: 'Check Answer',
5
7
  reveal: 'Reveal Answer',
@@ -10,8 +10,9 @@ export default {
10
10
  default: 'Default feedback',
11
11
  correct: 'feedback when correct',
12
12
  incorrect: 'feedback when incorrect',
13
- correct_default: 'Correct!',
14
- incorrect_default: 'That is incorrect.',
13
+ correct_default: 'That is correct.',
14
+ incorrect_default:
15
+ 'That is incorrect. Try again or select reveal answer.',
15
16
  },
16
17
  image: {
17
18
  title: 'Flash Card Image File',
@@ -1,6 +1,7 @@
1
1
  export default {
2
2
  form: {
3
3
  card: 'Card',
4
+ flip_card: 'Click to flip card',
4
5
  label: 'Card Label',
5
6
  card_content: 'Card Content',
6
7
  front: 'Front',