@windward/core 0.0.7 → 0.0.8
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/.idea/codeStyles/Project.xml +58 -0
- package/.idea/codeStyles/codeStyleConfig.xml +5 -0
- package/.idea/inspectionProfiles/Project_Default.xml +6 -0
- package/.idea/modules.xml +8 -0
- package/.idea/php-docker-settings.xml +24 -0
- package/.idea/php.xml +19 -0
- package/.idea/vcs.xml +6 -0
- package/.idea/watcherTasks.xml +4 -0
- package/.idea/windward-ui-plugin-core.iml +8 -0
- package/components/Content/Blocks/Image.vue +35 -8
- package/components/Content/Blocks/OpenResponse.vue +32 -10
- package/components/Content/Blocks/OpenResponseCollate.vue +69 -42
- package/components/Settings/ImageSettings.vue +10 -0
- package/components/Settings/OpenResponseCollateSettings.vue +9 -8
- package/components/Settings/TextEditorSettings.vue +1 -0
- package/components/utils/TinyMCEWrapper.vue +10 -3
- package/components/utils/assets/tinymce/css/content.scss +1 -1
- package/coverage/clover.xml +223 -0
- package/coverage/coverage-final.json +16 -0
- package/coverage/lcov-report/base.css +224 -0
- package/coverage/lcov-report/block-navigation.js +87 -0
- package/coverage/lcov-report/components/Content/Blocks/Accordion.vue.html +430 -0
- package/coverage/lcov-report/components/Content/Blocks/Image.vue.html +394 -0
- package/coverage/lcov-report/components/Content/Blocks/Math.vue.html +262 -0
- package/coverage/lcov-report/components/Content/Blocks/RichText.vue.html +295 -0
- package/coverage/lcov-report/components/Content/Blocks/Tab.vue.html +415 -0
- package/coverage/lcov-report/components/Content/Blocks/Table.vue.html +667 -0
- package/coverage/lcov-report/components/Content/Blocks/Video.vue.html +2275 -0
- package/coverage/lcov-report/components/Content/Blocks/index.html +206 -0
- package/coverage/lcov-report/components/utils/ContentViewer.vue.html +199 -0
- package/coverage/lcov-report/components/utils/MathExpressionEditor.vue.html +919 -0
- package/coverage/lcov-report/components/utils/MathLiveWrapper.vue.html +343 -0
- package/coverage/lcov-report/components/utils/TinyMCEWrapper.vue.html +271 -0
- package/coverage/lcov-report/components/utils/index.html +161 -0
- package/coverage/lcov-report/config/index.html +116 -0
- package/coverage/lcov-report/config/tinymce.config.js.html +493 -0
- package/coverage/lcov-report/favicon.png +0 -0
- package/coverage/lcov-report/helpers/MathHelper.ts.html +793 -0
- package/coverage/lcov-report/helpers/index.html +116 -0
- package/coverage/lcov-report/helpers/tinymce/index.html +116 -0
- package/coverage/lcov-report/helpers/tinymce/plugin.ts.html +334 -0
- package/coverage/lcov-report/index.html +191 -0
- package/coverage/lcov-report/prettify.css +1 -0
- package/coverage/lcov-report/prettify.js +2 -0
- package/coverage/lcov-report/sort-arrow-sprite.png +0 -0
- package/coverage/lcov-report/sorter.js +196 -0
- package/coverage/lcov-report/test/index.html +116 -0
- package/coverage/lcov-report/test/mocks.js.html +457 -0
- package/coverage/lcov.info +403 -0
- package/helpers/tinymce/plugin.ts +1 -1
- package/i18n/en-US/components/content/blocks/open_response_collate.ts +1 -0
- package/i18n/en-US/components/settings/image.ts +3 -1
- package/i18n/es-ES/components/content/blocks/open_response_collate.ts +1 -0
- package/i18n/es-ES/components/settings/image.ts +3 -1
- package/i18n/sv-SE/components/content/blocks/open_response_collate.ts +1 -0
- package/i18n/sv-SE/components/settings/image.ts +3 -1
- package/lib/helpers/GlossaryHelper.d.ts +9 -0
- package/lib/helpers/GlossaryHelper.js +118 -0
- package/lib/helpers/GlossaryTerm.d.ts +10 -0
- package/lib/helpers/GlossaryTerm.js +22 -0
- package/lib/helpers/MathHelper.d.ts +99 -0
- package/lib/helpers/MathHelper.js +194 -0
- package/lib/helpers/tinymce/plugin.d.ts +2 -0
- package/lib/helpers/tinymce/plugin.js +86 -0
- package/lib/i18n/en-US/components/content/blocks/image.d.ts +6 -0
- package/lib/i18n/en-US/components/content/blocks/image.js +7 -0
- package/lib/i18n/en-US/components/content/blocks/index.d.ts +75 -0
- package/lib/i18n/en-US/components/content/blocks/index.js +14 -0
- package/lib/i18n/en-US/components/content/blocks/tab.d.ts +5 -0
- package/lib/i18n/en-US/components/content/blocks/tab.js +6 -0
- package/lib/i18n/en-US/components/content/blocks/table.d.ts +5 -0
- package/lib/i18n/en-US/components/content/blocks/table.js +6 -0
- package/lib/i18n/en-US/components/content/blocks/user_upload.d.ts +13 -0
- package/lib/i18n/en-US/components/content/blocks/user_upload.js +14 -0
- package/lib/i18n/en-US/components/content/blocks/video.d.ts +48 -0
- package/lib/i18n/en-US/components/content/blocks/video.js +49 -0
- package/lib/i18n/en-US/components/content/index.d.ts +77 -0
- package/lib/i18n/en-US/components/content/index.js +6 -0
- package/lib/i18n/en-US/components/index.d.ts +140 -0
- package/lib/i18n/en-US/components/index.js +12 -0
- package/lib/i18n/en-US/components/navigation/image.d.ts +5 -0
- package/lib/i18n/en-US/components/navigation/image.js +6 -0
- package/lib/i18n/en-US/components/navigation/index.d.ts +10 -0
- package/lib/i18n/en-US/components/navigation/index.js +8 -0
- package/lib/i18n/en-US/components/navigation/user_upload.d.ts +4 -0
- package/lib/i18n/en-US/components/navigation/user_upload.js +5 -0
- package/lib/i18n/en-US/components/settings/clickable_icon.d.ts +6 -0
- package/lib/i18n/en-US/components/settings/clickable_icon.js +7 -0
- package/lib/i18n/en-US/components/settings/image.d.ts +2 -0
- package/lib/i18n/en-US/components/settings/image.js +3 -0
- package/lib/i18n/en-US/components/settings/index.d.ts +39 -0
- package/lib/i18n/en-US/components/settings/index.js +14 -0
- package/lib/i18n/en-US/components/settings/text_editor.d.ts +8 -0
- package/lib/i18n/en-US/components/settings/text_editor.js +9 -0
- package/lib/i18n/en-US/components/settings/user_upload.d.ts +12 -0
- package/lib/i18n/en-US/components/settings/user_upload.js +13 -0
- package/lib/i18n/en-US/components/settings/video.d.ts +13 -0
- package/lib/i18n/en-US/components/settings/video.js +14 -0
- package/lib/i18n/en-US/components/utils/index.d.ts +15 -0
- package/lib/i18n/en-US/components/utils/index.js +6 -0
- package/lib/i18n/en-US/components/utils/tiny_mce_wrapper.d.ts +13 -0
- package/lib/i18n/en-US/components/utils/tiny_mce_wrapper.js +14 -0
- package/lib/i18n/en-US/index.d.ts +197 -0
- package/lib/i18n/en-US/index.js +16 -0
- package/lib/i18n/en-US/modules/index.d.ts +2 -0
- package/lib/i18n/en-US/modules/index.js +6 -0
- package/lib/i18n/en-US/pages/glossary.d.ts +8 -0
- package/lib/i18n/en-US/pages/glossary.js +9 -0
- package/lib/i18n/en-US/pages/index.d.ts +13 -0
- package/lib/i18n/en-US/pages/index.js +8 -0
- package/lib/i18n/en-US/pages/user_upload.d.ts +4 -0
- package/lib/i18n/en-US/pages/user_upload.js +5 -0
- package/lib/i18n/en-US/shared/content_blocks.d.ts +20 -0
- package/lib/i18n/en-US/shared/content_blocks.js +21 -0
- package/lib/i18n/en-US/shared/index.d.ts +39 -0
- package/lib/i18n/en-US/shared/index.js +10 -0
- package/lib/i18n/en-US/shared/menu.d.ts +4 -0
- package/lib/i18n/en-US/shared/menu.js +5 -0
- package/lib/i18n/en-US/shared/settings.d.ts +15 -0
- package/lib/i18n/en-US/shared/settings.js +16 -0
- package/lib/i18n/en-US.d.ts +197 -0
- package/lib/i18n/en-US.js +15 -0
- package/lib/models/UserFileAsset.d.ts +5 -0
- package/lib/models/UserFileAsset.js +37 -0
- package/package.json +1 -1
- package/test/__mocks__/helpersMock.js +3 -0
- package/test/__mocks__/modelMock.js +4 -0
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
<component name="ProjectCodeStyleConfiguration">
|
|
2
|
+
<code_scheme name="Project" version="173">
|
|
3
|
+
<HTMLCodeStyleSettings>
|
|
4
|
+
<option name="HTML_SPACE_INSIDE_EMPTY_TAG" value="true" />
|
|
5
|
+
<option name="HTML_ENFORCE_QUOTES" value="true" />
|
|
6
|
+
</HTMLCodeStyleSettings>
|
|
7
|
+
<JSCodeStyleSettings version="0">
|
|
8
|
+
<option name="FORCE_SEMICOLON_STYLE" value="true" />
|
|
9
|
+
<option name="SPACE_BEFORE_FUNCTION_LEFT_PARENTH" value="false" />
|
|
10
|
+
<option name="FORCE_QUOTE_STYlE" value="true" />
|
|
11
|
+
<option name="ENFORCE_TRAILING_COMMA" value="Remove" />
|
|
12
|
+
<option name="SPACES_WITHIN_OBJECT_LITERAL_BRACES" value="true" />
|
|
13
|
+
<option name="SPACES_WITHIN_IMPORTS" value="true" />
|
|
14
|
+
</JSCodeStyleSettings>
|
|
15
|
+
<TypeScriptCodeStyleSettings version="0">
|
|
16
|
+
<option name="FORCE_SEMICOLON_STYLE" value="true" />
|
|
17
|
+
<option name="SPACE_BEFORE_FUNCTION_LEFT_PARENTH" value="false" />
|
|
18
|
+
<option name="FORCE_QUOTE_STYlE" value="true" />
|
|
19
|
+
<option name="ENFORCE_TRAILING_COMMA" value="Remove" />
|
|
20
|
+
<option name="SPACES_WITHIN_OBJECT_LITERAL_BRACES" value="true" />
|
|
21
|
+
<option name="SPACES_WITHIN_IMPORTS" value="true" />
|
|
22
|
+
</TypeScriptCodeStyleSettings>
|
|
23
|
+
<VueCodeStyleSettings>
|
|
24
|
+
<option name="INTERPOLATION_NEW_LINE_AFTER_START_DELIMITER" value="false" />
|
|
25
|
+
<option name="INTERPOLATION_NEW_LINE_BEFORE_END_DELIMITER" value="false" />
|
|
26
|
+
</VueCodeStyleSettings>
|
|
27
|
+
<codeStyleSettings language="HTML">
|
|
28
|
+
<option name="SOFT_MARGINS" value="80" />
|
|
29
|
+
<indentOptions>
|
|
30
|
+
<option name="INDENT_SIZE" value="2" />
|
|
31
|
+
<option name="CONTINUATION_INDENT_SIZE" value="2" />
|
|
32
|
+
<option name="TAB_SIZE" value="2" />
|
|
33
|
+
</indentOptions>
|
|
34
|
+
</codeStyleSettings>
|
|
35
|
+
<codeStyleSettings language="JavaScript">
|
|
36
|
+
<option name="SOFT_MARGINS" value="80" />
|
|
37
|
+
<indentOptions>
|
|
38
|
+
<option name="INDENT_SIZE" value="2" />
|
|
39
|
+
<option name="CONTINUATION_INDENT_SIZE" value="2" />
|
|
40
|
+
<option name="TAB_SIZE" value="2" />
|
|
41
|
+
</indentOptions>
|
|
42
|
+
</codeStyleSettings>
|
|
43
|
+
<codeStyleSettings language="TypeScript">
|
|
44
|
+
<option name="SOFT_MARGINS" value="80" />
|
|
45
|
+
<indentOptions>
|
|
46
|
+
<option name="INDENT_SIZE" value="2" />
|
|
47
|
+
<option name="CONTINUATION_INDENT_SIZE" value="2" />
|
|
48
|
+
<option name="TAB_SIZE" value="2" />
|
|
49
|
+
</indentOptions>
|
|
50
|
+
</codeStyleSettings>
|
|
51
|
+
<codeStyleSettings language="Vue">
|
|
52
|
+
<option name="SOFT_MARGINS" value="80" />
|
|
53
|
+
<indentOptions>
|
|
54
|
+
<option name="CONTINUATION_INDENT_SIZE" value="2" />
|
|
55
|
+
</indentOptions>
|
|
56
|
+
</codeStyleSettings>
|
|
57
|
+
</code_scheme>
|
|
58
|
+
</component>
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
<?xml version="1.0" encoding="UTF-8"?>
|
|
2
|
+
<project version="4">
|
|
3
|
+
<component name="ProjectModuleManager">
|
|
4
|
+
<modules>
|
|
5
|
+
<module fileurl="file://$PROJECT_DIR$/.idea/windward-ui-plugin-core.iml" filepath="$PROJECT_DIR$/.idea/windward-ui-plugin-core.iml" />
|
|
6
|
+
</modules>
|
|
7
|
+
</component>
|
|
8
|
+
</project>
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
<?xml version="1.0" encoding="UTF-8"?>
|
|
2
|
+
<project version="4">
|
|
3
|
+
<component name="PhpDockerContainerSettings">
|
|
4
|
+
<list>
|
|
5
|
+
<map>
|
|
6
|
+
<entry key="79d59a8f-c56c-4789-b96c-e55a326ab125">
|
|
7
|
+
<value>
|
|
8
|
+
<DockerContainerSettings>
|
|
9
|
+
<option name="version" value="1" />
|
|
10
|
+
<option name="volumeBindings">
|
|
11
|
+
<list>
|
|
12
|
+
<DockerVolumeBindingImpl>
|
|
13
|
+
<option name="containerPath" value="/opt/project" />
|
|
14
|
+
<option name="hostPath" value="$PROJECT_DIR$" />
|
|
15
|
+
</DockerVolumeBindingImpl>
|
|
16
|
+
</list>
|
|
17
|
+
</option>
|
|
18
|
+
</DockerContainerSettings>
|
|
19
|
+
</value>
|
|
20
|
+
</entry>
|
|
21
|
+
</map>
|
|
22
|
+
</list>
|
|
23
|
+
</component>
|
|
24
|
+
</project>
|
package/.idea/php.xml
ADDED
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
<?xml version="1.0" encoding="UTF-8"?>
|
|
2
|
+
<project version="4">
|
|
3
|
+
<component name="MessDetectorOptionsConfiguration">
|
|
4
|
+
<option name="transferred" value="true" />
|
|
5
|
+
</component>
|
|
6
|
+
<component name="PHPCSFixerOptionsConfiguration">
|
|
7
|
+
<option name="transferred" value="true" />
|
|
8
|
+
</component>
|
|
9
|
+
<component name="PHPCodeSnifferOptionsConfiguration">
|
|
10
|
+
<option name="highlightLevel" value="WARNING" />
|
|
11
|
+
<option name="transferred" value="true" />
|
|
12
|
+
</component>
|
|
13
|
+
<component name="PhpStanOptionsConfiguration">
|
|
14
|
+
<option name="transferred" value="true" />
|
|
15
|
+
</component>
|
|
16
|
+
<component name="PsalmOptionsConfiguration">
|
|
17
|
+
<option name="transferred" value="true" />
|
|
18
|
+
</component>
|
|
19
|
+
</project>
|
package/.idea/vcs.xml
ADDED
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
<?xml version="1.0" encoding="UTF-8"?>
|
|
2
|
+
<module type="WEB_MODULE" version="4">
|
|
3
|
+
<component name="NewModuleRootManager">
|
|
4
|
+
<content url="file://$MODULE_DIR$" />
|
|
5
|
+
<orderEntry type="inheritedJdk" />
|
|
6
|
+
<orderEntry type="sourceFolder" forTests="false" />
|
|
7
|
+
</component>
|
|
8
|
+
</module>
|
|
@@ -1,18 +1,27 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<div>
|
|
3
|
-
<
|
|
4
|
-
<v-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
></v-
|
|
9
|
-
|
|
3
|
+
<div v-if="!block.body" class="img-holder">
|
|
4
|
+
<v-skeleton-loader
|
|
5
|
+
height="300px"
|
|
6
|
+
:elevation="2"
|
|
7
|
+
type="image"
|
|
8
|
+
></v-skeleton-loader>
|
|
9
|
+
|
|
10
|
+
<div class="no-source-overlay">
|
|
11
|
+
<v-icon x-large>mdi-file-question</v-icon><br />
|
|
12
|
+
{{
|
|
13
|
+
$t(
|
|
14
|
+
'windward.core.components.content.blocks.image.no_image_url'
|
|
15
|
+
)
|
|
16
|
+
}}
|
|
17
|
+
</div>
|
|
18
|
+
</div>
|
|
10
19
|
<v-responsive :aspect-ratio="aspectRatio">
|
|
11
20
|
<v-img
|
|
12
21
|
v-if="block.body"
|
|
13
22
|
:alt="block.metadata.config.alt"
|
|
14
23
|
:aria-describedby="block.metadata.config.aria_described_by"
|
|
15
|
-
class="
|
|
24
|
+
:class="imageClass"
|
|
16
25
|
:src="block.body"
|
|
17
26
|
contain
|
|
18
27
|
>
|
|
@@ -59,6 +68,9 @@ export default {
|
|
|
59
68
|
if (_.isEmpty(this.block.metadata.config.alt)) {
|
|
60
69
|
this.block.metadata.config.alt = ''
|
|
61
70
|
}
|
|
71
|
+
if (!_.isBoolean(this.block.metadata.config.hide_background)) {
|
|
72
|
+
this.block.metadata.config.hide_background = false
|
|
73
|
+
}
|
|
62
74
|
if (_.isEmpty(this.block.metadata.config.aria_describedby)) {
|
|
63
75
|
this.block.metadata.config.aria_describedby = ''
|
|
64
76
|
}
|
|
@@ -75,6 +87,14 @@ export default {
|
|
|
75
87
|
describedByText() {
|
|
76
88
|
return _.get(this.block.metadata, 'config.aria_describedby', null)
|
|
77
89
|
},
|
|
90
|
+
imageClass() {
|
|
91
|
+
let imageClass = ''
|
|
92
|
+
// If NOT hide background, inclide the extra class
|
|
93
|
+
if (!_.get(this.block.metadata, 'config.hide_background', false)) {
|
|
94
|
+
imageClass += ' img-white'
|
|
95
|
+
}
|
|
96
|
+
return 'img-display' + imageClass
|
|
97
|
+
},
|
|
78
98
|
},
|
|
79
99
|
watch: {
|
|
80
100
|
value(newValue) {
|
|
@@ -103,6 +123,13 @@ export default {
|
|
|
103
123
|
.img-holder {
|
|
104
124
|
max-height: 300px;
|
|
105
125
|
}
|
|
126
|
+
.img-white {
|
|
127
|
+
background: #fff;
|
|
128
|
+
}
|
|
129
|
+
.no-source-overlay {
|
|
130
|
+
text-align: center;
|
|
131
|
+
margin-top: -175px;
|
|
132
|
+
}
|
|
106
133
|
::v-deep .v-skeleton-loader.v-skeleton-loader--is-loading {
|
|
107
134
|
.v-skeleton-loader__image {
|
|
108
135
|
height: 100%;
|
|
@@ -75,9 +75,11 @@
|
|
|
75
75
|
|
|
76
76
|
<script>
|
|
77
77
|
import _ from 'lodash'
|
|
78
|
+
import { mapGetters } from 'vuex'
|
|
78
79
|
import TextViewer from '~/components/Text/TextViewer.vue'
|
|
79
80
|
import TextEditor from '~/components/Text/TextEditor.vue'
|
|
80
81
|
import BaseContentBlock from '~/components/Content/Blocks/BaseContentBlock'
|
|
82
|
+
import UserContentBlockState from '~/models/UserContentBlockState'
|
|
81
83
|
|
|
82
84
|
export default {
|
|
83
85
|
name: 'ContentBlockOpenResponse',
|
|
@@ -93,6 +95,18 @@ export default {
|
|
|
93
95
|
submitted: false,
|
|
94
96
|
}
|
|
95
97
|
},
|
|
98
|
+
computed: {
|
|
99
|
+
...mapGetters({
|
|
100
|
+
enrollment: 'enrollment/get',
|
|
101
|
+
}),
|
|
102
|
+
canSubmit() {
|
|
103
|
+
// Make sure the response is not empty and not equal to the starting text
|
|
104
|
+
return (
|
|
105
|
+
this.response &&
|
|
106
|
+
this.response !== this.block.metadata.config.starting_text
|
|
107
|
+
)
|
|
108
|
+
},
|
|
109
|
+
},
|
|
96
110
|
beforeMount() {
|
|
97
111
|
if (_.isEmpty(this.block.body)) {
|
|
98
112
|
this.block.body = ''
|
|
@@ -107,23 +121,31 @@ export default {
|
|
|
107
121
|
this.block.metadata.config.starting_text = ''
|
|
108
122
|
}
|
|
109
123
|
},
|
|
110
|
-
computed: {
|
|
111
|
-
canSubmit() {
|
|
112
|
-
// Make sure the response is not empty and not equal to the starting text
|
|
113
|
-
return (
|
|
114
|
-
this.response &&
|
|
115
|
-
this.response !== this.block.metadata.config.starting_text
|
|
116
|
-
)
|
|
117
|
-
},
|
|
118
|
-
},
|
|
119
124
|
watch: {},
|
|
120
125
|
mounted() {},
|
|
121
126
|
methods: {
|
|
122
|
-
onAfterSetContentBlockState() {
|
|
127
|
+
async onAfterSetContentBlockState() {
|
|
128
|
+
// Check to see if we have a state already for this block with the same block_id
|
|
129
|
+
// States are loaded via the ContentBlock.id but in this particular case we want to
|
|
130
|
+
// maintain the state ACROSS different ContentBlock.ids but with the same linked Block.id
|
|
131
|
+
const userState = await UserContentBlockState.where({
|
|
132
|
+
'metadata->block->tag': 'plugin-core-open-response',
|
|
133
|
+
course_user_id: this.enrollment.id,
|
|
134
|
+
})
|
|
135
|
+
.where('metadata->block->block_id', this.block.block_id)
|
|
136
|
+
.first()
|
|
137
|
+
|
|
138
|
+
// Apply the "True" state
|
|
139
|
+
if (!_.isEmpty(userState)) {
|
|
140
|
+
this.response = _.get(userState, 'metadata.response', '')
|
|
141
|
+
this.submitted = _.get(userState, 'metadata.submitted', false)
|
|
142
|
+
}
|
|
143
|
+
|
|
123
144
|
// If after the state is applied the response is still empty then apply the default response
|
|
124
145
|
if (this.response === '') {
|
|
125
146
|
this.response = this.block.metadata.config.starting_text
|
|
126
147
|
}
|
|
148
|
+
|
|
127
149
|
this.stateLoaded = true
|
|
128
150
|
},
|
|
129
151
|
onSubmit() {
|
|
@@ -31,7 +31,9 @@ export default {
|
|
|
31
31
|
extends: BaseContentBlock,
|
|
32
32
|
components: {},
|
|
33
33
|
data() {
|
|
34
|
-
return {
|
|
34
|
+
return {
|
|
35
|
+
saveState: false, // Override the base block to disable state saving
|
|
36
|
+
}
|
|
35
37
|
},
|
|
36
38
|
beforeMount() {
|
|
37
39
|
if (_.isEmpty(this.block.body)) {
|
|
@@ -46,7 +48,8 @@ export default {
|
|
|
46
48
|
if (_.isEmpty(this.block.metadata.config.filename)) {
|
|
47
49
|
this.block.metadata.config.filename = ''
|
|
48
50
|
}
|
|
49
|
-
|
|
51
|
+
// _.isEmpty(true) returns false. use isBoolean to check if this prop exists
|
|
52
|
+
if (!_.isBoolean(this.block.metadata.config.include_prompts)) {
|
|
50
53
|
this.block.metadata.config.include_prompts = false
|
|
51
54
|
}
|
|
52
55
|
},
|
|
@@ -62,50 +65,74 @@ export default {
|
|
|
62
65
|
mounted() {},
|
|
63
66
|
methods: {
|
|
64
67
|
async onCollate() {
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
68
|
+
try {
|
|
69
|
+
let userState = await UserContentBlockState.where({
|
|
70
|
+
'metadata->block->tag': 'plugin-core-open-response',
|
|
71
|
+
course_user_id: this.enrollment.id,
|
|
72
|
+
})
|
|
73
|
+
.whereIn(
|
|
74
|
+
'metadata->block->block_id',
|
|
75
|
+
this.block.metadata.config.linked
|
|
76
|
+
)
|
|
77
|
+
.get()
|
|
78
|
+
let collated = ''
|
|
79
|
+
const sortedStates = []
|
|
72
80
|
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
'
|
|
88
|
-
|
|
89
|
-
|
|
81
|
+
// Sorted the states based on the linked order
|
|
82
|
+
this.block.metadata.config.linked.forEach((linkedId) => {
|
|
83
|
+
const found = userState.find((state) => {
|
|
84
|
+
return state.metadata.block.block_id === linkedId
|
|
85
|
+
})
|
|
86
|
+
if (found) {
|
|
87
|
+
sortedStates.push(found)
|
|
88
|
+
}
|
|
89
|
+
})
|
|
90
|
+
|
|
91
|
+
sortedStates.forEach((state) => {
|
|
92
|
+
// Prepend the prompt from the state if include prompts is enabled
|
|
93
|
+
if (this.block.metadata.config.include_prompts) {
|
|
94
|
+
collated +=
|
|
95
|
+
'<strong>' +
|
|
96
|
+
state.metadata.block.body +
|
|
97
|
+
'</strong><hr />'
|
|
98
|
+
}
|
|
99
|
+
if (!_.isEmpty(state.metadata.response)) {
|
|
100
|
+
collated += '\n' + state.metadata.response
|
|
101
|
+
} else {
|
|
102
|
+
collated +=
|
|
103
|
+
'\n<p>' +
|
|
104
|
+
this.$t(
|
|
105
|
+
'windward.core.components.content.blocks.open_response_collate.no_response'
|
|
106
|
+
) +
|
|
107
|
+
'</p>'
|
|
108
|
+
}
|
|
109
|
+
})
|
|
110
|
+
let filename = this.block.metadata.config.filename
|
|
111
|
+
if (_.isEmpty(this.block.metadata.config.filename)) {
|
|
112
|
+
// Default filename is the users name + the current page
|
|
113
|
+
filename =
|
|
114
|
+
this.$auth.user.last_name +
|
|
115
|
+
'_' +
|
|
116
|
+
this.$auth.user.first_name +
|
|
117
|
+
'_' +
|
|
118
|
+
_.get(this.content, 'content.name_prefix') +
|
|
119
|
+
_.get(this.content, 'content.name')
|
|
120
|
+
|
|
121
|
+
// Change spaces to underscores and remove special characters
|
|
122
|
+
filename = filename.replaceAll(/\s+/gi, '_')
|
|
123
|
+
filename = filename.replaceAll(/[^a-z0-9\-\_]/gi, '')
|
|
90
124
|
}
|
|
91
|
-
})
|
|
92
|
-
let filename = this.block.metadata.config.filename
|
|
93
|
-
if (_.isEmpty(this.block.metadata.config.filename)) {
|
|
94
|
-
// Default filename is the users name + the current page
|
|
95
|
-
filename =
|
|
96
|
-
this.$auth.user.last_name +
|
|
97
|
-
'_' +
|
|
98
|
-
this.$auth.user.first_name +
|
|
99
|
-
'_' +
|
|
100
|
-
_.get(this.content, 'content.name_prefix') +
|
|
101
|
-
_.get(this.content, 'content.name')
|
|
102
125
|
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
126
|
+
this.generateDocument(collated, filename)
|
|
127
|
+
} catch (e) {
|
|
128
|
+
// eslint-disable-next-line no-console
|
|
129
|
+
console.error(e)
|
|
130
|
+
this.$dialog.error(
|
|
131
|
+
this.$t(
|
|
132
|
+
'windward.core.components.content.blocks.open_response_collate.generate_error'
|
|
133
|
+
)
|
|
134
|
+
)
|
|
106
135
|
}
|
|
107
|
-
|
|
108
|
-
this.generateDocument(collated, filename)
|
|
109
136
|
},
|
|
110
137
|
generateDocument(htmlBody, filename = '') {
|
|
111
138
|
// Specify file name. If one isn't supplied then a default name of `exported_document_YYYY-MM-DD.doc` is used
|
|
@@ -17,6 +17,13 @@
|
|
|
17
17
|
</template>
|
|
18
18
|
</ContentBlockAsset>
|
|
19
19
|
|
|
20
|
+
<v-switch
|
|
21
|
+
v-model="block.metadata.config.hide_background"
|
|
22
|
+
:label="
|
|
23
|
+
$t('windward.core.components.settings.image.hide_background')
|
|
24
|
+
"
|
|
25
|
+
></v-switch>
|
|
26
|
+
|
|
20
27
|
<v-form>
|
|
21
28
|
<v-text-field
|
|
22
29
|
v-model="block.metadata.config.alt"
|
|
@@ -69,6 +76,9 @@ export default {
|
|
|
69
76
|
if (_.isEmpty(this.block.metadata.config.alt)) {
|
|
70
77
|
this.block.metadata.config.alt = ''
|
|
71
78
|
}
|
|
79
|
+
if (!_.isBoolean(this.block.metadata.config.hide_background)) {
|
|
80
|
+
this.block.metadata.config.hide_background = false
|
|
81
|
+
}
|
|
72
82
|
if (_.isEmpty(this.block.metadata.config.aria_describedby)) {
|
|
73
83
|
this.block.metadata.config.aria_describedby = ''
|
|
74
84
|
}
|
|
@@ -38,8 +38,8 @@
|
|
|
38
38
|
>
|
|
39
39
|
<v-list-item
|
|
40
40
|
v-for="contentBlock in contentBlocks"
|
|
41
|
-
:key="contentBlock.
|
|
42
|
-
:value="contentBlock.
|
|
41
|
+
:key="contentBlock.block_id"
|
|
42
|
+
:value="contentBlock.block_id"
|
|
43
43
|
>
|
|
44
44
|
<template #default="{ active }">
|
|
45
45
|
<v-list-item-icon>
|
|
@@ -133,7 +133,8 @@ export default {
|
|
|
133
133
|
if (_.isEmpty(this.block.metadata.config.filename)) {
|
|
134
134
|
this.block.metadata.config.filename = ''
|
|
135
135
|
}
|
|
136
|
-
|
|
136
|
+
// _.isEmpty(true) returns false. use isBoolean to check if this prop exists
|
|
137
|
+
if (!_.isBoolean(this.block.metadata.config.include_prompts)) {
|
|
137
138
|
this.block.metadata.config.include_prompts = false
|
|
138
139
|
}
|
|
139
140
|
|
|
@@ -151,19 +152,19 @@ export default {
|
|
|
151
152
|
this.setLinkedBlocks()
|
|
152
153
|
},
|
|
153
154
|
setLinkedBlocks() {
|
|
154
|
-
const
|
|
155
|
+
const linkedBlockIds = []
|
|
155
156
|
|
|
156
157
|
// Loop over content blocks since they have the correct order we want to collate
|
|
157
158
|
this.contentBlocks.forEach((contentBlock) => {
|
|
158
159
|
// If the unsorted this.linked includes the block id, add it in the right order
|
|
159
|
-
if (this.linked.includes(contentBlock.
|
|
160
|
-
|
|
160
|
+
if (this.linked.includes(contentBlock.block_id)) {
|
|
161
|
+
linkedBlockIds.push(contentBlock.block_id)
|
|
161
162
|
}
|
|
162
163
|
})
|
|
163
164
|
|
|
164
165
|
// Set the linked and also body for convenience
|
|
165
|
-
this.block.metadata.config.linked =
|
|
166
|
-
this.block.body =
|
|
166
|
+
this.block.metadata.config.linked = linkedBlockIds
|
|
167
|
+
this.block.body = linkedBlockIds.join()
|
|
167
168
|
},
|
|
168
169
|
},
|
|
169
170
|
}
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
:api-key="api_key"
|
|
7
7
|
:init="config"
|
|
8
8
|
tag-name="div"
|
|
9
|
-
model-events="change keydown blur focus paste input submit"
|
|
9
|
+
model-events="change keydown blur focus paste input submit SetContent"
|
|
10
10
|
>
|
|
11
11
|
</editor>
|
|
12
12
|
</template>
|
|
@@ -29,13 +29,13 @@ export default {
|
|
|
29
29
|
menubar: {
|
|
30
30
|
type: String,
|
|
31
31
|
required: false,
|
|
32
|
-
default: '
|
|
32
|
+
default: 'edit insert format view table windward help',
|
|
33
33
|
},
|
|
34
34
|
toolbar: {
|
|
35
35
|
type: String,
|
|
36
36
|
required: false,
|
|
37
37
|
default:
|
|
38
|
-
'undo redo | formatselect | bold italic | alignleft aligncenter alignright | table bullist numlist outdent indent | mathButton ',
|
|
38
|
+
'undo redo | formatselect | fontsizeselect | bold italic underline strikethrough removeformat | alignleft aligncenter alignright | table bullist numlist outdent indent | mathButton ',
|
|
39
39
|
},
|
|
40
40
|
},
|
|
41
41
|
beforeMount() {
|
|
@@ -71,6 +71,10 @@ export default {
|
|
|
71
71
|
title: 'Table',
|
|
72
72
|
items: 'inserttable | tableprops | deletetable',
|
|
73
73
|
},
|
|
74
|
+
format: {
|
|
75
|
+
title: 'Format',
|
|
76
|
+
items: ' bold italic underline strikethrough superscript subscript codeformat | formats align | forecolor backcolor | language | removeformat',
|
|
77
|
+
},
|
|
74
78
|
},
|
|
75
79
|
plugins: [
|
|
76
80
|
'advlist autolink lists link charmap',
|
|
@@ -85,6 +89,8 @@ export default {
|
|
|
85
89
|
table_default_attributes: {
|
|
86
90
|
class: 'default',
|
|
87
91
|
},
|
|
92
|
+
font_size_formats:
|
|
93
|
+
'8pt 10pt 12pt 14pt 16pt 18pt 24pt 36pt 48pt',
|
|
88
94
|
table_class_list: [
|
|
89
95
|
{ title: 'None', value: ' ' },
|
|
90
96
|
{
|
|
@@ -163,6 +169,7 @@ export default {
|
|
|
163
169
|
WindwardPlugins
|
|
164
170
|
)
|
|
165
171
|
},
|
|
172
|
+
|
|
166
173
|
formats: {
|
|
167
174
|
glossary: {
|
|
168
175
|
inline: 'span',
|