@windward/games 0.0.3 → 0.0.5

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/components/content/DatableEditor.vue +0 -3
  2. package/components/content/blocks/crosswordPuzzle/Crossword.ts +553 -0
  3. package/components/content/blocks/crosswordPuzzle/CrosswordClues.vue +91 -0
  4. package/components/content/blocks/crosswordPuzzle/CrosswordElements.ts +38 -0
  5. package/components/content/blocks/crosswordPuzzle/CrosswordPuzzle.vue +673 -0
  6. package/components/content/blocks/multipleChoice/MultipleChoice.vue +187 -127
  7. package/components/content/blocks/multipleChoice/QuestionDialog.vue +37 -13
  8. package/components/content/blocks/sevenStrikes/SevenStikes.vue +368 -0
  9. package/components/content/blocks/sevenStrikes/keyboard.vue +71 -0
  10. package/components/content/blocks/wordJumble/Jumble.vue +2 -10
  11. package/components/content/blocks/wordJumble/WordJumble.vue +22 -10
  12. package/components/settings/CrosswordPuzzleSettingsManager.vue +271 -0
  13. package/components/settings/MultipleChoiceSettingsManager.vue +21 -7
  14. package/components/settings/SevenStrikesSettingsManager.vue +288 -0
  15. package/components/settings/WordJumbleSettingsManager.vue +4 -1
  16. package/i18n/en-US/components/content/blocks/crossword.ts +22 -0
  17. package/i18n/en-US/components/content/blocks/index.ts +4 -0
  18. package/i18n/en-US/components/content/blocks/multiple_choice.ts +2 -4
  19. package/i18n/en-US/components/content/blocks/seven_strikes.ts +6 -0
  20. package/i18n/en-US/components/settings/crossword.ts +7 -0
  21. package/i18n/en-US/components/settings/index.ts +4 -0
  22. package/i18n/en-US/components/settings/multiple_choice.ts +1 -1
  23. package/i18n/en-US/components/settings/seven_strikes.ts +8 -0
  24. package/i18n/en-US/components/settings/word_jumble.ts +1 -1
  25. package/i18n/en-US/shared/content_blocks.ts +2 -0
  26. package/i18n/en-US/shared/settings.ts +2 -0
  27. package/package.json +2 -1
  28. package/plugin.js +43 -1
  29. package/test/blocks/crossword/CrosswordPuzzle.spec.js +49 -0
  30. package/test/blocks/sevenStrikes/sevenStrikes.spec.js +24 -0
  31. package/test/settings/BucketGameManager.spec.js +1 -1
  32. package/test/settings/CrosswordPuzzleManager.spec.js +103 -0
  33. package/test/settings/SevenStrikesManager.spec.js +53 -0
  34. package/test/settings/WordJumbleManager.spec.js +2 -2
@@ -6,6 +6,8 @@ import quizshow_game from './quizshow_game'
6
6
  import slideshow from './slideshow'
7
7
  import multiple_choice from './multiple_choice'
8
8
  import word_jumble from './word_jumble'
9
+ import seven_strikes from './seven_strikes'
10
+ import crossword from './crossword'
9
11
 
10
12
  export default {
11
13
  bucket_game,
@@ -16,4 +18,6 @@ export default {
16
18
  slideshow,
17
19
  multiple_choice,
18
20
  word_jumble,
21
+ seven_strikes,
22
+ crossword,
19
23
  }
@@ -1,11 +1,9 @@
1
1
  export default {
2
2
  game_title: 'Multiple Choice Game',
3
- hint: 'View/Reset Hint',
3
+ hint: 'View Hint',
4
4
  fifty: '50:50',
5
- print: 'View Print Version',
6
- reset: 'Reset Game',
7
5
  hint_title: 'Hint',
8
- answer_description: 'Answer Description',
6
+ answer_feedback: 'Answer Feedback',
9
7
  total_points: 'Total Points for Course',
10
8
  out_of: ' out of ',
11
9
  }
@@ -0,0 +1,6 @@
1
+ export default {
2
+ title: 'Seven Strikes',
3
+ reveal: 'Reveal Answer',
4
+ again: 'Play Again',
5
+ next: 'Next',
6
+ }
@@ -0,0 +1,7 @@
1
+ export default {
2
+ crossword_items: 'Crossword Items',
3
+ word: 'Word',
4
+ clue: 'Clue',
5
+ min_length: 'Cannot have less than two words',
6
+ alert: 'Alert',
7
+ }
@@ -6,6 +6,8 @@ import slideshow from './slideshow'
6
6
  import multiple_choice from './multiple_choice'
7
7
  import sorting_game from './sorting_game'
8
8
  import word_jumble from './word_jumble'
9
+ import seven_strikes from './seven_strikes'
10
+ import crossword from './crossword'
9
11
 
10
12
  export default {
11
13
  bucket_game,
@@ -16,4 +18,6 @@ export default {
16
18
  slideshow,
17
19
  multiple_choice,
18
20
  sorting_game,
21
+ seven_strikes,
22
+ crossword,
19
23
  }
@@ -5,7 +5,7 @@ export default {
5
5
  questions: 'Questions',
6
6
  modal_title: 'Multiple Choice Question',
7
7
  question_hint: 'Question Hint',
8
- answer_description: 'Answer Description',
8
+ answer_feedback: 'Answer Feedback',
9
9
  question: 'Question',
10
10
  answer_options: 'Answer Options',
11
11
  answer_option: 'Answer Option',
@@ -0,0 +1,8 @@
1
+ export default {
2
+ title: 'Seven Strikes',
3
+ instructions:
4
+ 'Read the clue below, and click on the letters to spell out the word the clue refers to. If you choose a letter that isnt in the word, an X will be illuminated. When you choose an incorrect letter 7 times, the game is over.Open a text-only version of this vocabulary game in a new windowSkip this vocabulary game',
5
+ word: 'Word or Phrase',
6
+ hint: 'Clue',
7
+ items: 'Items',
8
+ }
@@ -4,7 +4,7 @@ export default {
4
4
  instructions: 'Instructions',
5
5
  click: 'Click to enter text',
6
6
  label: 'Word for jumbling',
7
- hint: 'Hint for word',
7
+ hint: 'Clue for word',
8
8
  add: 'Add Word',
9
9
  feedback_correct: 'Feedback when correct',
10
10
  feedback_incorrect: 'Feedback when incorrect',
@@ -8,6 +8,8 @@ export default {
8
8
  slideshow: 'Slideshow',
9
9
  multiple_choice: 'Multiple Choice',
10
10
  word_jumble: 'Word Jumble',
11
+ seven_strikes: 'Seven Strikes',
12
+ crossword_puzzle: 'Crossword',
11
13
  },
12
14
  grouping: {
13
15
  game: 'Activities',
@@ -8,5 +8,7 @@ export default {
8
8
  quizshow_manager: 'Quizshow Manager',
9
9
  multiple_choice_manager: 'Multiple Choice Manager',
10
10
  wordjumble_manager: 'Word Jumble Manager',
11
+ seven_strikes_manager: 'Seven Strikes Manager',
12
+ crossword_puzzle_manager: 'Crossword Puzzle Manager',
11
13
  },
12
14
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@windward/games",
3
- "version": "0.0.3",
3
+ "version": "0.0.5",
4
4
  "description": "Windward UI Plugin Games",
5
5
  "main": "plugin.js",
6
6
  "scripts": {
@@ -20,6 +20,7 @@
20
20
  "eslint": "^8.11.0",
21
21
  "lodash": "^4.17.21",
22
22
  "prettier": "^2.6.0",
23
+ "simple-keyboard": "^3.6.28",
23
24
  "vue-excel-editor": "^1.5.19",
24
25
  "vue-flashcard": "^1.1.6",
25
26
  "vuedraggable": "^2.24.3"
package/plugin.js CHANGED
@@ -3,6 +3,8 @@ import flashcards from './components/content/blocks/flashcards/FlashcardSlides'
3
3
  import slideShow from './components/content/blocks/slideshow/SlideShow.vue'
4
4
  import WordJumble from './components/content/blocks/wordJumble/WordJumble'
5
5
  import WordJumbleSettings from './components/settings/WordJumbleSettingsManager.vue'
6
+ import SevenStrikes from './components/content/blocks/sevenStrikes/SevenStikes.vue'
7
+ import SevenStrikesSettingsManager from './components/settings/SevenStrikesSettingsManager.vue'
6
8
  import FlashCardSlidesManager from './components/settings/FlashCardSlidesManager'
7
9
  import SlideShowManager from './components/settings/SlideShowManager.vue'
8
10
  import MatchingGameManager from './components/settings/MatchingGameManager.vue'
@@ -15,6 +17,8 @@ import quizShow from './components/content/blocks/quizshowGame/QuizShow'
15
17
  import QuizShowSettingsManager from './components/settings/QuizShowSettingsManager'
16
18
  import MultipleChoice from './components/content/blocks/multipleChoice/MultipleChoice.vue'
17
19
  import MultipleChoiceSettingsManager from './components/settings/MultipleChoiceSettingsManager'
20
+ import CrosswordPuzzle from './components/content/blocks/crosswordPuzzle/CrosswordPuzzle.vue'
21
+ import CrosswordPuzzleSettingsManager from './components/settings/CrosswordPuzzleSettingsManager.vue'
18
22
 
19
23
  export default {
20
24
  name: 'Windward Games Plugin',
@@ -107,12 +111,32 @@ export default {
107
111
  tag: 'games-wordjumble-game',
108
112
  template: WordJumble,
109
113
  metadata: {
110
- icon: 'mdi-alpha-w-box-outline',
114
+ icon: 'mdi-ab-testing',
111
115
  name: 'plugin.games.shared.content_blocks.title.word_jumble',
112
116
  grouping:
113
117
  'plugin.games.shared.content_blocks.grouping.game',
114
118
  },
115
119
  },
120
+ {
121
+ tag: 'games-seven-strikes-game',
122
+ template: SevenStrikes,
123
+ metadata: {
124
+ icon: 'mdi-ab-testing',
125
+ name: 'plugin.games.shared.content_blocks.title.seven_strikes',
126
+ grouping:
127
+ 'plugin.games.shared.content_blocks.grouping.game',
128
+ },
129
+ },
130
+ {
131
+ tag: 'games-crossword-puzzle-game',
132
+ template: CrosswordPuzzle,
133
+ metadata: {
134
+ icon: 'mdi-alpha-c-box-outline',
135
+ name: 'plugin.games.shared.content_blocks.title.crossword_puzzle',
136
+ grouping:
137
+ 'plugin.games.shared.content_blocks.grouping.game',
138
+ },
139
+ },
116
140
  ],
117
141
  settings: [
118
142
  {
@@ -187,6 +211,24 @@ export default {
187
211
  name: 'plugin.games.shared.settings.title.wordjumble_manager',
188
212
  },
189
213
  },
214
+ {
215
+ tag: 'games-seven-strikes-settings',
216
+ template: SevenStrikesSettingsManager,
217
+ context: ['block.games-seven-strikes-game'],
218
+ metadata: {
219
+ icon: 'mdi-cog',
220
+ name: 'plugin.games.shared.settings.title.seven_strikes_manager',
221
+ },
222
+ },
223
+ {
224
+ tag: 'games-crossword-puzzle-settings',
225
+ template: CrosswordPuzzleSettingsManager,
226
+ context: ['block.games-crossword-puzzle-game'],
227
+ metadata: {
228
+ icon: 'mdi-cog',
229
+ name: 'plugin.games.shared.settings.title.crossword_puzzle_manager',
230
+ },
231
+ },
190
232
  ],
191
233
  },
192
234
  }
@@ -0,0 +1,49 @@
1
+ import { shallowMount } from '@vue/test-utils'
2
+ import { defaultMocks } from '@windward/core/test/mocks'
3
+ import CrosswordPuzzle from '@/components/content/blocks/crosswordPuzzle/CrosswordPuzzle'
4
+
5
+ import Vuetify from 'vuetify'
6
+ import Vue from 'vue'
7
+ Vue.use(Vuetify)
8
+
9
+ //override default mock
10
+ jest.mock(
11
+ 'lodash',
12
+ () => {
13
+ return {
14
+ cloneDeep: () => {
15
+ return []
16
+ },
17
+ isEmpty: () => {
18
+ return jest.fn()
19
+ },
20
+ flatten: () => {
21
+ return jest.fn()
22
+ },
23
+ get: () => {
24
+ return jest.fn()
25
+ },
26
+ }
27
+ },
28
+ { virtual: true }
29
+ )
30
+ describe('CrosswordPuzzle', () => {
31
+ test('is a Vue instance', () => {
32
+ const wrapper = shallowMount(CrosswordPuzzle, {
33
+ propsData: {
34
+ value: {
35
+ id: '00000000-0000-0000-0000-000000000000',
36
+ name: 'Test Content Page',
37
+ body: '[]',
38
+ metadata: {
39
+ config: {
40
+ words: [],
41
+ },
42
+ },
43
+ },
44
+ },
45
+ mocks: defaultMocks,
46
+ })
47
+ expect(wrapper.vm).toBeTruthy()
48
+ })
49
+ })
@@ -0,0 +1,24 @@
1
+ import { shallowMount } from '@vue/test-utils'
2
+ import { defaultMocks } from '@windward/core/test/mocks'
3
+ import SevenStrikes from '@/components/content/blocks/sevenStrikes/SevenStikes'
4
+
5
+ import Vuetify from 'vuetify'
6
+ import Vue from 'vue'
7
+ Vue.use(Vuetify)
8
+
9
+ describe('SevenStrikesGame', () => {
10
+ test('is a Vue instance', () => {
11
+ const wrapper = shallowMount(SevenStrikes, {
12
+ propsData: {
13
+ value: {
14
+ id: '00000000-0000-0000-0000-000000000000',
15
+ name: 'Test Content Page',
16
+ body: '{}',
17
+ metadata: { config: {} },
18
+ },
19
+ },
20
+ mocks: defaultMocks,
21
+ })
22
+ expect(wrapper.vm).toBeTruthy()
23
+ })
24
+ })
@@ -9,7 +9,7 @@ Vue.use(Vuetify)
9
9
  const settings = {}
10
10
  const context = 'block'
11
11
 
12
- describe('Matching game manager', () => {
12
+ describe('Bucket game manager', () => {
13
13
  test('is a Vue instance', () => {
14
14
  const wrapper = shallowMount(BucketGameSettingsManager, {
15
15
  propsData: {
@@ -0,0 +1,103 @@
1
+ import { shallowMount } from '@vue/test-utils'
2
+ import { defaultMocks } from '@windward/core/test/mocks'
3
+ import CrosswordPuzzleSettingsManager from '@/components/settings/CrosswordPuzzleSettingsManager'
4
+
5
+ import Vuetify from 'vuetify'
6
+ import Vue from 'vue'
7
+ Vue.use(Vuetify)
8
+
9
+ const settings = {}
10
+ const context = 'block'
11
+
12
+ describe('Crossword game manager', () => {
13
+ test('is a Vue instance', () => {
14
+ const wrapper = shallowMount(CrosswordPuzzleSettingsManager, {
15
+ propsData: {
16
+ block: {
17
+ id: '00000000-0000-0000-0000-000000000000',
18
+ name: 'Test Content Page',
19
+ body: '{}',
20
+ metadata: { config: {} },
21
+ },
22
+ settings: settings,
23
+ context: context,
24
+ data: {},
25
+ metadata: { config: {} },
26
+ },
27
+ mocks: defaultMocks,
28
+ })
29
+ expect(wrapper.vm).toBeTruthy()
30
+ })
31
+
32
+ test('can add new word', () => {
33
+ const wrapper = shallowMount(CrosswordPuzzleSettingsManager, {
34
+ propsData: {
35
+ block: {
36
+ id: '00000000-0000-0000-0000-000000000000',
37
+ name: 'Test Content Page',
38
+ body: '{}',
39
+ metadata: { config: {} },
40
+ },
41
+ settings: settings,
42
+ context: context,
43
+ data: {},
44
+ metadata: { config: {} },
45
+ },
46
+ mocks: defaultMocks,
47
+ })
48
+ wrapper.vm.onAddElement()
49
+ expect(wrapper.vm.block.metadata.config.words).toEqual([
50
+ {
51
+ id: 0,
52
+ word: '',
53
+ description: '',
54
+ expand: false,
55
+ },
56
+ {
57
+ id: 1,
58
+ word: '',
59
+ description: '',
60
+ expand: false,
61
+ },
62
+ {
63
+ id: 2,
64
+ word: '',
65
+ description: '',
66
+ expand: true,
67
+ },
68
+ ])
69
+ })
70
+
71
+ test('can delete word', () => {
72
+ const wrapper = shallowMount(CrosswordPuzzleSettingsManager, {
73
+ propsData: {
74
+ block: {
75
+ id: '00000000-0000-0000-0000-000000000000',
76
+ name: 'Test Content Page',
77
+ body: '{}',
78
+ metadata: { config: {} },
79
+ },
80
+ settings: settings,
81
+ context: context,
82
+ data: {},
83
+ metadata: { config: {} },
84
+ },
85
+ mocks: defaultMocks,
86
+ })
87
+ wrapper.vm.onDelete(1)
88
+ expect(wrapper.vm.block.metadata.config.words).toEqual([
89
+ {
90
+ id: 0,
91
+ word: '',
92
+ description: '',
93
+ expand: false,
94
+ },
95
+ {
96
+ id: 1,
97
+ word: '',
98
+ description: '',
99
+ expand: true,
100
+ },
101
+ ])
102
+ })
103
+ })
@@ -0,0 +1,53 @@
1
+ import { shallowMount } from '@vue/test-utils'
2
+ import { defaultMocks } from '@windward/core/test/mocks'
3
+ import SevenStrikesSettingsManager from '@/components/settings/SevenStrikesSettingsManager'
4
+
5
+ import Vuetify from 'vuetify'
6
+ import Vue from 'vue'
7
+ Vue.use(Vuetify)
8
+
9
+ const settings = {}
10
+ const context = 'block'
11
+
12
+ describe('Seven Strikes slides manager', () => {
13
+ test('is a Vue instance', () => {
14
+ const wrapper = shallowMount(SevenStrikesSettingsManager, {
15
+ propsData: {
16
+ settings: settings,
17
+ context: context,
18
+ data: {},
19
+ },
20
+ mocks: defaultMocks,
21
+ })
22
+ expect(wrapper.vm).toBeTruthy()
23
+ })
24
+
25
+ test('can add word', () => {
26
+ const wrapper = shallowMount(SevenStrikesSettingsManager, {
27
+ propsData: {
28
+ settings: settings,
29
+ context: context,
30
+ data: {},
31
+ },
32
+ mocks: defaultMocks,
33
+ })
34
+ wrapper.vm.onAddElement()
35
+ expect(wrapper.vm.block.metadata.config.words).toEqual([
36
+ { value: '', expand: false, hint: '', splitWord: '' },
37
+ { value: '', expand: true, hint: '', splitWord: '' },
38
+ ])
39
+ })
40
+
41
+ test('can delete a word', () => {
42
+ const wrapper = shallowMount(SevenStrikesSettingsManager, {
43
+ propsData: {
44
+ settings: settings,
45
+ context: context,
46
+ data: {},
47
+ },
48
+ mocks: defaultMocks,
49
+ })
50
+ wrapper.vm.onDelete(0)
51
+ expect(wrapper.vm.block.metadata.config.words).toEqual([])
52
+ })
53
+ })
@@ -55,7 +55,7 @@ describe('WordJumble manager', () => {
55
55
  id: 2,
56
56
  value: '',
57
57
  hint: '',
58
- expand: false,
58
+ expand: true,
59
59
  },
60
60
  ])
61
61
  })
@@ -80,7 +80,7 @@ describe('WordJumble manager', () => {
80
80
  id: 1,
81
81
  value: '',
82
82
  hint: '',
83
- expand: false,
83
+ expand: true,
84
84
  },
85
85
  ])
86
86
  })