@windward/games 0.0.1 → 0.0.3

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 (31) hide show
  1. package/components/content/blocks/dragDrop/BucketGame.vue +4 -4
  2. package/components/content/blocks/dragDrop/SortingGame.vue +1 -1
  3. package/components/content/blocks/flashcards/FlashcardSlides.vue +2 -2
  4. package/components/content/blocks/matchingGame/MatchingGame.vue +2 -2
  5. package/components/content/blocks/multipleChoice/MultipleChoice.vue +565 -0
  6. package/components/content/blocks/multipleChoice/QuestionDialog.vue +276 -0
  7. package/components/content/blocks/quizshowGame/QuizShow.vue +2 -2
  8. package/components/content/blocks/slideshow/SlideShow.vue +2 -2
  9. package/components/content/blocks/wordJumble/Jumble.vue +97 -0
  10. package/components/content/blocks/wordJumble/WordJumble.vue +239 -0
  11. package/components/settings/MultipleChoiceSettingsManager.vue +290 -0
  12. package/components/settings/SortingGameSettingsManager.vue +10 -5
  13. package/components/settings/WordJumbleSettingsManager.vue +293 -0
  14. package/i18n/en-US/components/content/blocks/index.ts +4 -0
  15. package/i18n/en-US/components/content/blocks/matching_game.ts +1 -1
  16. package/i18n/en-US/components/content/blocks/multiple_choice.ts +11 -0
  17. package/i18n/en-US/components/content/blocks/word_jumble.ts +9 -0
  18. package/i18n/en-US/components/settings/index.ts +6 -0
  19. package/i18n/en-US/components/settings/multiple_choice.ts +16 -0
  20. package/i18n/en-US/components/settings/sorting_game.ts +3 -0
  21. package/i18n/en-US/components/settings/word_jumble.ts +11 -0
  22. package/i18n/en-US/shared/content_blocks.ts +2 -0
  23. package/i18n/en-US/shared/settings.ts +2 -0
  24. package/package.json +1 -1
  25. package/plugin.js +42 -0
  26. package/test/blocks/multipleChoice/MultipleChoice.spec.js +26 -0
  27. package/test/blocks/multipleChoice/QuestionDialog.spec.js +26 -0
  28. package/test/blocks/wordJumble/Jumble.spec.js +27 -0
  29. package/test/blocks/wordJumble/WordJumble.spec.js +24 -0
  30. package/test/settings/MultipleChoiceGameManager.spec.js +30 -0
  31. package/test/settings/WordJumbleManager.spec.js +87 -0
@@ -3,11 +3,17 @@ import flashcard from './flashcard'
3
3
  import matching_game from './matching_game'
4
4
  import quizshow_game from './quizshow_game'
5
5
  import slideshow from './slideshow'
6
+ import multiple_choice from './multiple_choice'
7
+ import sorting_game from './sorting_game'
8
+ import word_jumble from './word_jumble'
6
9
 
7
10
  export default {
8
11
  bucket_game,
9
12
  flashcard,
10
13
  matching_game,
11
14
  quizshow_game,
15
+ word_jumble,
12
16
  slideshow,
17
+ multiple_choice,
18
+ sorting_game,
13
19
  }
@@ -0,0 +1,16 @@
1
+ export default {
2
+ game_title: 'Multiple Choice Game',
3
+ title_placeholder: 'Title',
4
+ instructions: 'Instructions',
5
+ questions: 'Questions',
6
+ modal_title: 'Multiple Choice Question',
7
+ question_hint: 'Question Hint',
8
+ answer_description: 'Answer Description',
9
+ question: 'Question',
10
+ answer_options: 'Answer Options',
11
+ answer_option: 'Answer Option',
12
+ correct: 'Correct',
13
+ correct_answer: 'Click an answer to set it as the correct answer',
14
+ add_answer: 'Add Answer',
15
+ add_question: 'Add Question',
16
+ }
@@ -0,0 +1,3 @@
1
+ export default {
2
+ sortable_items: 'Sortable Items',
3
+ }
@@ -0,0 +1,11 @@
1
+ export default {
2
+ word_jumble: 'Word Jumble',
3
+ title_input: 'Title',
4
+ instructions: 'Instructions',
5
+ click: 'Click to enter text',
6
+ label: 'Word for jumbling',
7
+ hint: 'Hint for word',
8
+ add: 'Add Word',
9
+ feedback_correct: 'Feedback when correct',
10
+ feedback_incorrect: 'Feedback when incorrect',
11
+ }
@@ -6,6 +6,8 @@ export default {
6
6
  matching_game: 'Matching',
7
7
  quizshow: 'Quizshow',
8
8
  slideshow: 'Slideshow',
9
+ multiple_choice: 'Multiple Choice',
10
+ word_jumble: 'Word Jumble',
9
11
  },
10
12
  grouping: {
11
13
  game: 'Activities',
@@ -6,5 +6,7 @@ export default {
6
6
  matching_game_manager: ' Matching Game Manager',
7
7
  slideshow_manager: 'Slideshow Manager',
8
8
  quizshow_manager: 'Quizshow Manager',
9
+ multiple_choice_manager: 'Multiple Choice Manager',
10
+ wordjumble_manager: 'Word Jumble Manager',
9
11
  },
10
12
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@windward/games",
3
- "version": "0.0.1",
3
+ "version": "0.0.3",
4
4
  "description": "Windward UI Plugin Games",
5
5
  "main": "plugin.js",
6
6
  "scripts": {
package/plugin.js CHANGED
@@ -1,6 +1,8 @@
1
1
  import enUS from './i18n/en-US'
2
2
  import flashcards from './components/content/blocks/flashcards/FlashcardSlides'
3
3
  import slideShow from './components/content/blocks/slideshow/SlideShow.vue'
4
+ import WordJumble from './components/content/blocks/wordJumble/WordJumble'
5
+ import WordJumbleSettings from './components/settings/WordJumbleSettingsManager.vue'
4
6
  import FlashCardSlidesManager from './components/settings/FlashCardSlidesManager'
5
7
  import SlideShowManager from './components/settings/SlideShowManager.vue'
6
8
  import MatchingGameManager from './components/settings/MatchingGameManager.vue'
@@ -11,6 +13,8 @@ import SortingGameSettingsManager from './components/settings/SortingGameSetting
11
13
  import BucketGame from './components/content/blocks/dragDrop/BucketGame'
12
14
  import quizShow from './components/content/blocks/quizshowGame/QuizShow'
13
15
  import QuizShowSettingsManager from './components/settings/QuizShowSettingsManager'
16
+ import MultipleChoice from './components/content/blocks/multipleChoice/MultipleChoice.vue'
17
+ import MultipleChoiceSettingsManager from './components/settings/MultipleChoiceSettingsManager'
14
18
 
15
19
  export default {
16
20
  name: 'Windward Games Plugin',
@@ -89,6 +93,26 @@ export default {
89
93
  'plugin.games.shared.content_blocks.grouping.game',
90
94
  },
91
95
  },
96
+ {
97
+ tag: 'games-multiple-choice',
98
+ template: MultipleChoice,
99
+ metadata: {
100
+ icon: 'mdi-head-question-outline',
101
+ name: 'plugin.games.shared.content_blocks.title.multiple_choice',
102
+ grouping:
103
+ 'plugin.games.shared.content_blocks.grouping.game',
104
+ },
105
+ },
106
+ {
107
+ tag: 'games-wordjumble-game',
108
+ template: WordJumble,
109
+ metadata: {
110
+ icon: 'mdi-alpha-w-box-outline',
111
+ name: 'plugin.games.shared.content_blocks.title.word_jumble',
112
+ grouping:
113
+ 'plugin.games.shared.content_blocks.grouping.game',
114
+ },
115
+ },
92
116
  ],
93
117
  settings: [
94
118
  {
@@ -145,6 +169,24 @@ export default {
145
169
  name: 'plugin.games.shared.settings.title.quizshow_manager',
146
170
  },
147
171
  },
172
+ {
173
+ tag: 'games-multiple-choice-settings',
174
+ template: MultipleChoiceSettingsManager,
175
+ context: ['block.games-multiple-choice'],
176
+ metadata: {
177
+ icon: 'mdi-cog',
178
+ name: 'plugin.games.shared.settings.title.multiple_choice_manager',
179
+ },
180
+ },
181
+ {
182
+ tag: 'games-wordjumble-settings',
183
+ template: WordJumbleSettings,
184
+ context: ['block.games-wordjumble-game'],
185
+ metadata: {
186
+ icon: 'mdi-cog',
187
+ name: 'plugin.games.shared.settings.title.wordjumble_manager',
188
+ },
189
+ },
148
190
  ],
149
191
  },
150
192
  }
@@ -0,0 +1,26 @@
1
+ import { defaultMocks } from '@windward/core/test/mocks'
2
+ import MultipleChoice from '@/components/content/blocks/multipleChoice/MultipleChoice.vue'
3
+ import { shallowMount } from '@vue/test-utils'
4
+
5
+ import Vuetify from 'vuetify'
6
+ import Vue from 'vue'
7
+ Vue.use(Vuetify)
8
+
9
+ describe('MultipleChocie', () => {
10
+ test('is a Vue instance', () => {
11
+ const wrapper = shallowMount(MultipleChoice, {
12
+ propsData: {
13
+ value: {
14
+ id: '00000000-0000-0000-0000-000000000000',
15
+ name: 'Test Content Page',
16
+ body: '[]',
17
+ metadata: {
18
+ config: {},
19
+ },
20
+ },
21
+ },
22
+ mocks: defaultMocks,
23
+ })
24
+ expect(wrapper.vm).toBeTruthy()
25
+ })
26
+ })
@@ -0,0 +1,26 @@
1
+ import { defaultMocks } from '@windward/core/test/mocks'
2
+ import QuestionDialog from '@/components/content/blocks/multipleChoice/QuestionDialog.vue'
3
+ import { shallowMount } from '@vue/test-utils'
4
+
5
+ import Vuetify from 'vuetify'
6
+ import Vue from 'vue'
7
+ Vue.use(Vuetify)
8
+
9
+ describe('QuestionDialog', () => {
10
+ test('is a Vue instance', () => {
11
+ const wrapper = shallowMount(QuestionDialog, {
12
+ propsData: {
13
+ value: {
14
+ id: '00000000-0000-0000-0000-000000000000',
15
+ name: 'Test Content Page',
16
+ body: '[]',
17
+ metadata: {
18
+ config: {},
19
+ },
20
+ },
21
+ },
22
+ mocks: defaultMocks,
23
+ })
24
+ expect(wrapper.vm).toBeTruthy()
25
+ })
26
+ })
@@ -0,0 +1,27 @@
1
+ import { shallowMount } from '@vue/test-utils'
2
+ import { defaultMocks } from '@windward/core/test/mocks'
3
+ import Jumble from '@/components/content/blocks/wordJumble/Jumble'
4
+
5
+ import Vuetify from 'vuetify'
6
+ import Vue from 'vue'
7
+ Vue.use(Vuetify)
8
+
9
+ describe('Jumble', () => {
10
+ test('is a Vue instance', () => {
11
+ const wrapper = shallowMount(Jumble, {
12
+ propsData: {
13
+ value: {
14
+ value: [
15
+ {
16
+ value: '',
17
+ },
18
+ ],
19
+ },
20
+ reveal: false,
21
+ reset: false,
22
+ },
23
+ mocks: defaultMocks,
24
+ })
25
+ expect(wrapper.vm).toBeTruthy()
26
+ })
27
+ })
@@ -0,0 +1,24 @@
1
+ import { shallowMount } from '@vue/test-utils'
2
+ import { defaultMocks } from '@windward/core/test/mocks'
3
+ import WordJumble from '@/components/content/blocks/wordJumble/WordJumble'
4
+
5
+ import Vuetify from 'vuetify'
6
+ import Vue from 'vue'
7
+ Vue.use(Vuetify)
8
+
9
+ describe('WordJumble', () => {
10
+ test('is a Vue instance', () => {
11
+ const wrapper = shallowMount(WordJumble, {
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
+ })
@@ -0,0 +1,30 @@
1
+ import { mount, shallowMount } from '@vue/test-utils'
2
+ import { defaultMocks } from '@windward/core/test/mocks'
3
+ import MultipleChoiceSettingsManager from '@/components/settings/MultipleChoiceSettingsManager'
4
+ import Vuetify from 'vuetify'
5
+ import Vue from 'vue'
6
+ Vue.use(Vuetify)
7
+
8
+ const settings = {}
9
+ const context = 'block'
10
+
11
+ describe('MultipleChoiceSettingsManager', () => {
12
+ test('is a Vue instance', () => {
13
+ const wrapper = shallowMount(MultipleChoiceSettingsManager, {
14
+ propsData: {
15
+ block: {
16
+ id: '00000000-0000-0000-0000-000000000000',
17
+ name: 'Test Content Page',
18
+ body: '{}',
19
+ metadata: { config: {} },
20
+ },
21
+ settings: settings,
22
+ context: context,
23
+ data: {},
24
+ metadata: { config: {} },
25
+ },
26
+ mocks: defaultMocks,
27
+ })
28
+ expect(wrapper.vm).toBeTruthy()
29
+ })
30
+ })
@@ -0,0 +1,87 @@
1
+ import { mount, shallowMount } from '@vue/test-utils'
2
+ import { defaultMocks } from '@windward/core/test/mocks'
3
+ import WordJumbleSettingsManager from '@/components/settings/WordJumbleSettingsManager'
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('WordJumble manager', () => {
13
+ test('is a Vue instance', () => {
14
+ const wrapper = shallowMount(WordJumbleSettingsManager, {
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
+ },
26
+ mocks: defaultMocks,
27
+ })
28
+ expect(wrapper.vm).toBeTruthy()
29
+ })
30
+
31
+ test('can add word jumble', () => {
32
+ const wrapper = shallowMount(WordJumbleSettingsManager, {
33
+ propsData: {
34
+ block: {
35
+ id: '00000000-0000-0000-0000-000000000000',
36
+ name: 'Test Content Page',
37
+ body: '{}',
38
+ metadata: { config: {} },
39
+ },
40
+ settings: settings,
41
+ context: context,
42
+ data: {},
43
+ },
44
+ mocks: defaultMocks,
45
+ })
46
+ wrapper.vm.onAddWord()
47
+ expect(wrapper.vm.block.metadata.config.words).toEqual([
48
+ {
49
+ id: 1,
50
+ value: '',
51
+ hint: '',
52
+ expand: false,
53
+ },
54
+ {
55
+ id: 2,
56
+ value: '',
57
+ hint: '',
58
+ expand: false,
59
+ },
60
+ ])
61
+ })
62
+ test('can delete a word jumble', () => {
63
+ const wrapper = shallowMount(WordJumbleSettingsManager, {
64
+ propsData: {
65
+ block: {
66
+ id: '00000000-0000-0000-0000-000000000000',
67
+ name: 'Test Content Page',
68
+ body: '{}',
69
+ metadata: { config: {} },
70
+ },
71
+ settings: settings,
72
+ context: context,
73
+ data: {},
74
+ },
75
+ mocks: defaultMocks,
76
+ })
77
+ wrapper.vm.onDelete(1)
78
+ expect(wrapper.vm.block.metadata.config.words).toEqual([
79
+ {
80
+ id: 1,
81
+ value: '',
82
+ hint: '',
83
+ expand: false,
84
+ },
85
+ ])
86
+ })
87
+ })