@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.
- package/components/content/CrudTable.vue +2 -2
- package/components/content/blocks/crosswordPuzzle/CrosswordClues.vue +4 -2
- package/components/content/blocks/crosswordPuzzle/CrosswordPuzzle.vue +14 -12
- package/components/content/blocks/dragDrop/BucketGame.vue +54 -101
- package/components/content/blocks/dragDrop/SortingGame.vue +47 -33
- package/components/content/blocks/flashcards/CardFace.vue +38 -39
- package/components/content/blocks/flashcards/Flashcard.vue +109 -28
- package/components/content/blocks/flashcards/FlashcardSlides.vue +3 -2
- package/components/content/blocks/matchingGame/MatchingGame.vue +105 -61
- package/components/content/blocks/multipleChoice/MultipleChoice.vue +186 -225
- package/components/content/blocks/multipleChoice/QuestionDialog.vue +7 -7
- package/components/content/blocks/quizshowGame/AnswerPanel.vue +31 -24
- package/components/content/blocks/quizshowGame/Gridview.vue +20 -24
- package/components/content/blocks/quizshowGame/QuizShow.vue +22 -9
- package/components/content/blocks/quizshowGame/feedbackIcons.vue +4 -2
- package/components/content/blocks/sevenStrikes/SevenStikes.vue +153 -108
- package/components/content/blocks/sevenStrikes/keyboard.vue +9 -2
- package/components/content/blocks/slideshow/SlideShow.vue +5 -3
- package/components/content/blocks/wordJumble/Jumble.vue +4 -4
- package/components/content/blocks/wordJumble/WordJumble.vue +128 -62
- package/components/settings/BucketGameSettingsManager.vue +185 -359
- package/components/settings/CrosswordPuzzleSettingsManager.vue +114 -181
- package/components/settings/FlashCardSlidesManager.vue +323 -419
- package/components/settings/MatchingGameManager.vue +357 -618
- package/components/settings/MultipleChoiceSettingsManager.vue +130 -140
- package/components/settings/QuizShowSettingsManager.vue +17 -17
- package/components/settings/SevenStrikesSettingsManager.vue +131 -193
- package/components/settings/SlideShowManager.vue +91 -129
- package/components/settings/SortingGameSettingsManager.vue +41 -153
- package/components/settings/WordJumbleSettingsManager.vue +84 -150
- package/i18n/en-US/components/content/blocks/bucket_game.ts +1 -0
- package/i18n/en-US/components/content/blocks/flashcard.ts +3 -0
- package/i18n/en-US/components/content/blocks/word_jumble.ts +2 -0
- package/i18n/en-US/components/settings/bucket_game.ts +3 -2
- package/i18n/en-US/components/settings/flashcard.ts +1 -0
- package/i18n/en-US/components/settings/matching_game.ts +1 -1
- package/i18n/en-US/components/settings/quizshow_game.ts +1 -1
- package/i18n/en-US/components/settings/seven_strikes.ts +1 -1
- package/i18n/en-US/components/settings/slideshow.ts +2 -0
- package/i18n/en-US/index.ts +2 -1
- package/i18n/es-ES/components/content/blocks/bucket_game.ts +40 -0
- package/i18n/es-ES/components/content/blocks/crossword.ts +25 -0
- package/i18n/es-ES/components/content/blocks/flashcard.ts +8 -0
- package/i18n/es-ES/components/content/blocks/index.ts +23 -0
- package/i18n/es-ES/components/content/blocks/matching_game.ts +26 -0
- package/i18n/es-ES/components/content/blocks/multiple_choice.ts +9 -0
- package/i18n/es-ES/components/content/blocks/quizshow_game.ts +35 -0
- package/i18n/es-ES/components/content/blocks/seven_strikes.ts +6 -0
- package/i18n/es-ES/components/content/blocks/slideshow.ts +13 -0
- package/i18n/es-ES/components/content/blocks/sorting_game.ts +5 -0
- package/i18n/es-ES/components/content/blocks/word_jumble.ts +11 -0
- package/i18n/es-ES/components/content/crud_table.ts +6 -0
- package/i18n/es-ES/components/content/index.ts +7 -0
- package/i18n/es-ES/components/index.ts +9 -0
- package/i18n/es-ES/components/navigation/index.ts +5 -0
- package/i18n/es-ES/components/settings/bucket_game.ts +39 -0
- package/i18n/es-ES/components/settings/crossword.ts +7 -0
- package/i18n/es-ES/components/settings/flashcard.ts +29 -0
- package/i18n/es-ES/components/settings/index.ts +23 -0
- package/i18n/es-ES/components/settings/matching_game.ts +15 -0
- package/i18n/es-ES/components/settings/multiple_choice.ts +17 -0
- package/i18n/es-ES/components/settings/quizshow_game.ts +20 -0
- package/i18n/es-ES/components/settings/seven_strikes.ts +8 -0
- package/i18n/es-ES/components/settings/slideshow.ts +13 -0
- package/i18n/es-ES/components/settings/sorting_game.ts +5 -0
- package/i18n/es-ES/components/settings/word_jumble.ts +11 -0
- package/i18n/es-ES/index.ts +16 -0
- package/i18n/es-ES/modules/index.ts +5 -0
- package/i18n/es-ES/pages/index.ts +5 -0
- package/i18n/es-ES/shared/content_blocks.ts +18 -0
- package/i18n/es-ES/shared/index.ts +7 -0
- package/i18n/es-ES/shared/settings.ts +14 -0
- package/i18n/index.ts +11 -0
- package/i18n/sv-SE/components/content/blocks/bucket_game.ts +40 -0
- package/i18n/sv-SE/components/content/blocks/crossword.ts +20 -0
- package/i18n/sv-SE/components/content/blocks/flashcard.ts +8 -0
- package/i18n/sv-SE/components/content/blocks/index.ts +23 -0
- package/i18n/sv-SE/components/content/blocks/matching_game.ts +25 -0
- package/i18n/sv-SE/components/content/blocks/multiple_choice.ts +9 -0
- package/i18n/sv-SE/components/content/blocks/quizshow_game.ts +35 -0
- package/i18n/sv-SE/components/content/blocks/seven_strikes.ts +6 -0
- package/i18n/sv-SE/components/content/blocks/slideshow.ts +13 -0
- package/i18n/sv-SE/components/content/blocks/sorting_game.ts +5 -0
- package/i18n/sv-SE/components/content/blocks/word_jumble.ts +11 -0
- package/i18n/sv-SE/components/content/crud_table.ts +6 -0
- package/i18n/sv-SE/components/content/index.ts +7 -0
- package/i18n/sv-SE/components/index.ts +9 -0
- package/i18n/sv-SE/components/navigation/index.ts +5 -0
- package/i18n/sv-SE/components/settings/bucket_game.ts +38 -0
- package/i18n/sv-SE/components/settings/crossword.ts +7 -0
- package/i18n/sv-SE/components/settings/flashcard.ts +29 -0
- package/i18n/sv-SE/components/settings/index.ts +23 -0
- package/i18n/sv-SE/components/settings/matching_game.ts +15 -0
- package/i18n/sv-SE/components/settings/multiple_choice.ts +16 -0
- package/i18n/sv-SE/components/settings/quizshow_game.ts +20 -0
- package/i18n/sv-SE/components/settings/seven_strikes.ts +8 -0
- package/i18n/sv-SE/components/settings/slideshow.ts +13 -0
- package/i18n/sv-SE/components/settings/sorting_game.ts +5 -0
- package/i18n/sv-SE/components/settings/word_jumble.ts +11 -0
- package/i18n/sv-SE/index.ts +16 -0
- package/i18n/sv-SE/modules/index.ts +5 -0
- package/i18n/sv-SE/pages/index.ts +5 -0
- package/i18n/sv-SE/shared/content_blocks.ts +18 -0
- package/i18n/sv-SE/shared/index.ts +7 -0
- package/i18n/sv-SE/shared/settings.ts +14 -0
- package/package.json +1 -1
- package/plugin.js +33 -34
- package/test/Feature/LocaleKeys.spec.js +11 -0
- package/test/__mocks__/componentsMock.js +12 -0
- package/test/__mocks__/fileMock.js +1 -0
- package/test/__mocks__/modelMock.js +88 -0
- package/test/__mocks__/styleMock.js +1 -0
- package/test/blocks/crossword/CrosswordPuzzle.spec.js +1 -1
- package/test/blocks/dragDrop/BucketGame.spec.js +1 -1
- package/test/blocks/dragDrop/SortingGame.spec.js +1 -1
- package/test/blocks/flashcards/CardFace.spec.js +1 -1
- package/test/blocks/flashcards/FlashCardSlides.spec.js +1 -1
- package/test/blocks/flashcards/Flashcard.spec.js +1 -1
- package/test/blocks/matchingGame/MatchingGame.spec.js +1 -1
- package/test/blocks/multipleChoice/MultipleChoice.spec.js +1 -1
- package/test/blocks/multipleChoice/QuestionDialog.spec.js +1 -1
- package/test/blocks/quizShow/quizShow.spec.js +1 -1
- package/test/blocks/sevenStrikes/sevenStrikes.spec.js +1 -1
- package/test/blocks/slideshow/slideshow.spec.js +1 -1
- package/test/blocks/wordJumble/Jumble.spec.js +1 -1
- package/test/blocks/wordJumble/WordJumble.spec.js +1 -1
- package/test/mocks.js +8 -2
- package/test/settings/BucketGameManager.spec.js +4 -4
- package/test/settings/CrosswordPuzzleManager.spec.js +6 -11
- package/test/settings/FlashCardSlidesManager.spec.js +1 -1
- package/test/settings/MatchingGameManager.spec.js +1 -1
- package/test/settings/MultipleChoiceGameManager.spec.js +1 -1
- package/test/settings/SevenStrikesManager.spec.js +1 -1
- package/test/settings/SlideShowManager.spec.js +1 -1
- package/test/settings/SortingGameManager.spec.js +1 -1
- package/test/settings/WordJumbleManager.spec.js +1 -4
- package/i18n/en-US.ts +0 -5
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
<v-btn color="primary" dark class="mb-2" @click="addNew">
|
|
15
15
|
{{
|
|
16
16
|
$t(
|
|
17
|
-
'
|
|
17
|
+
'windward.games.components.content.crud_table.add_row'
|
|
18
18
|
)
|
|
19
19
|
}}
|
|
20
20
|
</v-btn>
|
|
@@ -34,7 +34,7 @@
|
|
|
34
34
|
>
|
|
35
35
|
{{
|
|
36
36
|
$t(
|
|
37
|
-
'
|
|
37
|
+
'windward.games.components.content.crud_table.new_item'
|
|
38
38
|
)
|
|
39
39
|
}}
|
|
40
40
|
</v-btn>
|
|
@@ -7,7 +7,9 @@
|
|
|
7
7
|
>
|
|
8
8
|
<h3 class="crossword-clues__list-title">
|
|
9
9
|
{{
|
|
10
|
-
$t(
|
|
10
|
+
$t(
|
|
11
|
+
`windward.games.components.content.blocks.crossword.down`
|
|
12
|
+
)
|
|
11
13
|
}}
|
|
12
14
|
</h3>
|
|
13
15
|
<v-list dense>
|
|
@@ -33,7 +35,7 @@
|
|
|
33
35
|
<h3 class="crossword-clues__list-title">
|
|
34
36
|
{{
|
|
35
37
|
$t(
|
|
36
|
-
`
|
|
38
|
+
`windward.games.components.content.blocks.crossword.across`
|
|
37
39
|
)
|
|
38
40
|
}}
|
|
39
41
|
</h3>
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<v-container>
|
|
3
3
|
<div>
|
|
4
|
-
<
|
|
4
|
+
<h3>{{ block.metadata.config.title }}</h3>
|
|
5
5
|
<p>{{ block.metadata.config.instructions }}</p>
|
|
6
6
|
</div>
|
|
7
7
|
<v-alert v-if="wordMap.length === 0" type="info" class="text-center">
|
|
8
8
|
<p>
|
|
9
9
|
{{
|
|
10
10
|
$t(
|
|
11
|
-
'
|
|
11
|
+
'windward.games.components.content.blocks.crossword.initial_setup'
|
|
12
12
|
)
|
|
13
13
|
}}
|
|
14
14
|
</p>
|
|
@@ -21,7 +21,7 @@
|
|
|
21
21
|
<p>
|
|
22
22
|
{{
|
|
23
23
|
$t(
|
|
24
|
-
'
|
|
24
|
+
'windward.games.components.content.blocks.crossword.validation_error'
|
|
25
25
|
)
|
|
26
26
|
}}
|
|
27
27
|
</p>
|
|
@@ -91,7 +91,7 @@
|
|
|
91
91
|
>
|
|
92
92
|
{{
|
|
93
93
|
$t(
|
|
94
|
-
'
|
|
94
|
+
'windward.games.components.content.blocks.crossword.play_again'
|
|
95
95
|
)
|
|
96
96
|
}}
|
|
97
97
|
</v-btn>
|
|
@@ -126,7 +126,9 @@ export default {
|
|
|
126
126
|
this.block.metadata.config = {}
|
|
127
127
|
}
|
|
128
128
|
if (_.isEmpty(this.block.metadata.config.title)) {
|
|
129
|
-
this.block.metadata.config.title =
|
|
129
|
+
this.block.metadata.config.title = this.$t(
|
|
130
|
+
'windward.games.components.content.blocks.crossword.crossword'
|
|
131
|
+
)
|
|
130
132
|
}
|
|
131
133
|
if (_.isEmpty(this.block.metadata.config.instructions)) {
|
|
132
134
|
this.block.metadata.config.instructions = ''
|
|
@@ -249,7 +251,7 @@ export default {
|
|
|
249
251
|
|
|
250
252
|
if (_.isEmpty(this.wordMap)) {
|
|
251
253
|
this.error = this.$t(
|
|
252
|
-
'
|
|
254
|
+
'windward.games.components.content.blocks.crossword.error.min_words'
|
|
253
255
|
)
|
|
254
256
|
} else {
|
|
255
257
|
// checks if there are any words that don't share letters with any others
|
|
@@ -257,22 +259,22 @@ export default {
|
|
|
257
259
|
|
|
258
260
|
if (this.wordMap.length < 2) {
|
|
259
261
|
this.error = this.$t(
|
|
260
|
-
'
|
|
262
|
+
'windward.games.components.content.blocks.crossword.error.min_words'
|
|
261
263
|
)
|
|
262
264
|
} else if (letterCheck.length > 0) {
|
|
263
265
|
// if a word doesn't share letters load with dummy data and alert the user
|
|
264
266
|
let words = letterCheck.toString()
|
|
265
267
|
this.error = this.$t(
|
|
266
|
-
'
|
|
268
|
+
'windward.games.components.content.blocks.crossword.error.words_no_shared_letters',
|
|
267
269
|
[words]
|
|
268
270
|
)
|
|
269
271
|
} else if (!this.validateWordMaxLength(this.wordMap)) {
|
|
270
272
|
this.error = this.$t(
|
|
271
|
-
'
|
|
273
|
+
'windward.games.components.content.blocks.crossword.error.word_length_max_limit'
|
|
272
274
|
)
|
|
273
275
|
} else if (!this.validateWordMinLength(this.wordMap)) {
|
|
274
276
|
this.error = this.$t(
|
|
275
|
-
'
|
|
277
|
+
'windward.games.components.content.blocks.crossword.error.word_length_min_limit'
|
|
276
278
|
)
|
|
277
279
|
}
|
|
278
280
|
}
|
|
@@ -435,14 +437,14 @@ export default {
|
|
|
435
437
|
|
|
436
438
|
if (grid.length > MATRIX_LENGTH) {
|
|
437
439
|
this.error = this.$t(
|
|
438
|
-
'
|
|
440
|
+
'windward.games.components.content.blocks.crossword.error.could_not_generate'
|
|
439
441
|
)
|
|
440
442
|
return false
|
|
441
443
|
}
|
|
442
444
|
|
|
443
445
|
if (_.isEmpty(grid)) {
|
|
444
446
|
this.error = this.$t(
|
|
445
|
-
'
|
|
447
|
+
'windward.games.components.content.blocks.crossword.error.unknown'
|
|
446
448
|
)
|
|
447
449
|
|
|
448
450
|
return false
|
|
@@ -1,9 +1,16 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<div>
|
|
3
3
|
<div>
|
|
4
|
-
<
|
|
4
|
+
<h3
|
|
5
|
+
:aria-label="
|
|
6
|
+
$t(
|
|
7
|
+
'windward.games.components.content.blocks.bucket_game.aria_title'
|
|
8
|
+
)
|
|
9
|
+
"
|
|
10
|
+
tabindex="0"
|
|
11
|
+
>
|
|
5
12
|
{{ block.metadata.config.title }}
|
|
6
|
-
</
|
|
13
|
+
</h3>
|
|
7
14
|
|
|
8
15
|
<p tabindex="0">
|
|
9
16
|
{{ block.metadata.config.instructions }}
|
|
@@ -11,37 +18,38 @@
|
|
|
11
18
|
<h4 v-if="!render" class="d-flex justify-center align-center">
|
|
12
19
|
{{
|
|
13
20
|
$t(
|
|
14
|
-
'
|
|
21
|
+
'windward.games.components.content.blocks.bucket_game.cannot'
|
|
15
22
|
)
|
|
16
23
|
}}
|
|
17
24
|
</h4>
|
|
18
|
-
<v-container fluid :class="status"
|
|
19
|
-
<
|
|
20
|
-
<v-row>
|
|
25
|
+
<v-container fluid :class="status">
|
|
26
|
+
<v-row class="pa-4">
|
|
21
27
|
<v-col></v-col>
|
|
22
|
-
<v-col class="d-flex justify-center">{{
|
|
28
|
+
<v-col class="d-flex justify-center align-center">{{
|
|
23
29
|
feedback
|
|
24
30
|
? feedback
|
|
25
31
|
: $t(
|
|
26
|
-
'
|
|
32
|
+
'windward.games.components.content.blocks.bucket_game.form.feedback.feedback_here'
|
|
27
33
|
)
|
|
28
34
|
}}</v-col>
|
|
29
35
|
<v-col class="d-flex justify-end pl-4">
|
|
30
36
|
<v-btn
|
|
31
|
-
v-if="
|
|
32
|
-
status === 'successOutline' ||
|
|
33
|
-
status === 'errorOutline'
|
|
34
|
-
"
|
|
37
|
+
v-if="status === 'successOutline'"
|
|
35
38
|
class="mr-5"
|
|
36
|
-
|
|
37
|
-
status == 'successOutline' ? 'success' : 'error'
|
|
38
|
-
"
|
|
39
|
+
color="success"
|
|
39
40
|
@click="continueGame"
|
|
40
41
|
>{{ $t('shared.forms.continue') }}
|
|
41
|
-
</v-btn
|
|
42
|
-
|
|
42
|
+
</v-btn>
|
|
43
|
+
<v-container
|
|
44
|
+
v-if="status === 'errorOutline'"
|
|
45
|
+
class="d-flex justify-end"
|
|
46
|
+
@click="continueGame"
|
|
47
|
+
><v-icon class="icon--error" color="error"
|
|
48
|
+
>mdi-close-circle</v-icon
|
|
49
|
+
>
|
|
50
|
+
</v-container>
|
|
51
|
+
</v-col>
|
|
43
52
|
</v-row>
|
|
44
|
-
<br />
|
|
45
53
|
</v-container>
|
|
46
54
|
<div v-if="render">
|
|
47
55
|
<v-container>
|
|
@@ -54,14 +62,14 @@
|
|
|
54
62
|
>
|
|
55
63
|
<v-row align="center" class="col-md-10">
|
|
56
64
|
<v-card
|
|
65
|
+
v-if="mainAnswer[0]"
|
|
57
66
|
class="pa-2 flex-fill"
|
|
58
67
|
outlined
|
|
59
68
|
tile
|
|
60
|
-
v-if="mainAnswer[0]"
|
|
61
69
|
>
|
|
62
70
|
<v-icon>mdi-drag-vertical</v-icon>
|
|
63
71
|
|
|
64
|
-
<span class="text-justify">{{
|
|
72
|
+
<span class="text-justify span-bold">{{
|
|
65
73
|
mainAnswer[counter].display
|
|
66
74
|
? mainAnswer[counter].display
|
|
67
75
|
: ''
|
|
@@ -84,15 +92,18 @@
|
|
|
84
92
|
tile
|
|
85
93
|
:color="
|
|
86
94
|
block.metadata.config.bucket_titles[bindex]
|
|
87
|
-
.
|
|
95
|
+
? block.metadata.config.bucket_titles[
|
|
96
|
+
bindex
|
|
97
|
+
].color
|
|
98
|
+
: ''
|
|
88
99
|
"
|
|
89
100
|
>
|
|
90
101
|
<v-card-text class="text-center">
|
|
91
102
|
<draggable
|
|
103
|
+
v-model="items[bindex]"
|
|
92
104
|
:key="'bucket - ' + bindex"
|
|
93
105
|
disabled
|
|
94
106
|
group="people"
|
|
95
|
-
v-model="items[bindex]"
|
|
96
107
|
@change="change($event, bindex)"
|
|
97
108
|
:move="checkMove"
|
|
98
109
|
tabindex="0"
|
|
@@ -100,7 +111,11 @@
|
|
|
100
111
|
<div class="card_text">
|
|
101
112
|
{{
|
|
102
113
|
block.metadata.config
|
|
103
|
-
.bucket_titles[bindex]
|
|
114
|
+
.bucket_titles[bindex]
|
|
115
|
+
? block.metadata.config
|
|
116
|
+
.bucket_titles[bindex]
|
|
117
|
+
.title
|
|
118
|
+
: ''
|
|
104
119
|
}}
|
|
105
120
|
</div>
|
|
106
121
|
</draggable></v-card-text
|
|
@@ -122,14 +137,14 @@
|
|
|
122
137
|
>
|
|
123
138
|
<v-row align="center" class="col-md-10">
|
|
124
139
|
<v-card
|
|
125
|
-
class="pa-2 flex-fill"
|
|
126
|
-
outlined
|
|
127
|
-
tile
|
|
128
140
|
v-if="
|
|
129
141
|
block.metadata.config.bucket_answers[
|
|
130
142
|
startingIndex
|
|
131
143
|
]
|
|
132
144
|
"
|
|
145
|
+
class="pa-2 flex-fill"
|
|
146
|
+
outlined
|
|
147
|
+
tile
|
|
133
148
|
>
|
|
134
149
|
<v-icon>mdi-drag-vertical</v-icon>
|
|
135
150
|
|
|
@@ -199,7 +214,7 @@
|
|
|
199
214
|
tabindex="0"
|
|
200
215
|
:aria-label="
|
|
201
216
|
$t(
|
|
202
|
-
'
|
|
217
|
+
'windward.games.components.content.blocks.matching_game.of_complete',
|
|
203
218
|
[completedAmount, totalAmountQuestions]
|
|
204
219
|
)
|
|
205
220
|
"
|
|
@@ -207,16 +222,17 @@
|
|
|
207
222
|
<v-col align="end" tabindex="0">
|
|
208
223
|
{{
|
|
209
224
|
$t(
|
|
210
|
-
'
|
|
225
|
+
'windward.games.components.content.blocks.matching_game.of_complete_text_area',
|
|
211
226
|
[completedAmount, totalAmountQuestions]
|
|
212
227
|
)
|
|
213
228
|
}}
|
|
214
229
|
<v-progress-linear
|
|
230
|
+
v-model="completedPercent"
|
|
215
231
|
color="primary"
|
|
216
232
|
outlined
|
|
217
|
-
v-model="completedPercent"
|
|
218
233
|
rounded
|
|
219
234
|
height="15"
|
|
235
|
+
style="pointer-events: none"
|
|
220
236
|
></v-progress-linear>
|
|
221
237
|
<br />
|
|
222
238
|
<v-btn color="primary" outlined @click="onReset"
|
|
@@ -251,7 +267,7 @@ export default {
|
|
|
251
267
|
}
|
|
252
268
|
if (_.isEmpty(this.block.metadata.config.title)) {
|
|
253
269
|
this.block.metadata.config.title = this.$t(
|
|
254
|
-
'
|
|
270
|
+
'windward.games.components.content.blocks.bucket_game.game_title'
|
|
255
271
|
)
|
|
256
272
|
}
|
|
257
273
|
if (_.isEmpty(this.block.metadata.config.instructions)) {
|
|
@@ -259,12 +275,12 @@ export default {
|
|
|
259
275
|
}
|
|
260
276
|
if (_.isEmpty(this.block.metadata.config.feedback_correct)) {
|
|
261
277
|
this.block.metadata.config.feedback_correct = this.$t(
|
|
262
|
-
'
|
|
278
|
+
'windward.games.components.settings.bucket_game.form.feedback.correct_default'
|
|
263
279
|
)
|
|
264
280
|
}
|
|
265
281
|
if (_.isEmpty(this.block.metadata.config.feedback_incorrect)) {
|
|
266
282
|
this.block.metadata.config.feedback_incorrect = this.$t(
|
|
267
|
-
'
|
|
283
|
+
'windward.games.components.settings.bucket_game.form.feedback.incorrect_default'
|
|
268
284
|
)
|
|
269
285
|
}
|
|
270
286
|
if (_.isEmpty(this.block.metadata.config.bucket_titles)) {
|
|
@@ -275,7 +291,7 @@ export default {
|
|
|
275
291
|
}
|
|
276
292
|
if (_.isEmpty(this.block.body)) {
|
|
277
293
|
this.block.body = this.$t(
|
|
278
|
-
'
|
|
294
|
+
'windward.games.components.content.blocks.bucket_game.game_title'
|
|
279
295
|
)
|
|
280
296
|
}
|
|
281
297
|
},
|
|
@@ -285,28 +301,7 @@ export default {
|
|
|
285
301
|
instructions: '',
|
|
286
302
|
feedback: '',
|
|
287
303
|
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
304
|
items: [],
|
|
308
|
-
dialogDelete: false,
|
|
309
|
-
bucketDeleteIndex: 0,
|
|
310
305
|
status: 'default',
|
|
311
306
|
allow_drag: true,
|
|
312
307
|
mainAnswer: [],
|
|
@@ -356,6 +351,8 @@ export default {
|
|
|
356
351
|
return false
|
|
357
352
|
},
|
|
358
353
|
setUpGame() {
|
|
354
|
+
// reset so we don't carry over any empty arrays
|
|
355
|
+
this.items = []
|
|
359
356
|
this.block.metadata.config.bucket_titles.forEach((element) => {
|
|
360
357
|
let index =
|
|
361
358
|
this.block.metadata.config.bucket_titles.indexOf(element)
|
|
@@ -399,32 +396,6 @@ export default {
|
|
|
399
396
|
}
|
|
400
397
|
return this.shuffle(_.flatten(result))
|
|
401
398
|
},
|
|
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
399
|
onMoveCallback(evt, originalEvent) {
|
|
429
400
|
const item = evt.draggedContext.element
|
|
430
401
|
const itemIdx = evt.draggedContext.futureIndex
|
|
@@ -441,9 +412,6 @@ export default {
|
|
|
441
412
|
|
|
442
413
|
return false
|
|
443
414
|
},
|
|
444
|
-
onDropCallback(evt, originalEvent) {
|
|
445
|
-
console.log('dropped', evt)
|
|
446
|
-
},
|
|
447
415
|
change(evt, bucket_index) {
|
|
448
416
|
this.allow_drag = false
|
|
449
417
|
if (
|
|
@@ -462,7 +430,7 @@ export default {
|
|
|
462
430
|
this.status = 'successOutline'
|
|
463
431
|
} else if (this.mainAnswer.length === 0) {
|
|
464
432
|
this.feedback = this.$t(
|
|
465
|
-
'
|
|
433
|
+
'windward.games.components.content.blocks.matching_game.congratulations_feedback'
|
|
466
434
|
)
|
|
467
435
|
} else {
|
|
468
436
|
let items = this.items[bucket_index]
|
|
@@ -500,23 +468,8 @@ export default {
|
|
|
500
468
|
border: 4px solid var(--v-error-base);
|
|
501
469
|
color: var(--v-error-base);
|
|
502
470
|
}
|
|
503
|
-
.
|
|
504
|
-
|
|
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;
|
|
471
|
+
.span-bold {
|
|
472
|
+
font-weight: bold;
|
|
520
473
|
}
|
|
521
474
|
.bucket {
|
|
522
475
|
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
|
-
|
|
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
|
|
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-
|
|
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="
|
|
59
|
+
<v-col cols="10">
|
|
43
60
|
<v-card
|
|
44
61
|
:class="
|
|
45
62
|
'pa-2 flex-fill bucket ' +
|
|
@@ -54,35 +71,35 @@
|
|
|
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-
|
|
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
|
+
'windward.games.components.content.blocks.sorting_game.check_answers'
|
|
69
87
|
)
|
|
70
88
|
}}
|
|
71
89
|
</v-btn>
|
|
72
90
|
</v-row>
|
|
73
91
|
<v-row
|
|
74
92
|
v-if="isFail() || isSuccess()"
|
|
75
|
-
class="d-flex justify-
|
|
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
|
>
|
|
85
|
-
<v-btn color="primary"
|
|
102
|
+
<v-btn color="primary" elevation="0" @click="reset"
|
|
86
103
|
>{{ $t('shared.forms.reset') }}
|
|
87
104
|
</v-btn>
|
|
88
105
|
</v-row>
|
|
@@ -151,17 +168,17 @@ export default {
|
|
|
151
168
|
}
|
|
152
169
|
if (_.isEmpty(this.block.metadata.config.title)) {
|
|
153
170
|
this.block.metadata.config.title = this.$t(
|
|
154
|
-
'
|
|
171
|
+
'windward.games.components.settings.sorting_game.sortable_game'
|
|
155
172
|
)
|
|
156
173
|
}
|
|
157
174
|
if (_.isEmpty(this.block.metadata.config.feedback_correct)) {
|
|
158
175
|
this.block.metadata.config.feedback_correct = this.$t(
|
|
159
|
-
'
|
|
176
|
+
'windward.games.components.settings.bucket_game.form.feedback.correct_default'
|
|
160
177
|
)
|
|
161
178
|
}
|
|
162
179
|
if (_.isEmpty(this.block.metadata.config.feedback_incorrect)) {
|
|
163
180
|
this.block.metadata.config.feedback_incorrect = this.$t(
|
|
164
|
-
'
|
|
181
|
+
'windward.games.components.settings.bucket_game.form.feedback.incorrect_default'
|
|
165
182
|
)
|
|
166
183
|
}
|
|
167
184
|
if (_.isEmpty(this.block.metadata.config.answer)) {
|
|
@@ -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
|
-
|
|
367
|
-
color: white;
|
|
368
|
-
border-radius: 25px;
|
|
384
|
+
color: var(--v-error-base);
|
|
369
385
|
}
|
|
370
386
|
.icon--success {
|
|
371
|
-
|
|
372
|
-
color: white;
|
|
373
|
-
border-radius: 25px;
|
|
387
|
+
color: var(--v-success-base);
|
|
374
388
|
}
|
|
375
389
|
</style>
|