@windward/games 0.3.0 → 0.4.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 +8 -4
- package/components/content/DatableEditor.vue +1 -0
- package/components/content/blocks/crosswordPuzzle/CrosswordPuzzle.vue +2 -1
- package/components/content/blocks/dragDrop/BucketGame.vue +4 -3
- package/components/content/blocks/dragDrop/SortingGame.vue +2 -1
- package/components/content/blocks/flashcards/CardFace.vue +48 -9
- package/components/content/blocks/flashcards/Flashcard.vue +26 -17
- package/components/content/blocks/flashcards/FlashcardSlides.vue +10 -5
- package/components/content/blocks/matchingGame/MatchingGame.vue +76 -50
- package/components/content/blocks/multipleChoice/MultipleChoice.vue +5 -1
- package/components/content/blocks/multipleChoice/QuestionDialog.vue +2 -0
- package/components/content/blocks/quizshowGame/AnswerPanel.vue +1 -0
- package/components/content/blocks/quizshowGame/Gridview.vue +1 -0
- package/components/content/blocks/quizshowGame/QuizShow.vue +5 -2
- package/components/content/blocks/sevenStrikes/SevenStikes.vue +8 -2
- package/components/content/blocks/slideshow/SlideShow.vue +31 -22
- package/components/content/blocks/wordJumble/WordJumble.vue +7 -2
- package/components/settings/BucketGameSettingsManager.vue +5 -1
- package/components/settings/CrosswordPuzzleSettingsManager.vue +1 -0
- package/components/settings/FlashCardSlidesManager.vue +165 -107
- package/components/settings/MatchingGameManager.vue +31 -0
- package/components/settings/MultipleChoiceSettingsManager.vue +1 -0
- package/components/settings/QuizShowSettingsManager.vue +3 -0
- package/components/settings/SevenStrikesSettingsManager.vue +1 -0
- package/components/settings/SlideShowManager.vue +32 -12
- package/components/settings/SortingGameSettingsManager.vue +1 -0
- package/components/settings/WordJumbleSettingsManager.vue +1 -0
- package/i18n/en-US/components/content/blocks/slideshow.ts +1 -3
- package/i18n/en-US/components/settings/seven_strikes.ts +1 -1
- package/i18n/es-ES/components/content/blocks/slideshow.ts +0 -2
- package/i18n/es-ES/components/settings/seven_strikes.ts +1 -1
- package/i18n/sv-SE/components/content/blocks/slideshow.ts +0 -2
- package/i18n/sv-SE/components/settings/seven_strikes.ts +1 -1
- package/package.json +1 -1
- package/test/blocks/flashcards/CardFace.spec.js +2 -0
- package/test/blocks/flashcards/Flashcard.spec.js +1 -0
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
<v-toolbar-title> {{ title }}</v-toolbar-title>
|
|
12
12
|
<v-divider class="mx-4" inset vertical></v-divider>
|
|
13
13
|
<v-spacer></v-spacer>
|
|
14
|
-
<v-btn color="primary" dark class="mb-2" @click="addNew">
|
|
14
|
+
<v-btn color="primary" elevation="0" dark class="mb-2" @click="addNew">
|
|
15
15
|
{{
|
|
16
16
|
$t(
|
|
17
17
|
'windward.games.components.content.crud_table.add_row'
|
|
@@ -27,6 +27,7 @@
|
|
|
27
27
|
<template #activator="{ on, attrs }">
|
|
28
28
|
<v-btn
|
|
29
29
|
color="primary"
|
|
30
|
+
elevation="0"
|
|
30
31
|
dark
|
|
31
32
|
class="mb-2"
|
|
32
33
|
v-bind="attrs"
|
|
@@ -71,12 +72,13 @@
|
|
|
71
72
|
<v-spacer></v-spacer>
|
|
72
73
|
<v-btn
|
|
73
74
|
color="blue darken-1"
|
|
75
|
+
elevation="0"
|
|
74
76
|
text
|
|
75
77
|
@click="close"
|
|
76
78
|
>
|
|
77
79
|
{{ $t('shared.forms.cancel') }}
|
|
78
80
|
</v-btn>
|
|
79
|
-
<v-btn color="blue darken-1" text @click="save">
|
|
81
|
+
<v-btn color="blue darken-1" elevation="0" text @click="save">
|
|
80
82
|
{{ $t('shared.forms.save') }}
|
|
81
83
|
</v-btn>
|
|
82
84
|
</v-card-actions>
|
|
@@ -91,12 +93,14 @@
|
|
|
91
93
|
<v-spacer></v-spacer>
|
|
92
94
|
<v-btn
|
|
93
95
|
color="blue darken-1"
|
|
96
|
+
elevation="0"
|
|
94
97
|
text
|
|
95
98
|
@click="closeDelete"
|
|
96
99
|
>{{ $t('shared.forms.cancel') }}
|
|
97
100
|
</v-btn>
|
|
98
101
|
<v-btn
|
|
99
102
|
color="blue darken-1"
|
|
103
|
+
elevation="0"
|
|
100
104
|
text
|
|
101
105
|
@click="deleteItemConfirm"
|
|
102
106
|
>{{ $t('shared.forms.confirm') }}
|
|
@@ -127,7 +131,7 @@
|
|
|
127
131
|
@input="onDropCallback"
|
|
128
132
|
>
|
|
129
133
|
<template #item.actions="{ item }">
|
|
130
|
-
<v-btn outlined v-if="useModal">
|
|
134
|
+
<v-btn outlined elevation="0" v-if="useModal">
|
|
131
135
|
<span class="sr-only">
|
|
132
136
|
{{ $t('shared.forms.edit') }}</span
|
|
133
137
|
>
|
|
@@ -139,7 +143,7 @@
|
|
|
139
143
|
mdi-pencil
|
|
140
144
|
</v-icon>
|
|
141
145
|
</v-btn>
|
|
142
|
-
<v-btn outlined>
|
|
146
|
+
<v-btn outlined elevation="0">
|
|
143
147
|
<span class="sr-only">
|
|
144
148
|
{{ $t('shared.forms.delete') }}</span
|
|
145
149
|
>
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<v-container>
|
|
3
3
|
<div>
|
|
4
|
-
<
|
|
4
|
+
<h2>{{ block.metadata.config.title }}</h2>
|
|
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">
|
|
@@ -86,6 +86,7 @@
|
|
|
86
86
|
<v-col cols="12" class="d-flex justify-center">
|
|
87
87
|
<v-btn
|
|
88
88
|
color="primary"
|
|
89
|
+
elevation="0"
|
|
89
90
|
outlined
|
|
90
91
|
class="ma-3"
|
|
91
92
|
@click="onSetUpData"
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<div>
|
|
3
3
|
<div>
|
|
4
|
-
<
|
|
4
|
+
<h2
|
|
5
5
|
:aria-label="
|
|
6
6
|
$t(
|
|
7
7
|
'windward.games.components.content.blocks.bucket_game.aria_title'
|
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
tabindex="0"
|
|
11
11
|
>
|
|
12
12
|
{{ block.metadata.config.title }}
|
|
13
|
-
</
|
|
13
|
+
</h2>
|
|
14
14
|
|
|
15
15
|
<p tabindex="0">
|
|
16
16
|
{{ block.metadata.config.instructions }}
|
|
@@ -37,6 +37,7 @@
|
|
|
37
37
|
v-if="status === 'successOutline'"
|
|
38
38
|
class="mr-5"
|
|
39
39
|
color="success"
|
|
40
|
+
elevation="0"
|
|
40
41
|
@click="continueGame"
|
|
41
42
|
>{{ $t('shared.forms.continue') }}
|
|
42
43
|
</v-btn>
|
|
@@ -232,7 +233,7 @@
|
|
|
232
233
|
style="pointer-events: none"
|
|
233
234
|
></v-progress-linear>
|
|
234
235
|
<br />
|
|
235
|
-
<v-btn color="primary" outlined @click="onReset"
|
|
236
|
+
<v-btn color="primary" outlined elevation="0" @click="onReset"
|
|
236
237
|
>{{ $t('shared.forms.reset') }}
|
|
237
238
|
</v-btn>
|
|
238
239
|
</v-col>
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<div>
|
|
3
|
-
<
|
|
3
|
+
<h2>{{ block.metadata.config.title }}</h2>
|
|
4
4
|
<p>
|
|
5
5
|
{{ block.metadata.config.instructions }}
|
|
6
6
|
</p>
|
|
@@ -92,6 +92,7 @@
|
|
|
92
92
|
<v-btn
|
|
93
93
|
v-if="onFail()"
|
|
94
94
|
color="primary"
|
|
95
|
+
elevation="0"
|
|
95
96
|
text
|
|
96
97
|
@click="onContinueGame"
|
|
97
98
|
>{{ $t('shared.forms.try_again') }} </v-btn
|
|
@@ -7,16 +7,16 @@
|
|
|
7
7
|
</v-row>
|
|
8
8
|
<br />
|
|
9
9
|
<v-row
|
|
10
|
+
v-if="imagePublicUrl"
|
|
10
11
|
no-gutters
|
|
11
12
|
align="center"
|
|
12
13
|
justify="center"
|
|
13
|
-
v-if="settings.img !== ''"
|
|
14
14
|
>
|
|
15
15
|
<v-img
|
|
16
16
|
contain
|
|
17
17
|
:aspect-ratio="16 / 9"
|
|
18
|
-
:src="
|
|
19
|
-
:alt="
|
|
18
|
+
:src="imagePublicUrl"
|
|
19
|
+
:alt="imageAlt"
|
|
20
20
|
max-height="210"
|
|
21
21
|
max-width="600"
|
|
22
22
|
/>
|
|
@@ -31,19 +31,22 @@
|
|
|
31
31
|
</template>
|
|
32
32
|
|
|
33
33
|
<script>
|
|
34
|
+
import _ from 'lodash'
|
|
34
35
|
import { MathHelper, ContentViewer } from '@windward/core/utils'
|
|
36
|
+
import Uuid from '~/helpers/Uuid'
|
|
35
37
|
|
|
36
38
|
export default {
|
|
37
39
|
name: 'CardFace',
|
|
38
40
|
components: { ContentViewer },
|
|
39
41
|
props: {
|
|
40
|
-
settings: { type: Object },
|
|
41
|
-
side: { type: String },
|
|
42
|
+
settings: { type: Object, required: true },
|
|
43
|
+
side: { type: String, required: true },
|
|
44
|
+
assets: { type: Array, required: true },
|
|
42
45
|
},
|
|
43
46
|
computed: {
|
|
44
47
|
textClass() {
|
|
45
48
|
if (
|
|
46
|
-
!this.settings.
|
|
49
|
+
!this.settings.imageAsset &&
|
|
47
50
|
this.settings.text &&
|
|
48
51
|
this.settings.text.length < 100 &&
|
|
49
52
|
this.side === 'front'
|
|
@@ -55,7 +58,7 @@ export default {
|
|
|
55
58
|
return 'text-center card-content--bold'
|
|
56
59
|
}
|
|
57
60
|
if (
|
|
58
|
-
!this.settings.
|
|
61
|
+
!this.settings.imageAsset &&
|
|
59
62
|
this.settings.text &&
|
|
60
63
|
(MathHelper.containsMathML(this.settings.text.length) ||
|
|
61
64
|
MathHelper.containsLatex(this.settings.text.length))
|
|
@@ -63,11 +66,47 @@ export default {
|
|
|
63
66
|
return 'text-justify centered'
|
|
64
67
|
}
|
|
65
68
|
|
|
66
|
-
|
|
67
69
|
return 'px-6 text-justify'
|
|
68
70
|
},
|
|
71
|
+
imageAsset() {
|
|
72
|
+
if (!this.settings.imageAsset) {
|
|
73
|
+
return null
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
let image = _.cloneDeep(this.settings.imageAsset)
|
|
77
|
+
|
|
78
|
+
// If the file is linked then resolve it first
|
|
79
|
+
// Otherwise it's a hard link that we can just return
|
|
80
|
+
if (image && image.file_asset_id !== null) {
|
|
81
|
+
image = this.getAssetByFileAssetId(image.file_asset_id)
|
|
82
|
+
}
|
|
83
|
+
return image
|
|
84
|
+
},
|
|
85
|
+
imagePublicUrl() {
|
|
86
|
+
return _.get(this.imageAsset, 'asset.public_url', '')
|
|
87
|
+
},
|
|
88
|
+
imageAlt() {
|
|
89
|
+
// Default to user defined alt but fallback to global alt
|
|
90
|
+
if (this.settings.imageAlt) {
|
|
91
|
+
return this.settings.imageAlt
|
|
92
|
+
} else {
|
|
93
|
+
return _.get(this.imageAsset, 'asset.metadata.props.alt', '')
|
|
94
|
+
}
|
|
95
|
+
},
|
|
96
|
+
},
|
|
97
|
+
methods: {
|
|
98
|
+
getAssetByFileAssetId(fileAssetId) {
|
|
99
|
+
// Not a uuid. Instant fail
|
|
100
|
+
if (!Uuid.test(fileAssetId)) {
|
|
101
|
+
return null
|
|
102
|
+
}
|
|
103
|
+
const foundAsset = this.assets.find((asset) => {
|
|
104
|
+
return _.get(asset, 'file_asset_id', null) === fileAssetId
|
|
105
|
+
})
|
|
106
|
+
|
|
107
|
+
return foundAsset || null
|
|
108
|
+
},
|
|
69
109
|
},
|
|
70
|
-
methods: {},
|
|
71
110
|
}
|
|
72
111
|
</script>
|
|
73
112
|
|
|
@@ -2,7 +2,11 @@
|
|
|
2
2
|
<v-container style="height: 100%" class="div-container">
|
|
3
3
|
<v-card outlined @click="toggleCard" v-show="value" :class="cardClass">
|
|
4
4
|
<v-card-text>
|
|
5
|
-
<
|
|
5
|
+
<CardFace
|
|
6
|
+
side="front"
|
|
7
|
+
:settings="frontFace"
|
|
8
|
+
:assets="assets"
|
|
9
|
+
></CardFace>
|
|
6
10
|
</v-card-text>
|
|
7
11
|
</v-card>
|
|
8
12
|
<v-card outlined @click="toggleCard" v-show="!value" :class="cardClass">
|
|
@@ -12,7 +16,11 @@
|
|
|
12
16
|
}}</v-row>
|
|
13
17
|
</v-card-title>
|
|
14
18
|
<v-card-text>
|
|
15
|
-
<
|
|
19
|
+
<CardFace
|
|
20
|
+
side="back"
|
|
21
|
+
:settings="backFace"
|
|
22
|
+
:assets="assets"
|
|
23
|
+
></CardFace>
|
|
16
24
|
</v-card-text>
|
|
17
25
|
</v-card>
|
|
18
26
|
</v-container>
|
|
@@ -29,9 +37,10 @@ export default {
|
|
|
29
37
|
}
|
|
30
38
|
},
|
|
31
39
|
props: {
|
|
40
|
+
value: { type: Boolean, required: false, default: false },
|
|
32
41
|
options: { type: Object, default: {} },
|
|
33
42
|
slide: { type: Number, required: true, default: 0 },
|
|
34
|
-
|
|
43
|
+
assets: { type: Array, required: true },
|
|
35
44
|
},
|
|
36
45
|
|
|
37
46
|
computed: {
|
|
@@ -41,11 +50,17 @@ export default {
|
|
|
41
50
|
result = result + ' flipInY'
|
|
42
51
|
}
|
|
43
52
|
|
|
44
|
-
if (
|
|
53
|
+
if (
|
|
54
|
+
this.frontFace.imageAsset === '' &&
|
|
55
|
+
this.backFace.imageAsset === ''
|
|
56
|
+
) {
|
|
45
57
|
result = result + ' flashcard--size-md'
|
|
46
58
|
}
|
|
47
59
|
|
|
48
|
-
if (
|
|
60
|
+
if (
|
|
61
|
+
this.frontFace.imageAsset !== '' ||
|
|
62
|
+
this.backFace.imageAsset !== ''
|
|
63
|
+
) {
|
|
49
64
|
result = result + ' flashcard--size-lg'
|
|
50
65
|
}
|
|
51
66
|
|
|
@@ -53,12 +68,9 @@ export default {
|
|
|
53
68
|
},
|
|
54
69
|
frontFace() {
|
|
55
70
|
return {
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
: '',
|
|
60
|
-
altText: this.options.front.imgAltText
|
|
61
|
-
? this.options.front.imgAltText
|
|
71
|
+
imageAsset: this.options.front.imageAsset,
|
|
72
|
+
imageAlt: this.options.front.imageAlt
|
|
73
|
+
? this.options.front.imageAlt
|
|
62
74
|
: '',
|
|
63
75
|
text: this.options.front.text,
|
|
64
76
|
header: this.options.front.header,
|
|
@@ -69,12 +81,9 @@ export default {
|
|
|
69
81
|
},
|
|
70
82
|
backFace() {
|
|
71
83
|
return {
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
: '',
|
|
76
|
-
altText: this.options.back.imgAltText
|
|
77
|
-
? this.options.back.imgAltText
|
|
84
|
+
imageAsset: this.options.back.imageAsset,
|
|
85
|
+
imageAlt: this.options.back.imageAlt
|
|
86
|
+
? this.options.back.imageAlt
|
|
78
87
|
: '',
|
|
79
88
|
text: this.options.back.text,
|
|
80
89
|
header: this.options.back.header,
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<div>
|
|
3
|
-
<
|
|
3
|
+
<h2 v-if="block.metadata.config.title">
|
|
4
4
|
{{ block.metadata.config.title }}
|
|
5
|
-
</
|
|
5
|
+
</h2>
|
|
6
6
|
|
|
7
7
|
<p v-if="block.metadata.config.instructions">
|
|
8
8
|
{{ block.metadata.config.instructions }}
|
|
@@ -13,6 +13,7 @@
|
|
|
13
13
|
<v-btn
|
|
14
14
|
variant="elevated"
|
|
15
15
|
color="primary"
|
|
16
|
+
elevation="0"
|
|
16
17
|
outlined
|
|
17
18
|
fab
|
|
18
19
|
small
|
|
@@ -25,6 +26,7 @@
|
|
|
25
26
|
<v-btn
|
|
26
27
|
variant="elevated"
|
|
27
28
|
color="primary"
|
|
29
|
+
elevation="0"
|
|
28
30
|
outlined
|
|
29
31
|
fab
|
|
30
32
|
small
|
|
@@ -38,12 +40,12 @@
|
|
|
38
40
|
:key="index"
|
|
39
41
|
>
|
|
40
42
|
<v-sheet height="100%" tile>
|
|
41
|
-
<
|
|
43
|
+
<Flashcard
|
|
44
|
+
v-model="block.metadata.config.cards[index].side"
|
|
42
45
|
:options="card"
|
|
43
46
|
:slide="block.metadata.config.currentSlide"
|
|
44
|
-
v-model="block.metadata.config.cards[index].side"
|
|
45
|
-
@click=""
|
|
46
47
|
:key="seed + '-' + block.metadata.config.currentSlide"
|
|
48
|
+
:assets="block.assets"
|
|
47
49
|
/>
|
|
48
50
|
</v-sheet>
|
|
49
51
|
</v-carousel-item>
|
|
@@ -84,6 +86,9 @@ export default {
|
|
|
84
86
|
)
|
|
85
87
|
this.block.metadata.config.instructions = ''
|
|
86
88
|
}
|
|
89
|
+
if (_.isEmpty(this.block.assets)) {
|
|
90
|
+
this.block.assets = []
|
|
91
|
+
}
|
|
87
92
|
|
|
88
93
|
if (_.isEmpty(this.block.metadata.config.cards)) {
|
|
89
94
|
this.block.metadata.config.cards = []
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<div>
|
|
3
3
|
<div>
|
|
4
|
-
<
|
|
4
|
+
<h2
|
|
5
5
|
:aria-label="
|
|
6
6
|
$t(
|
|
7
7
|
'windward.games.components.content.blocks.matching_game.match_game_title'
|
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
tabindex="0"
|
|
11
11
|
>
|
|
12
12
|
{{ block.metadata.config.title }}
|
|
13
|
-
</
|
|
13
|
+
</h2>
|
|
14
14
|
|
|
15
15
|
<p tabindex="0">
|
|
16
16
|
{{ block.metadata.config.instructions }}
|
|
@@ -38,6 +38,7 @@
|
|
|
38
38
|
<v-btn
|
|
39
39
|
v-if="status === 'successOutline'"
|
|
40
40
|
class="success mr-5"
|
|
41
|
+
elevation="0"
|
|
41
42
|
@click="onContinueGame"
|
|
42
43
|
>{{ $t('shared.forms.continue') }}
|
|
43
44
|
</v-btn>
|
|
@@ -124,7 +125,7 @@
|
|
|
124
125
|
>
|
|
125
126
|
<v-card-text>
|
|
126
127
|
<draggable
|
|
127
|
-
v-if="mainPrompt
|
|
128
|
+
v-if="mainPrompt.file"
|
|
128
129
|
class="dragArea list-group"
|
|
129
130
|
:key="mainPrompt['prompt']"
|
|
130
131
|
v-bind="dragOptions"
|
|
@@ -132,25 +133,26 @@
|
|
|
132
133
|
group="people"
|
|
133
134
|
tabindex="0"
|
|
134
135
|
>
|
|
135
|
-
<div
|
|
136
|
-
:id="
|
|
137
|
-
mainPrompt['file']['asset'][
|
|
138
|
-
'public_url'
|
|
139
|
-
]
|
|
140
|
-
"
|
|
141
|
-
>
|
|
136
|
+
<div :id="mainPrompt.file.id">
|
|
142
137
|
<v-img
|
|
143
|
-
v-if="mainPrompt['file']"
|
|
144
138
|
:aria-describedby="
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
139
|
+
getFileAriaDescribedBy(
|
|
140
|
+
mainPrompt.file,
|
|
141
|
+
mainPrompt[
|
|
142
|
+
'ariaDescribedBy'
|
|
143
|
+
]
|
|
144
|
+
)
|
|
145
|
+
"
|
|
146
|
+
:alt="
|
|
147
|
+
getFileAlt(
|
|
148
|
+
mainPrompt.file,
|
|
149
|
+
mainPrompt['altText']
|
|
150
|
+
)
|
|
148
151
|
"
|
|
149
|
-
:alt="mainPrompt['altText']"
|
|
150
152
|
:src="
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
153
|
+
getFilePublicUrl(
|
|
154
|
+
mainPrompt.file
|
|
155
|
+
)
|
|
154
156
|
"
|
|
155
157
|
></v-img>
|
|
156
158
|
</div>
|
|
@@ -232,36 +234,45 @@
|
|
|
232
234
|
:id="
|
|
233
235
|
block.metadata.config.prompts[
|
|
234
236
|
startingIndex
|
|
235
|
-
][startingIndex].file.
|
|
236
|
-
.public_url
|
|
237
|
+
][startingIndex].file.id
|
|
237
238
|
"
|
|
238
239
|
>
|
|
239
240
|
<v-img
|
|
240
|
-
v-if="
|
|
241
|
-
block.metadata.config
|
|
242
|
-
.prompts[startingIndex][
|
|
243
|
-
startingIndex
|
|
244
|
-
]['file']
|
|
245
|
-
"
|
|
246
241
|
:aria-describedby="
|
|
247
|
-
|
|
248
|
-
.
|
|
249
|
-
|
|
250
|
-
|
|
242
|
+
getFileAriaDescribedBy(
|
|
243
|
+
block.metadata.config
|
|
244
|
+
.prompts[
|
|
245
|
+
startingIndex
|
|
246
|
+
][startingIndex].file,
|
|
247
|
+
block.metadata.config
|
|
248
|
+
.prompts[
|
|
249
|
+
startingIndex
|
|
250
|
+
][startingIndex][
|
|
251
|
+
'ariaDescribedBy'
|
|
252
|
+
]
|
|
253
|
+
)
|
|
251
254
|
"
|
|
252
255
|
:alt="
|
|
253
|
-
|
|
254
|
-
.
|
|
255
|
-
|
|
256
|
-
|
|
256
|
+
getFileAlt(
|
|
257
|
+
block.metadata.config
|
|
258
|
+
.prompts[
|
|
259
|
+
startingIndex
|
|
260
|
+
][startingIndex].file,
|
|
261
|
+
block.metadata.config
|
|
262
|
+
.prompts[
|
|
263
|
+
startingIndex
|
|
264
|
+
][startingIndex][
|
|
265
|
+
'altText'
|
|
266
|
+
]
|
|
267
|
+
)
|
|
257
268
|
"
|
|
258
269
|
:src="
|
|
259
|
-
|
|
260
|
-
.
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
270
|
+
getFilePublicUrl(
|
|
271
|
+
block.metadata.config
|
|
272
|
+
.prompts[
|
|
273
|
+
startingIndex
|
|
274
|
+
][startingIndex].file
|
|
275
|
+
)
|
|
265
276
|
"
|
|
266
277
|
></v-img>
|
|
267
278
|
</div>
|
|
@@ -312,6 +323,7 @@
|
|
|
312
323
|
<v-btn
|
|
313
324
|
color="primary"
|
|
314
325
|
outlined
|
|
326
|
+
elevation="0"
|
|
315
327
|
@click="onReset"
|
|
316
328
|
>{{
|
|
317
329
|
$t(
|
|
@@ -410,12 +422,7 @@ export default {
|
|
|
410
422
|
mainPrompt: {
|
|
411
423
|
altText: '',
|
|
412
424
|
answer: {},
|
|
413
|
-
file:
|
|
414
|
-
asset: {
|
|
415
|
-
public_url: '',
|
|
416
|
-
},
|
|
417
|
-
name: '',
|
|
418
|
-
},
|
|
425
|
+
file: null,
|
|
419
426
|
prompt: '',
|
|
420
427
|
textOrImage: 'text',
|
|
421
428
|
},
|
|
@@ -489,10 +496,7 @@ export default {
|
|
|
489
496
|
this.block.metadata.config.answerObjects[evt.oldIndex]
|
|
490
497
|
this.block.metadata.config.prompts.forEach((outerElement) => {
|
|
491
498
|
const mainElement = outerElement.find((element) => {
|
|
492
|
-
return
|
|
493
|
-
element.file?.asset.public_url ==
|
|
494
|
-
evt.to.firstElementChild.id
|
|
495
|
-
)
|
|
499
|
+
return element.file?.id == evt.to.firstElementChild.id
|
|
496
500
|
})
|
|
497
501
|
if (mainElement) {
|
|
498
502
|
target = mainElement
|
|
@@ -550,6 +554,28 @@ export default {
|
|
|
550
554
|
)
|
|
551
555
|
this.setMainPrompt()
|
|
552
556
|
},
|
|
557
|
+
getFileAlt(file, defaultText = '') {
|
|
558
|
+
// If a default / override was defined
|
|
559
|
+
if (defaultText) {
|
|
560
|
+
return defaultText
|
|
561
|
+
}
|
|
562
|
+
|
|
563
|
+
file = this.resolveAsset(file)
|
|
564
|
+
return _.get(file, 'asset.metadata.props.alt', '')
|
|
565
|
+
},
|
|
566
|
+
getFileAriaDescribedBy(file, defaultText = '') {
|
|
567
|
+
// If a default / override was defined
|
|
568
|
+
if (defaultText) {
|
|
569
|
+
return defaultText
|
|
570
|
+
}
|
|
571
|
+
|
|
572
|
+
file = this.resolveAsset(file)
|
|
573
|
+
return _.get(file, 'asset.metadata.props.aria_describedby', '')
|
|
574
|
+
},
|
|
575
|
+
getFilePublicUrl(file) {
|
|
576
|
+
file = this.resolveAsset(file)
|
|
577
|
+
return _.get(file, 'asset.public_url', '')
|
|
578
|
+
},
|
|
553
579
|
},
|
|
554
580
|
}
|
|
555
581
|
</script>
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
<v-container>
|
|
3
3
|
<v-row>
|
|
4
4
|
<v-col>
|
|
5
|
-
<
|
|
5
|
+
<h2>{{ block.metadata.config.title }}</h2>
|
|
6
6
|
<p class="mb-0">{{ block.metadata.config.instructions }}</p>
|
|
7
7
|
</v-col>
|
|
8
8
|
</v-row>
|
|
@@ -11,6 +11,7 @@
|
|
|
11
11
|
<v-btn
|
|
12
12
|
variant="elevated"
|
|
13
13
|
color="primary"
|
|
14
|
+
elevation="0"
|
|
14
15
|
outlined
|
|
15
16
|
fab
|
|
16
17
|
small
|
|
@@ -23,6 +24,7 @@
|
|
|
23
24
|
<v-btn
|
|
24
25
|
variant="elevated"
|
|
25
26
|
color="primary"
|
|
27
|
+
elevation="0"
|
|
26
28
|
outlined
|
|
27
29
|
fab
|
|
28
30
|
small
|
|
@@ -97,6 +99,7 @@
|
|
|
97
99
|
<v-btn
|
|
98
100
|
color="primary"
|
|
99
101
|
text
|
|
102
|
+
elevation="0"
|
|
100
103
|
class="mr-4 btn-hint"
|
|
101
104
|
@click="onHint(question)"
|
|
102
105
|
>{{
|
|
@@ -108,6 +111,7 @@
|
|
|
108
111
|
<v-btn
|
|
109
112
|
color="primary"
|
|
110
113
|
text
|
|
114
|
+
elevation="0"
|
|
111
115
|
:disabled="
|
|
112
116
|
question.answer_options.length !== 4 ||
|
|
113
117
|
question.fiftyFifty
|
|
@@ -99,6 +99,7 @@
|
|
|
99
99
|
<v-col cols="12" md="1" class="d-flex justify-center">
|
|
100
100
|
<v-btn
|
|
101
101
|
text
|
|
102
|
+
elevation="0"
|
|
102
103
|
:disabled="disabled"
|
|
103
104
|
@click="onDelete(index)"
|
|
104
105
|
>
|
|
@@ -114,6 +115,7 @@
|
|
|
114
115
|
<v-btn
|
|
115
116
|
:class="cursor"
|
|
116
117
|
color="primary"
|
|
118
|
+
elevation="0"
|
|
117
119
|
:disabled="disabled"
|
|
118
120
|
@click="onAddAnswer"
|
|
119
121
|
>
|