@sparkle-learning/core 0.0.53 → 0.0.55
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/dist/cjs/{PrivateRoute-074c584e.js → PrivateRoute-f97245ce.js} +18 -30
- package/dist/cjs/{feed.service-b4f09441.js → appdata.service-c8d71e05.js} +4 -56
- package/dist/cjs/{assets.service-0c759d51.js → assets.service-bfa75092.js} +1 -1
- package/dist/cjs/assignment.service-690fb59c.js +19 -0
- package/dist/cjs/{environment-config.service-0e02b049.js → environment-config.service-c8ff1f3d.js} +0 -1
- package/dist/cjs/{facilitator.service-9e990274.js → facilitator.service-ff0e1659.js} +1 -1
- package/dist/cjs/feed.service-8eca4de6.js +57 -0
- package/dist/cjs/header-mobile-collapse_61.cjs.entry.js +76 -87
- package/dist/cjs/{httpService-7211d93b.js → httpService-d2e7bf8f.js} +13 -11
- package/dist/cjs/index.cjs.js +5 -4
- package/dist/cjs/{ion-action-sheet_4.cjs.entry.js → ion-action-sheet_7.cjs.entry.js} +728 -0
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/cjs/media.service-8a1b9bc5.js +40 -0
- package/dist/cjs/{signalR.service-5672eebc.js → signalR.service-bd6b42f9.js} +18 -20
- package/dist/cjs/sparkle-animation-player.cjs.entry.js +1 -1
- package/dist/cjs/sparkle-assignment.cjs.entry.js +110 -0
- package/dist/cjs/sparkle-character-intro.cjs.entry.js +2 -2
- package/dist/cjs/sparkle-core.cjs.js +1 -1
- package/dist/cjs/sparkle-discussion-questions_2.cjs.entry.js +20 -11
- package/dist/cjs/sparkle-discussion.cjs.entry.js +6 -4
- package/dist/cjs/sparkle-facilitator-notes-form.cjs.entry.js +5 -3
- package/dist/cjs/sparkle-feed-post.cjs.entry.js +116 -0
- package/dist/cjs/sparkle-feedback.cjs.entry.js +5 -3
- package/dist/cjs/sparkle-file-upload.cjs.entry.js +53 -0
- package/dist/cjs/sparkle-goal-form.cjs.entry.js +11 -8
- package/dist/cjs/sparkle-input.cjs.entry.js +56 -0
- package/dist/cjs/sparkle-quiz-container.cjs.entry.js +1 -1
- package/dist/cjs/sparkle-quiz-old.cjs.entry.js +120 -0
- package/dist/cjs/sparkle-quiz.cjs.entry.js +31 -48
- package/dist/cjs/{student.service-2e58f237.js → student.service-7e5385be.js} +1 -1
- package/dist/cjs/token.service-7a41953d.js +97 -0
- package/dist/cjs/{util-d383acb8.js → util-47e320b2.js} +2 -2
- package/dist/collection/PrivateRoute.js +2 -2
- package/dist/collection/collection-manifest.json +5 -2
- package/dist/collection/components/layout/facilitator/facilitator-page.js +2 -3
- package/dist/collection/components/layout/page/page.css +4 -0
- package/dist/collection/components/layout/page/page.js +39 -26
- package/dist/collection/components/sparkle-assignment/sparkle-assignment.css +30 -0
- package/dist/collection/components/sparkle-assignment/sparkle-assignment.js +159 -0
- package/dist/collection/components/sparkle-character-intro/sparkle-character-intro.css +8 -1
- package/dist/collection/components/sparkle-character-intro/sparkle-character-intro.js +10 -6
- package/dist/collection/components/sparkle-course-root/sparkle-course-root.js +13 -2
- package/dist/collection/components/sparkle-discussion/sparkle-discussion-questions/sparkle-discussion-questions.js +4 -2
- package/dist/collection/components/sparkle-discussion/sparkle-discussion-results/sparkle-discussion-results.js +15 -9
- package/dist/collection/components/sparkle-discussion/sparkle-discussion.css +5 -0
- package/dist/collection/components/sparkle-discussion/sparkle-discussion.js +5 -3
- package/dist/collection/components/sparkle-feed-post/sparkle-feed-post.js +54 -75
- package/dist/collection/components/sparkle-file-upload/sparkle-file-upload.css +0 -0
- package/dist/collection/components/sparkle-file-upload/sparkle-file-upload.js +105 -0
- package/dist/collection/components/sparkle-input/sparkle-input.css +0 -0
- package/dist/collection/components/sparkle-input/sparkle-input.js +212 -0
- package/dist/collection/components/sparkle-login/sparkle-login.js +2 -1
- package/dist/collection/components/sparkle-quiz/{sparkle-quiz/sparkle-quiz.css → sparkle-quiz-old/sparkle-quiz-old.css} +1 -1
- package/dist/collection/components/sparkle-quiz/{sparkle-quiz/sparkle-quiz.js → sparkle-quiz-old/sparkle-quiz-old.js} +4 -4
- package/dist/collection/components/sparkle-quiz/{sparkle-quiz-v1.js → sparkle-quiz.js} +23 -25
- package/dist/collection/components/sparkle-quiz-container/sparkle-quiz-container.js +1 -1
- package/dist/collection/components/sparkle-root/sparkle-root.js +12 -10
- package/dist/collection/services/assignment.service.js +14 -0
- package/dist/collection/services/auth/auth.service.js +15 -14
- package/dist/collection/services/environment/environment-config.js +1 -1
- package/dist/collection/services/environment/environment-config.service.js +0 -1
- package/dist/collection/services/httpService.js +12 -10
- package/dist/collection/services/signalR.service.js +17 -19
- package/dist/collection/services/token.service.js +79 -0
- package/dist/collection/util.js +5 -2
- package/dist/esm/{PrivateRoute-c5441f35.js → PrivateRoute-90ac95b8.js} +17 -29
- package/dist/esm/{feed.service-8fbe4ce3.js → appdata.service-2e84e167.js} +5 -55
- package/dist/esm/{assets.service-66e848b8.js → assets.service-def1d63c.js} +1 -1
- package/dist/esm/assignment.service-8d31f141.js +17 -0
- package/dist/esm/{environment-config.service-2b5d692b.js → environment-config.service-b191f276.js} +0 -1
- package/dist/esm/{facilitator.service-b0292f7f.js → facilitator.service-18c47bdf.js} +1 -1
- package/dist/esm/feed.service-b4f3cae4.js +54 -0
- package/dist/esm/header-mobile-collapse_61.entry.js +71 -82
- package/dist/esm/{httpService-7b75b095.js → httpService-7986aeed.js} +14 -12
- package/dist/esm/index.js +6 -5
- package/dist/esm/{ion-action-sheet_4.entry.js → ion-action-sheet_7.entry.js} +729 -4
- package/dist/esm/ion-loading.entry.js +1 -1
- package/dist/esm/ion-menu.entry.js +1 -1
- package/dist/esm/ion-modal.entry.js +1 -1
- package/dist/esm/ion-picker.entry.js +1 -1
- package/dist/esm/ion-toast.entry.js +1 -1
- package/dist/esm/loader.js +1 -1
- package/dist/esm/media.service-6e90bc41.js +37 -0
- package/dist/esm/{overlays-3b4dca92.js → overlays-4233a39d.js} +1 -1
- package/dist/esm/{signalR.service-9d5b9f36.js → signalR.service-c33fba50.js} +18 -20
- package/dist/esm/sparkle-animation-player.entry.js +1 -1
- package/dist/esm/sparkle-assignment.entry.js +106 -0
- package/dist/esm/sparkle-character-intro.entry.js +3 -3
- package/dist/esm/sparkle-core.js +1 -1
- package/dist/esm/sparkle-discussion-questions_2.entry.js +20 -11
- package/dist/esm/sparkle-discussion.entry.js +6 -4
- package/dist/esm/sparkle-facilitator-notes-form.entry.js +6 -4
- package/dist/esm/sparkle-feed-post.entry.js +112 -0
- package/dist/esm/sparkle-feedback.entry.js +6 -4
- package/dist/esm/sparkle-file-upload.entry.js +49 -0
- package/dist/esm/sparkle-goal-form.entry.js +9 -6
- package/dist/esm/sparkle-input.entry.js +52 -0
- package/dist/esm/sparkle-quiz-container.entry.js +1 -1
- package/dist/esm/sparkle-quiz-old.entry.js +116 -0
- package/dist/esm/sparkle-quiz.entry.js +31 -48
- package/dist/esm/{student.service-0746418b.js → student.service-08af124f.js} +1 -1
- package/dist/esm/token.service-71a5d33f.js +94 -0
- package/dist/esm/{util-6ef753e9.js → util-57cc8006.js} +2 -2
- package/dist/sparkle-core/index.esm.js +1 -1
- package/dist/sparkle-core/p-08420531.entry.js +1 -0
- package/dist/sparkle-core/p-08cca80d.entry.js +1 -0
- package/dist/sparkle-core/p-0e8e539f.entry.js +1 -0
- package/dist/sparkle-core/p-13ec39db.entry.js +1 -0
- package/dist/sparkle-core/p-1adc98f6.js +1 -0
- package/dist/sparkle-core/p-38c842d5.entry.js +1 -0
- package/dist/sparkle-core/{p-fbccd30c.js → p-39a31e43.js} +1 -1
- package/dist/sparkle-core/{p-0a5d7c4f.entry.js → p-3daf2915.entry.js} +26 -26
- package/dist/sparkle-core/{p-9a443f51.js → p-408176ba.js} +1 -1
- package/dist/sparkle-core/p-42ed7d5f.entry.js +1 -0
- package/dist/sparkle-core/p-4b4a8703.js +1 -0
- package/dist/sparkle-core/p-4d1cfcbe.entry.js +1 -0
- package/dist/sparkle-core/p-4fba3e4c.js +1 -0
- package/dist/sparkle-core/{p-54dd894f.entry.js → p-6bde0192.entry.js} +1 -1
- package/dist/sparkle-core/{p-6faa194c.entry.js → p-6d2f4093.entry.js} +1 -1
- package/dist/sparkle-core/{p-162bff1a.entry.js → p-72053ae0.entry.js} +1 -1
- package/dist/sparkle-core/p-7dae0f0e.js +1 -0
- package/dist/sparkle-core/{p-18cdd458.entry.js → p-85d4cd5c.entry.js} +1 -1
- package/dist/sparkle-core/p-973fe404.entry.js +22 -0
- package/dist/sparkle-core/{p-ff0e0d4e.entry.js → p-98daeddb.entry.js} +1 -1
- package/dist/sparkle-core/p-b06e2bef.js +1 -0
- package/dist/sparkle-core/{p-e863bf1d.entry.js → p-b6fec622.entry.js} +1 -1
- package/dist/sparkle-core/p-b8d71ff4.js +1 -0
- package/dist/sparkle-core/p-bd90903e.js +1 -0
- package/dist/sparkle-core/{p-a49ab4e8.entry.js → p-c64a34cd.entry.js} +1 -1
- package/dist/sparkle-core/{p-5efc6566.js → p-c9f753a4.js} +1 -1
- package/dist/sparkle-core/p-da391f3f.js +1 -0
- package/dist/sparkle-core/p-e0cad1bb.js +1 -0
- package/dist/sparkle-core/{p-ce4b22f7.entry.js → p-f196c124.entry.js} +1 -1
- package/dist/sparkle-core/p-f47fe1fe.entry.js +1 -0
- package/dist/sparkle-core/p-f714f77a.entry.js +1 -0
- package/dist/sparkle-core/p-f891c79a.entry.js +1 -0
- package/dist/sparkle-core/{p-377b04c2.entry.js → p-ff080f82.entry.js} +1 -1
- package/dist/sparkle-core/{p-2ff67662.js → p-ff7a8a71.js} +1 -1
- package/dist/sparkle-core/sparkle-core.esm.js +1 -1
- package/dist/types/components/layout/page/page.d.ts +2 -0
- package/dist/types/components/sparkle-assignment/sparkle-assignment.d.ts +16 -0
- package/dist/types/components/sparkle-course-root/sparkle-course-root.d.ts +1 -0
- package/dist/types/components/sparkle-feed-post/sparkle-feed-post.d.ts +4 -3
- package/dist/types/components/sparkle-file-upload/sparkle-file-upload.d.ts +15 -0
- package/dist/types/components/sparkle-input/sparkle-input.d.ts +23 -0
- package/dist/types/components/sparkle-quiz/{sparkle-quiz/sparkle-quiz.d.ts → sparkle-quiz-old/sparkle-quiz-old.d.ts} +1 -1
- package/dist/types/components/sparkle-quiz/{sparkle-quiz-v1.d.ts → sparkle-quiz.d.ts} +1 -1
- package/dist/types/components.d.ts +111 -36
- package/dist/types/models/class.model.d.ts +4 -0
- package/dist/types/services/assignment.service.d.ts +8 -0
- package/dist/types/services/auth/auth.service.d.ts +1 -1
- package/dist/types/services/environment/environment-config.d.ts +3 -0
- package/dist/types/services/token.service.d.ts +13 -0
- package/dist/types/util.d.ts +1 -0
- package/package.json +1 -1
- package/dist/cjs/ion-select_3.cjs.entry.js +0 -618
- package/dist/cjs/ion-textarea.cjs.entry.js +0 -248
- package/dist/cjs/sparkle-quiz-v1.cjs.entry.js +0 -105
- package/dist/esm/ion-select_3.entry.js +0 -612
- package/dist/esm/ion-textarea.entry.js +0 -244
- package/dist/esm/sparkle-quiz-v1.entry.js +0 -101
- package/dist/sparkle-core/p-0f1c5899.entry.js +0 -18
- package/dist/sparkle-core/p-1d4c7c11.js +0 -1
- package/dist/sparkle-core/p-30767c1c.entry.js +0 -1
- package/dist/sparkle-core/p-3265ed87.entry.js +0 -1
- package/dist/sparkle-core/p-370609ba.entry.js +0 -1
- package/dist/sparkle-core/p-44334ef3.entry.js +0 -4
- package/dist/sparkle-core/p-462bffba.js +0 -1
- package/dist/sparkle-core/p-4c9f994f.js +0 -1
- package/dist/sparkle-core/p-58e4bbe5.entry.js +0 -1
- package/dist/sparkle-core/p-600cf6a3.js +0 -1
- package/dist/sparkle-core/p-641bfc92.entry.js +0 -1
- package/dist/sparkle-core/p-80d6b0e6.entry.js +0 -1
- package/dist/sparkle-core/p-af3cc111.entry.js +0 -1
- package/dist/sparkle-core/p-b226f54d.js +0 -1
- /package/dist/collection/components/sparkle-quiz/{sparkle-quiz-v1.css → sparkle-quiz.css} +0 -0
- /package/dist/sparkle-core/{p-935e7cfc.js → p-8b56f734.js} +0 -0
@@ -3,7 +3,7 @@ import templates from './templates';
|
|
3
3
|
import { modalController, alertController } from '@ionic/core';
|
4
4
|
import { AuthStore } from '../../../stores/auth.store';
|
5
5
|
import userStore from '../../../stores/user.store';
|
6
|
-
import { StoreService } from
|
6
|
+
import { StoreService } from '../../../services/store.service';
|
7
7
|
import { SignalRService } from '../../../services/signalR.service';
|
8
8
|
import signalRStore from '../../../stores/signalR.store';
|
9
9
|
export class SparklePage {
|
@@ -11,7 +11,15 @@ export class SparklePage {
|
|
11
11
|
this.presentation = false;
|
12
12
|
this.page = { title: null, path: null, body: null, pageInfo: null };
|
13
13
|
this.isLesson = false;
|
14
|
-
this.
|
14
|
+
this.eventEmitter = (user, data) => {
|
15
|
+
let event = new CustomEvent('receivedSignalREvent', { detail: JSON.parse(data) });
|
16
|
+
document.body.dispatchEvent(event);
|
17
|
+
};
|
18
|
+
this.pollSubmissionEventEmitter = (type, data) => {
|
19
|
+
let event = new CustomEvent('receivedPollSubmissionSignalREvent', { detail: { data: data, type: type } });
|
20
|
+
document.body.dispatchEvent(event);
|
21
|
+
};
|
22
|
+
this.handleFacilitatorNavigationChange = url => {
|
15
23
|
this.history.replace(url, {});
|
16
24
|
};
|
17
25
|
this.validateFetch = (response) => {
|
@@ -24,7 +32,7 @@ export class SparklePage {
|
|
24
32
|
this.badFetch = null;
|
25
33
|
this.page = page;
|
26
34
|
if (this.presentation) {
|
27
|
-
this.page = Object.assign(Object.assign({}, this.page), { previousUrl:
|
35
|
+
this.page = Object.assign(Object.assign({}, this.page), { previousUrl: '/presentation' + this.page.previousUrl, nextUrl: '/presentation' + this.page.nextUrl });
|
28
36
|
}
|
29
37
|
StoreService.getInstance().UpdateTocPageInfo(this.page.pageInfo);
|
30
38
|
this.isLesson = this.page.pageInfo.pageId > 0;
|
@@ -36,7 +44,7 @@ export class SparklePage {
|
|
36
44
|
title: error.statusText,
|
37
45
|
body: null,
|
38
46
|
path: null,
|
39
|
-
pageInfo: null
|
47
|
+
pageInfo: null,
|
40
48
|
};
|
41
49
|
};
|
42
50
|
}
|
@@ -47,19 +55,25 @@ export class SparklePage {
|
|
47
55
|
}
|
48
56
|
componentDidLoad() {
|
49
57
|
if (this.presentation) {
|
50
|
-
signalRStore.onChange(
|
58
|
+
signalRStore.onChange('connected', connected => {
|
51
59
|
if (connected) {
|
52
|
-
SignalRService.getInstance().connection.on(
|
60
|
+
SignalRService.getInstance().connection.on('SendMessage', this.eventEmitter);
|
61
|
+
SignalRService.getInstance().connection.on('NavigateFacilitatorPresentationCourseTo', this.handleFacilitatorNavigationChange);
|
62
|
+
SignalRService.getInstance().connection.on('PollSubmission', this.pollSubmissionEventEmitter);
|
63
|
+
}
|
64
|
+
else {
|
65
|
+
SignalRService.getInstance().connection.off('SendMessage', this.eventEmitter);
|
66
|
+
SignalRService.getInstance().connection.off('PollSubmission', this.eventEmitter);
|
67
|
+
SignalRService.getInstance().connection.off('NavigateFacilitatorPresentationCourseTo', this.handleFacilitatorNavigationChange);
|
53
68
|
}
|
54
69
|
});
|
55
70
|
}
|
56
71
|
}
|
57
72
|
fetchPage(path, oldPath) {
|
58
|
-
if (SignalRService.getInstance().connection.
|
59
|
-
SignalRService.getInstance().callSignalR(
|
73
|
+
if (SignalRService.getInstance().connection._connectionState == 'Connected') {
|
74
|
+
SignalRService.getInstance().callSignalR('OnStudentNavigate', { url: window.location.href });
|
60
75
|
if (this.presentation) {
|
61
|
-
|
62
|
-
SignalRService.getInstance().connection.on("NavigateFacilitatorPresentationCourseTo", this.handleFacilitatorNavigationChange);
|
76
|
+
SignalRService.getInstance().connection.on('NavigateFacilitatorPresentationCourseTo', this.handleFacilitatorNavigationChange);
|
63
77
|
}
|
64
78
|
}
|
65
79
|
if (path === null || path === oldPath) {
|
@@ -130,7 +144,7 @@ export class SparklePage {
|
|
130
144
|
async presentFeedbackModal() {
|
131
145
|
const modal = await modalController.create({
|
132
146
|
component: 'sparkle-feedback',
|
133
|
-
cssClass: 'sparkle-modal sparkle-feedback-modal'
|
147
|
+
cssClass: 'sparkle-modal sparkle-feedback-modal',
|
134
148
|
});
|
135
149
|
await modal.present();
|
136
150
|
}
|
@@ -161,22 +175,21 @@ export class SparklePage {
|
|
161
175
|
text: 'Cancel',
|
162
176
|
role: 'cancel',
|
163
177
|
cssClass: 'secondary',
|
164
|
-
handler: () => {
|
165
|
-
|
166
|
-
|
178
|
+
handler: () => { },
|
179
|
+
},
|
180
|
+
{
|
167
181
|
text: 'Ok',
|
168
|
-
handler:
|
169
|
-
|
170
|
-
|
171
|
-
]
|
182
|
+
handler: data => { },
|
183
|
+
},
|
184
|
+
],
|
172
185
|
});
|
173
186
|
await alert.present();
|
174
187
|
}
|
175
188
|
openWindows() {
|
176
189
|
//this.jwtService.updateDefaultCourseClassId(data);
|
177
|
-
window.open(window.location.origin +
|
190
|
+
window.open(window.location.origin + '/presentation' + this.path.replace('.json', ''), '_blank');
|
178
191
|
setTimeout(() => {
|
179
|
-
window.open(window.location.origin +
|
192
|
+
window.open(window.location.origin + '/presentation' + '/teacher' + this.path.replace('.json', ''), '_blank');
|
180
193
|
}, 500);
|
181
194
|
}
|
182
195
|
renderControls() {
|
@@ -184,10 +197,10 @@ export class SparklePage {
|
|
184
197
|
return (h("div", { class: "controls" },
|
185
198
|
h("ion-button", { onClick: () => this.presentFeedbackModal() },
|
186
199
|
h("ion-icon", { name: "chatbox-outline" })),
|
187
|
-
this.isLesson && userStore.state.user && userStore.state.user.Roles.indexOf('Facilitator') > -1 && h("ion-button", { onClick: () => this.openProjectorPage() },
|
188
|
-
h("ion-icon", { name: "desktop-outline" }))));
|
200
|
+
this.isLesson && userStore.state.user && userStore.state.user.Roles.indexOf('Facilitator') > -1 && (h("ion-button", { onClick: () => this.openProjectorPage() },
|
201
|
+
h("ion-icon", { name: "desktop-outline" })))));
|
189
202
|
}
|
190
|
-
return
|
203
|
+
return '';
|
191
204
|
}
|
192
205
|
render() {
|
193
206
|
if (this.path) {
|
@@ -199,13 +212,13 @@ export class SparklePage {
|
|
199
212
|
const content = [
|
200
213
|
h("main", { class: 'no-demo' },
|
201
214
|
this.renderControls(),
|
202
|
-
h(Template, { page: page }))
|
215
|
+
h(Template, { page: page })),
|
203
216
|
];
|
204
217
|
return content;
|
205
218
|
}
|
206
219
|
else {
|
207
|
-
return h("main", { class: 'no-demo' },
|
208
|
-
h("slot", null));
|
220
|
+
return (h("main", { class: 'no-demo' },
|
221
|
+
h("slot", null)));
|
209
222
|
}
|
210
223
|
}
|
211
224
|
static get is() { return "sparkle-page"; }
|
@@ -0,0 +1,30 @@
|
|
1
|
+
:host {
|
2
|
+
display: block;
|
3
|
+
}
|
4
|
+
|
5
|
+
.assignment-footer-container {
|
6
|
+
display: flex;
|
7
|
+
justify-content: flex-end;
|
8
|
+
}
|
9
|
+
|
10
|
+
.assignment-footer {
|
11
|
+
display: flex;
|
12
|
+
justify-content: space-between;
|
13
|
+
align-items: center;
|
14
|
+
}
|
15
|
+
|
16
|
+
.error {
|
17
|
+
color: red;
|
18
|
+
margin-right: 10px;
|
19
|
+
}
|
20
|
+
|
21
|
+
.success {
|
22
|
+
color: green;
|
23
|
+
margin-right: 10px;
|
24
|
+
}
|
25
|
+
|
26
|
+
.uploaded-image {
|
27
|
+
display: block;
|
28
|
+
max-height: 140px;
|
29
|
+
width: auto !important;
|
30
|
+
}
|
@@ -0,0 +1,159 @@
|
|
1
|
+
import { Component, Element, Prop, State, Event, Host, h, Listen } from '@stencil/core';
|
2
|
+
import { AssignmentService } from '../../services/assignment.service';
|
3
|
+
import { TokenService } from '../../services/token.service';
|
4
|
+
export class SparkleAssignment {
|
5
|
+
constructor() {
|
6
|
+
this.submitted = true;
|
7
|
+
this.assignmentLoading = false;
|
8
|
+
this.onSubmit = async (event) => {
|
9
|
+
event.preventDefault();
|
10
|
+
debugger;
|
11
|
+
const formElements = event.currentTarget.querySelectorAll('sparkle-input,sparkle-file-upload');
|
12
|
+
const formData = Array.from(formElements).reduce((acc, formElement) => {
|
13
|
+
const { name, type, value } = formElement;
|
14
|
+
//const name = formElement.getAttribute('name');
|
15
|
+
let checked = false;
|
16
|
+
if (formElement.querySelector('ion-item')) {
|
17
|
+
checked = formElement.querySelector('ion-item').classList.contains('item-checkbox-checked');
|
18
|
+
}
|
19
|
+
if (name) {
|
20
|
+
if (type === 'checkbox') {
|
21
|
+
acc[name] = checked;
|
22
|
+
}
|
23
|
+
else {
|
24
|
+
acc[name] = value;
|
25
|
+
}
|
26
|
+
}
|
27
|
+
return acc;
|
28
|
+
}, {});
|
29
|
+
const requiredFields = Array.from(formElements).filter((formElement) => formElement.required);
|
30
|
+
const requiredFieldsFilledIn = requiredFields.every((formElement) => formElement.value !== '');
|
31
|
+
if (requiredFieldsFilledIn) {
|
32
|
+
this.formSubmitted.emit(formData);
|
33
|
+
//call api
|
34
|
+
}
|
35
|
+
else {
|
36
|
+
alert('Please fill in all required fields');
|
37
|
+
}
|
38
|
+
this.assignmentLoading = true;
|
39
|
+
this.errorMessage = '';
|
40
|
+
this.successMessage = '';
|
41
|
+
var assignmentModel = {
|
42
|
+
AssignmentData: JSON.stringify(formData),
|
43
|
+
AssignmentName: this.name,
|
44
|
+
};
|
45
|
+
console.log(assignmentModel);
|
46
|
+
try {
|
47
|
+
const result = await AssignmentService.getInstance().createAssignment(assignmentModel);
|
48
|
+
if (result.Succeeded) {
|
49
|
+
this.assignmentLoading = false;
|
50
|
+
this.successMessage = 'Assignment submitted Successfully.';
|
51
|
+
this.resetForm();
|
52
|
+
//reset all inputs
|
53
|
+
}
|
54
|
+
else {
|
55
|
+
this.assignmentLoading = false;
|
56
|
+
this.errorMessage = 'There is an error while posting to feed.';
|
57
|
+
}
|
58
|
+
}
|
59
|
+
catch (ex) {
|
60
|
+
this.assignmentLoading = false;
|
61
|
+
}
|
62
|
+
};
|
63
|
+
}
|
64
|
+
fileUploaded(e) {
|
65
|
+
console.log('fileUploaded', e);
|
66
|
+
}
|
67
|
+
resetForm() {
|
68
|
+
const form = this.el.querySelector('form');
|
69
|
+
if (form) {
|
70
|
+
form.reset();
|
71
|
+
}
|
72
|
+
}
|
73
|
+
renderUserInfo() {
|
74
|
+
let authUser = TokenService.getInstance().getAuthUserSync();
|
75
|
+
if (authUser && authUser.JWToken) {
|
76
|
+
return (h("ion-avatar", { class: "header-avatar", slot: "end" }, authUser.PhotoUrl ? h("img", { src: authUser.PhotoUrl }) : h("img", { src: "/assets/img/user.png" })));
|
77
|
+
}
|
78
|
+
else {
|
79
|
+
return (h("ion-button", { slot: "end", href: "/login" }, "Login to Post"));
|
80
|
+
}
|
81
|
+
}
|
82
|
+
isAuthenticated() {
|
83
|
+
return TokenService.getInstance().isAuthenticated();
|
84
|
+
}
|
85
|
+
render() {
|
86
|
+
const userInfo = this.renderUserInfo();
|
87
|
+
return (h(Host, null,
|
88
|
+
h("ion-card", null,
|
89
|
+
h("ion-item", { class: "header ion-justify-content-between", lines: "full" },
|
90
|
+
h("ion-label", null, this.name),
|
91
|
+
userInfo),
|
92
|
+
h("ion-card-content", null,
|
93
|
+
h("form", { onSubmit: this.onSubmit },
|
94
|
+
h("slot", null),
|
95
|
+
h("div", { class: "assignment-footer-container" },
|
96
|
+
h("div", { class: "assignment-footer" },
|
97
|
+
h("div", null,
|
98
|
+
h("div", { class: "error" }, this.errorMessage),
|
99
|
+
h("div", { class: "success" }, this.successMessage)),
|
100
|
+
h("div", null, this.assignmentLoading ? h("ion-spinner", { color: "primary" }) : ''),
|
101
|
+
h("ion-button", { type: "submit", slot: "end", size: "default", disabled: this.assignmentLoading || !this.isAuthenticated() }, "Submit"))))))));
|
102
|
+
}
|
103
|
+
static get is() { return "sparkle-assignment"; }
|
104
|
+
static get originalStyleUrls() { return {
|
105
|
+
"$": ["sparkle-assignment.scss"]
|
106
|
+
}; }
|
107
|
+
static get styleUrls() { return {
|
108
|
+
"$": ["sparkle-assignment.css"]
|
109
|
+
}; }
|
110
|
+
static get properties() { return {
|
111
|
+
"name": {
|
112
|
+
"type": "string",
|
113
|
+
"mutable": true,
|
114
|
+
"complexType": {
|
115
|
+
"original": "string",
|
116
|
+
"resolved": "string",
|
117
|
+
"references": {}
|
118
|
+
},
|
119
|
+
"required": false,
|
120
|
+
"optional": false,
|
121
|
+
"docs": {
|
122
|
+
"tags": [],
|
123
|
+
"text": ""
|
124
|
+
},
|
125
|
+
"attribute": "name",
|
126
|
+
"reflect": false
|
127
|
+
}
|
128
|
+
}; }
|
129
|
+
static get states() { return {
|
130
|
+
"submitted": {},
|
131
|
+
"assignmentLoading": {},
|
132
|
+
"errorMessage": {},
|
133
|
+
"successMessage": {}
|
134
|
+
}; }
|
135
|
+
static get events() { return [{
|
136
|
+
"method": "formSubmitted",
|
137
|
+
"name": "formSubmitted",
|
138
|
+
"bubbles": true,
|
139
|
+
"cancelable": true,
|
140
|
+
"composed": true,
|
141
|
+
"docs": {
|
142
|
+
"tags": [],
|
143
|
+
"text": ""
|
144
|
+
},
|
145
|
+
"complexType": {
|
146
|
+
"original": "any",
|
147
|
+
"resolved": "any",
|
148
|
+
"references": {}
|
149
|
+
}
|
150
|
+
}]; }
|
151
|
+
static get elementRef() { return "el"; }
|
152
|
+
static get listeners() { return [{
|
153
|
+
"name": "fileUploaded",
|
154
|
+
"method": "fileUploaded",
|
155
|
+
"target": undefined,
|
156
|
+
"capture": false,
|
157
|
+
"passive": false
|
158
|
+
}]; }
|
159
|
+
}
|
@@ -8,6 +8,13 @@ sparkle-character-intro .character-phrase-block {
|
|
8
8
|
align-items: center;
|
9
9
|
padding: 20px;
|
10
10
|
}
|
11
|
+
sparkle-character-intro.shift-up .character-phrase-block {
|
12
|
+
padding-top: 0px !important;
|
13
|
+
}
|
14
|
+
sparkle-character-intro.shift-up-overlap .character-phrase-block {
|
15
|
+
padding-top: 0px !important;
|
16
|
+
margin-top: -50px !important;
|
17
|
+
}
|
11
18
|
sparkle-character-intro .character-phrase-block.right {
|
12
19
|
justify-content: flex-end;
|
13
20
|
}
|
@@ -21,7 +28,7 @@ sparkle-character-intro .character-phrase-block.left .character-image-block {
|
|
21
28
|
order: 1;
|
22
29
|
}
|
23
30
|
sparkle-character-intro .character-box {
|
24
|
-
|
31
|
+
width: 80%;
|
25
32
|
border-radius: 15px;
|
26
33
|
background: var(--sparkle-character-background-color);
|
27
34
|
color: var(--text-color);
|
@@ -1,4 +1,4 @@
|
|
1
|
-
import { Component, Element, Prop, getAssetPath, h } from '@stencil/core';
|
1
|
+
import { Component, Element, Prop, getAssetPath, Host, h } from '@stencil/core';
|
2
2
|
export class SparkleCharacterIntro {
|
3
3
|
constructor() {
|
4
4
|
this.character = 'jen';
|
@@ -8,11 +8,12 @@ export class SparkleCharacterIntro {
|
|
8
8
|
console.log(this.character);
|
9
9
|
}
|
10
10
|
render() {
|
11
|
-
return (h(
|
12
|
-
h("div", { class: `character-
|
13
|
-
h("
|
14
|
-
|
15
|
-
h("
|
11
|
+
return (h(Host, null,
|
12
|
+
h("div", { class: `character-phrase-block ${this.position}` },
|
13
|
+
h("div", { class: `character-box ${this.position}` },
|
14
|
+
h("slot", null)),
|
15
|
+
h("div", { class: `character-image-block ${this.position}` },
|
16
|
+
h("img", { class: "image-animation", src: getAssetPath('./assets/characters/' + this.character + '.png') })))));
|
16
17
|
}
|
17
18
|
static get is() { return "sparkle-character-intro"; }
|
18
19
|
static get originalStyleUrls() { return {
|
@@ -62,3 +63,6 @@ export class SparkleCharacterIntro {
|
|
62
63
|
}; }
|
63
64
|
static get elementRef() { return "el"; }
|
64
65
|
}
|
66
|
+
//README
|
67
|
+
//To set custom margin top use following class selector
|
68
|
+
//sparkle-character-intro.shift-up-overlap .character-phrase-block { maring-top:-100px !important;}
|
@@ -1,4 +1,4 @@
|
|
1
|
-
import { Component, State, Event, Watch, Build, h } from '@stencil/core';
|
1
|
+
import { Component, State, Event, Watch, Build, h, Listen } from '@stencil/core';
|
2
2
|
import { injectHistory } from '@stencil/router';
|
3
3
|
import { PrivateRoute } from '../../PrivateRoute';
|
4
4
|
import { AssetsService } from '../../services/core/assets.service';
|
@@ -14,7 +14,7 @@ export class SparkleCourseRoot {
|
|
14
14
|
this.config = {
|
15
15
|
appUrl: 'http://localhost:3333',
|
16
16
|
globalAssetsUrl: 'http://localhost:3333/assets',
|
17
|
-
apiUrl: 'https://localhost:
|
17
|
+
apiUrl: 'https://localhost:44369/',
|
18
18
|
quizPath: this.quizPath,
|
19
19
|
tocPath: this.tocPath,
|
20
20
|
menu: {
|
@@ -63,6 +63,10 @@ export class SparkleCourseRoot {
|
|
63
63
|
var sidebar = document.getElementById('onlineStudents');
|
64
64
|
await sidebar.show();
|
65
65
|
}
|
66
|
+
useDidLogin(event) {
|
67
|
+
console.log('Received the userDidLogInevent: ', event.detail);
|
68
|
+
return h("stencil-router-redirect", { url: "/home" });
|
69
|
+
}
|
66
70
|
renderPage(path) {
|
67
71
|
return (h("stencil-route", { url: '/' + path, routeRender: props => [
|
68
72
|
this.renderHeaderAndMenu(),
|
@@ -181,5 +185,12 @@ export class SparkleCourseRoot {
|
|
181
185
|
"propName": "isMenuToggled",
|
182
186
|
"methodName": "lockScroll"
|
183
187
|
}]; }
|
188
|
+
static get listeners() { return [{
|
189
|
+
"name": "userDidLogIn",
|
190
|
+
"method": "useDidLogin",
|
191
|
+
"target": undefined,
|
192
|
+
"capture": false,
|
193
|
+
"passive": false
|
194
|
+
}]; }
|
184
195
|
}
|
185
196
|
injectHistory(SparkleCourseRoot);
|
@@ -23,9 +23,10 @@ export class SparkleDiscussionQuestions {
|
|
23
23
|
//console.log(question, option);
|
24
24
|
SignalRService.getInstance().callSignalR('PollSubmission', {
|
25
25
|
questionId: question.questionId,
|
26
|
-
question: question.
|
26
|
+
question: question.questionText,
|
27
27
|
answer: option.option,
|
28
|
-
responseType: question.
|
28
|
+
responseType: question.questionType,
|
29
|
+
pageUrl: window.location.href,
|
29
30
|
});
|
30
31
|
}
|
31
32
|
addSuggestion(evt, question) {
|
@@ -39,6 +40,7 @@ export class SparkleDiscussionQuestions {
|
|
39
40
|
question: question.questionText,
|
40
41
|
answer: inputVal.value,
|
41
42
|
responseType: question.questionType,
|
43
|
+
pageUrl: window.location.href,
|
42
44
|
});
|
43
45
|
// this.dataSvc.callSignalR(
|
44
46
|
// {
|
@@ -1,5 +1,6 @@
|
|
1
1
|
import { Component, Element, State, Prop, Listen, h, Watch } from '@stencil/core';
|
2
2
|
import { SignalRService } from '../../../services/signalR.service';
|
3
|
+
import signalRStore from '../../../stores/signalR.store';
|
3
4
|
export class SparkleDiscussionResults {
|
4
5
|
constructor() {
|
5
6
|
this.allowPostToFeed = false;
|
@@ -21,10 +22,10 @@ export class SparkleDiscussionResults {
|
|
21
22
|
var detail = evt.detail;
|
22
23
|
if (detail.type == 'list') {
|
23
24
|
detail.data.forEach(element => {
|
24
|
-
if (element.responseType ==
|
25
|
+
if (element.responseType == 'TEXT') {
|
25
26
|
this.addToWordCloud(element);
|
26
27
|
}
|
27
|
-
else if (element.responseType ==
|
28
|
+
else if (element.responseType == 'MULTIPLE-CHOICE') {
|
28
29
|
this.addToBarChart(element);
|
29
30
|
}
|
30
31
|
});
|
@@ -34,10 +35,10 @@ export class SparkleDiscussionResults {
|
|
34
35
|
}
|
35
36
|
else {
|
36
37
|
detail = detail.data;
|
37
|
-
if (detail.responseType ==
|
38
|
+
if (detail.responseType == 'TEXT') {
|
38
39
|
this.addToWordCloud(detail);
|
39
40
|
}
|
40
|
-
else if (detail.responseType ==
|
41
|
+
else if (detail.responseType == 'MULTIPLE-CHOICE') {
|
41
42
|
this.addToBarChart(detail);
|
42
43
|
}
|
43
44
|
}
|
@@ -83,13 +84,18 @@ export class SparkleDiscussionResults {
|
|
83
84
|
componentDidLoad() {
|
84
85
|
if (this.questions) {
|
85
86
|
this.setupData(this.questions);
|
87
|
+
signalRStore.onChange('connected', connected => {
|
88
|
+
if (connected && this.isTeacherMode) {
|
89
|
+
SignalRService.getInstance().callSignalR('GetPollSubmission', { pageUrl: window.location.href });
|
90
|
+
}
|
91
|
+
});
|
86
92
|
}
|
87
93
|
}
|
88
94
|
setupData(questions) {
|
89
95
|
this.setupResponseGraph(questions);
|
90
|
-
if (this.isTeacherMode) {
|
91
|
-
|
92
|
-
}
|
96
|
+
// if (this.isTeacherMode) {
|
97
|
+
// SignalRService.getInstance().callSignalR('GetPollSubmission', {});
|
98
|
+
// }
|
93
99
|
}
|
94
100
|
resetPollData() {
|
95
101
|
SignalRService.getInstance().callSignalR('ResetPollData', {});
|
@@ -259,9 +265,9 @@ export class SparkleDiscussionResults {
|
|
259
265
|
"methodName": "questionsChaged"
|
260
266
|
}]; }
|
261
267
|
static get listeners() { return [{
|
262
|
-
"name": "
|
268
|
+
"name": "receivedPollSubmissionSignalREvent",
|
263
269
|
"method": "gotServerUpdate",
|
264
|
-
"target":
|
270
|
+
"target": "body",
|
265
271
|
"capture": false,
|
266
272
|
"passive": false
|
267
273
|
}]; }
|
@@ -4,10 +4,11 @@ export class SparkleDiscussion {
|
|
4
4
|
constructor() {
|
5
5
|
this.allowPostToFeed = false;
|
6
6
|
this.feedStartingText = 'My suggestions are:';
|
7
|
-
this.isTeacherMode =
|
7
|
+
this.isTeacherMode = false;
|
8
8
|
this.quizData = [];
|
9
9
|
}
|
10
10
|
async componentDidLoad() {
|
11
|
+
this.isTeacherMode = this.isTeacherMode == false ? window.location.href.indexOf('/presentation/course') > -1 : this.isTeacherMode;
|
11
12
|
const config = EnvironmentConfigService.getInstance().get('sparkle');
|
12
13
|
let allQuizData = await AssetsService.getInstance().loadJsonFile(config.quizPath);
|
13
14
|
if (allQuizData) {
|
@@ -17,6 +18,7 @@ export class SparkleDiscussion {
|
|
17
18
|
questionIds.forEach(id => {
|
18
19
|
this.quizData = [...this.quizData, allQuizData[+id]];
|
19
20
|
});
|
21
|
+
console.log('QUIZ Data', this.quizData);
|
20
22
|
}
|
21
23
|
}
|
22
24
|
}
|
@@ -69,7 +71,7 @@ export class SparkleDiscussion {
|
|
69
71
|
},
|
70
72
|
"isTeacherMode": {
|
71
73
|
"type": "boolean",
|
72
|
-
"mutable":
|
74
|
+
"mutable": true,
|
73
75
|
"complexType": {
|
74
76
|
"original": "boolean",
|
75
77
|
"resolved": "boolean",
|
@@ -83,7 +85,7 @@ export class SparkleDiscussion {
|
|
83
85
|
},
|
84
86
|
"attribute": "is-teacher-mode",
|
85
87
|
"reflect": false,
|
86
|
-
"defaultValue": "
|
88
|
+
"defaultValue": "false"
|
87
89
|
},
|
88
90
|
"questionIds": {
|
89
91
|
"type": "string",
|