@sparkle-learning/core 0.0.53 → 0.0.54
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-e2047db2.js} +18 -30
- package/dist/cjs/{feed.service-b4f09441.js → appdata.service-d28cf2d6.js} +4 -56
- package/dist/cjs/{assets.service-0c759d51.js → assets.service-bfa75092.js} +1 -1
- package/dist/cjs/{environment-config.service-0e02b049.js → environment-config.service-c8ff1f3d.js} +0 -1
- package/dist/cjs/{facilitator.service-9e990274.js → facilitator.service-0b9f6ac7.js} +1 -1
- package/dist/cjs/feed.service-6df9382f.js +57 -0
- package/dist/cjs/header-mobile-collapse_61.cjs.entry.js +76 -87
- package/dist/cjs/{httpService-7211d93b.js → httpService-d8a5b474.js} +13 -11
- package/dist/cjs/index.cjs.js +5 -4
- package/dist/cjs/ion-select_3.cjs.entry.js +77 -68
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/cjs/media.service-2bc73d37.js +40 -0
- package/dist/cjs/{signalR.service-5672eebc.js → signalR.service-0d5da1d3.js} +18 -20
- package/dist/cjs/sparkle-animation-player.cjs.entry.js +1 -1
- package/dist/cjs/sparkle-assignment.cjs.entry.js +25 -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-feedback.cjs.entry.js +5 -3
- package/dist/cjs/sparkle-goal-form.cjs.entry.js +11 -8
- 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-d8ec2551.js} +1 -1
- package/dist/cjs/token.service-bfb0089b.js +86 -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 +3 -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 +3 -0
- package/dist/collection/components/sparkle-assignment/sparkle-assignment.js +25 -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 -67
- 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 +68 -0
- package/dist/collection/util.js +5 -2
- package/dist/esm/{PrivateRoute-c5441f35.js → PrivateRoute-c6e80d5d.js} +17 -29
- package/dist/esm/{feed.service-8fbe4ce3.js → appdata.service-d1058e00.js} +5 -55
- package/dist/esm/{assets.service-66e848b8.js → assets.service-def1d63c.js} +1 -1
- package/dist/esm/{environment-config.service-2b5d692b.js → environment-config.service-b191f276.js} +0 -1
- package/dist/esm/{facilitator.service-b0292f7f.js → facilitator.service-53e05a01.js} +1 -1
- package/dist/esm/feed.service-8385ad7a.js +54 -0
- package/dist/esm/header-mobile-collapse_61.entry.js +70 -81
- package/dist/esm/{httpService-7b75b095.js → httpService-db476835.js} +13 -11
- package/dist/esm/index.js +5 -4
- package/dist/esm/ion-select_3.entry.js +77 -68
- package/dist/esm/loader.js +1 -1
- package/dist/esm/media.service-b68cbfff.js +37 -0
- package/dist/esm/{signalR.service-9d5b9f36.js → signalR.service-4a2d5a92.js} +18 -20
- package/dist/esm/sparkle-animation-player.entry.js +1 -1
- package/dist/esm/sparkle-assignment.entry.js +21 -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 +5 -3
- package/dist/esm/sparkle-feedback.entry.js +5 -3
- package/dist/esm/sparkle-goal-form.entry.js +8 -5
- 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-6457aaa0.js} +1 -1
- package/dist/esm/token.service-20f1a256.js +83 -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-11ac00b0.js +1 -0
- package/dist/sparkle-core/p-13ec39db.entry.js +1 -0
- package/dist/sparkle-core/{p-5efc6566.js → p-17b6b07e.js} +1 -1
- package/dist/sparkle-core/p-33a7151d.entry.js +1 -0
- package/dist/sparkle-core/{p-fbccd30c.js → p-38f707fb.js} +1 -1
- package/dist/sparkle-core/p-38fa5987.js +1 -0
- package/dist/sparkle-core/{p-9a443f51.js → p-408176ba.js} +1 -1
- package/dist/sparkle-core/p-630a4fa0.js +1 -0
- package/dist/sparkle-core/{p-0a5d7c4f.entry.js → p-6a1fc0af.entry.js} +26 -26
- package/dist/sparkle-core/p-6fab3a4b.js +1 -0
- package/dist/sparkle-core/p-71720d6e.entry.js +1 -0
- package/dist/sparkle-core/{p-162bff1a.entry.js → p-72053ae0.entry.js} +1 -1
- package/dist/sparkle-core/{p-18cdd458.entry.js → p-85d4cd5c.entry.js} +1 -1
- package/dist/sparkle-core/p-967a2ed7.js +1 -0
- package/dist/sparkle-core/{p-ff0e0d4e.entry.js → p-98daeddb.entry.js} +1 -1
- package/dist/sparkle-core/p-98f7780c.entry.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-44334ef3.entry.js → p-ca907214.entry.js} +2 -2
- package/dist/sparkle-core/p-d51f30ca.js +1 -0
- package/dist/sparkle-core/p-dcff298d.entry.js +1 -0
- package/dist/sparkle-core/p-e50c8b04.entry.js +1 -0
- package/dist/sparkle-core/p-ed9de327.js +1 -0
- package/dist/sparkle-core/p-f891c79a.entry.js +1 -0
- 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 +6 -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 +3 -2
- 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 +49 -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 +12 -0
- package/dist/types/util.d.ts +1 -0
- package/package.json +1 -1
- package/dist/cjs/sparkle-quiz-v1.cjs.entry.js +0 -105
- package/dist/esm/sparkle-quiz-v1.entry.js +0 -101
- 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-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-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
@@ -1,33 +1,24 @@
|
|
1
1
|
import { r as registerInstance, i as createEvent, h, e as getElement } from './index-c04b9ed5.js';
|
2
|
+
import { A as AssetsService } from './assets.service-def1d63c.js';
|
3
|
+
import { E as EnvironmentConfigService } from './environment-config.service-b191f276.js';
|
2
4
|
|
3
|
-
const sparkleQuizCss = "sparkle-quiz{display:block;font-family:var(--font-family);--sparkle-quiz-question-container-padding:10px 0px;--sparkle-quiz-question-container-margin:0px;--sparkle-quiz-question-text-padding:10px 0px;--sparkle-quiz-option-border:2px solid var(--line-rule-color);--sparkle-quiz-selected-option-border:2px solid var(--text-color--dark);--sparkle-quiz-option-border-radius:4px;--sparkle-quiz-option-padding:5px 10px;--sparkle-quiz-option-width:100%;--sparkle-quiz-error-bg-color:#fbaeae;--sparkle-quiz-success-bg-color:#fbaeae;padding:var(--sparkle-quiz-question-container-padding);margin:var(--sparkle-quiz-question-container-margin)}.question-text{padding:var(--sparkle-quiz-question-text-padding)}.option{padding:5px 0px}.number{padding:0px 14px;border:1px solid #ebebeb;border-radius:4px;margin-right:10px;font-size:14px;width:14px;display:inline-flex;justify-content:center}.feedback-container{padding:10px;border-radius:4px}.incorrect .feedback-container{background-color:var(--sparkle-quiz-error-bg-color, #fbaeae)}.correct .feedback-container{background-color:var(--sparkle-quiz-success-bg-color, #fbaeae)}";
|
5
|
+
const sparkleQuizCss = "sparkle-quiz-v1{display:block;font-family:var(--font-family);--sparkle-quiz-question-container-padding:10px 0px;--sparkle-quiz-question-container-margin:0px;--sparkle-quiz-question-text-padding:10px 0px;--sparkle-quiz-option-border:2px solid var(--line-rule-color);--sparkle-quiz-selected-option-border:2px solid var(--text-color--dark);--sparkle-quiz-option-border-radius:4px;--sparkle-quiz-option-padding:5px 10px;--sparkle-quiz-option-width:100%;--sparkle-quiz-error-bg-color:#fbaeae;--sparkle-quiz-success-bg-color:#fbaeae;padding:var(--sparkle-quiz-question-container-padding);margin:var(--sparkle-quiz-question-container-margin)}.question-text{padding:var(--sparkle-quiz-question-text-padding)}.option{padding:5px 0px}.number{padding:0px 14px;border:1px solid #ebebeb;border-radius:4px;margin-right:10px;font-size:14px;width:14px;display:inline-flex;justify-content:center}.feedback-container{padding:10px;border-radius:4px}.incorrect .feedback-container{background-color:var(--sparkle-quiz-error-bg-color, #fbaeae)}.correct .feedback-container{background-color:var(--sparkle-quiz-success-bg-color, #fbaeae)}";
|
4
6
|
|
5
7
|
const SparkleQuiz = class {
|
6
8
|
constructor(hostRef) {
|
7
9
|
registerInstance(this, hostRef);
|
8
10
|
this.quizAnswerChanged = createEvent(this, "quizAnswerChanged", 7);
|
9
|
-
this.type = 'TEXT';
|
10
|
-
this.scale = 'FIVE-POINTS';
|
11
|
-
this.options = [];
|
12
11
|
}
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
// }
|
19
|
-
// }
|
20
|
-
//@State() question: SparkleQuizQuestion;
|
21
|
-
//@State() quizData: { [key: string]: SparkleQuizQuestion };
|
12
|
+
async loadQuestion() {
|
13
|
+
if (this.quizData) {
|
14
|
+
this.question = this.quizData[+this.questionId];
|
15
|
+
}
|
16
|
+
}
|
22
17
|
async componentWillLoad() { }
|
23
18
|
async componentDidLoad() {
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
this.options = [...this.options, { option: el.innerText }];
|
28
|
-
});
|
29
|
-
console.log(this.questionText, this.options);
|
30
|
-
}
|
19
|
+
const config = EnvironmentConfigService.getInstance().get('sparkle');
|
20
|
+
this.quizData = await AssetsService.getInstance().loadJsonFile(config.quizPath);
|
21
|
+
await this.loadQuestion();
|
31
22
|
this.quizAnswerChanged.emit({
|
32
23
|
question: null,
|
33
24
|
answer: '1',
|
@@ -58,58 +49,50 @@ const SparkleQuiz = class {
|
|
58
49
|
});
|
59
50
|
}
|
60
51
|
getQuestionFeedback() {
|
61
|
-
if (this.
|
62
|
-
|
63
|
-
|
64
|
-
return h("small", null);
|
52
|
+
if (this.question.questionType == 'MULTIPLE-CHOICE') {
|
53
|
+
const feedbacks = this.question.options.filter(x => x.correct == true).map(x => x.feedback);
|
54
|
+
return feedbacks.length > 0 && feedbacks.map(feedback => h("small", null, feedback));
|
65
55
|
}
|
66
|
-
else if (this.
|
67
|
-
return this.feedback && h("small", null, " ", this.feedback);
|
56
|
+
else if (this.question.questionType == 'FEEDBACK' || this.question.questionType == 'TEXT') {
|
57
|
+
return this.question.feedback && h("small", null, " ", this.question.feedback);
|
68
58
|
}
|
69
59
|
}
|
70
60
|
showAnswerStatus() {
|
71
61
|
return h("div", null, this.correct ? h("strong", null, "Good job!") : h("strong", null, "Incorrect answer, please try again."));
|
72
62
|
}
|
73
63
|
renderQuestion() {
|
74
|
-
|
75
|
-
|
76
|
-
questionText: this.questionText,
|
77
|
-
questionType: this.type,
|
78
|
-
scale: this.scale,
|
79
|
-
showOptionNumber: this.showOptionNumber,
|
80
|
-
options: this.options,
|
81
|
-
//options: Array<SparkleQuizQuestionOption>;
|
82
|
-
feedback: this.feedback,
|
83
|
-
};
|
84
|
-
if (this.type == 'MULTIPLE-CHOICE') {
|
85
|
-
return h("sparkle-quiz-select", { question: question, allowMultiple: true });
|
64
|
+
if (this.question.questionType == 'MULTIPLE-CHOICE') {
|
65
|
+
return h("sparkle-quiz-select", { question: this.question, allowMultiple: true });
|
86
66
|
}
|
87
|
-
else if (this.
|
88
|
-
return h("sparkle-quiz-feedback", { question: question });
|
67
|
+
else if (this.question.questionType == 'FEEDBACK') {
|
68
|
+
return h("sparkle-quiz-feedback", { question: this.question });
|
89
69
|
}
|
90
|
-
else if (this.
|
91
|
-
return h("sparkle-quiz-input", { question: question });
|
70
|
+
else if (this.question.questionType == 'TEXT') {
|
71
|
+
return h("sparkle-quiz-input", { question: this.question });
|
92
72
|
}
|
93
|
-
else if (this.
|
94
|
-
return h("sparkle-quiz-opinion", { question: question });
|
73
|
+
else if (this.question.questionType == 'OPINION') {
|
74
|
+
return h("sparkle-quiz-opinion", { question: this.question });
|
95
75
|
}
|
96
|
-
else if (this.
|
97
|
-
return h("sparkle-quiz-poll", { question: question });
|
76
|
+
else if (this.question.questionType == 'POLL') {
|
77
|
+
return h("sparkle-quiz-poll", { question: this.question });
|
98
78
|
}
|
99
79
|
}
|
100
80
|
render() {
|
101
|
-
if (this.
|
81
|
+
if (this.question) {
|
102
82
|
let classes = {
|
103
83
|
correct: this.submitted && this.correct,
|
104
84
|
incorrect: this.submitted && !this.correct,
|
105
85
|
};
|
106
|
-
return (h("div", { class: classes
|
86
|
+
return (h("div", { class: classes }, this.renderQuestion(), this.submitted && this.showInstantResult && h("div", { class: "feedback-container" }, [this.showAnswerStatus(), this.getQuestionFeedback()])));
|
107
87
|
}
|
108
88
|
else {
|
109
89
|
return h("p", null, "No question found.");
|
110
90
|
}
|
111
91
|
}
|
112
92
|
get el() { return getElement(this); }
|
93
|
+
static get watchers() { return {
|
94
|
+
"questionId": ["loadQuestion"]
|
95
|
+
}; }
|
113
96
|
};
|
114
97
|
SparkleQuiz.style = sparkleQuizCss;
|
115
98
|
|
@@ -0,0 +1,83 @@
|
|
1
|
+
import { A as AuthStore } from './auth.store-dba2c2da.js';
|
2
|
+
import { g as get, s as set, r as remove } from './localstorage.service-4bf408c8.js';
|
3
|
+
|
4
|
+
const AppConsts = {
|
5
|
+
AUTH_USER_LOCALSTORAGE: "CurrentUser",
|
6
|
+
userManagement: {
|
7
|
+
defaultAdminUserName: 'admin',
|
8
|
+
},
|
9
|
+
localization: {
|
10
|
+
defaultLocalizationSourceName: 'Test',
|
11
|
+
},
|
12
|
+
authorization: {
|
13
|
+
encrptedAuthTokenName: 'enc_auth_token',
|
14
|
+
}
|
15
|
+
};
|
16
|
+
|
17
|
+
class TokenService {
|
18
|
+
static getInstance() {
|
19
|
+
if (!TokenService.instance) {
|
20
|
+
TokenService.instance = new TokenService();
|
21
|
+
}
|
22
|
+
return TokenService.instance;
|
23
|
+
}
|
24
|
+
async getToken() {
|
25
|
+
let authUser = await get(AppConsts.AUTH_USER_LOCALSTORAGE);
|
26
|
+
if (authUser && authUser.JWToken) {
|
27
|
+
if (new Date(authUser.ExpiresOn).getTime() > new Date().getTime()) {
|
28
|
+
return authUser.JWToken;
|
29
|
+
}
|
30
|
+
}
|
31
|
+
return null;
|
32
|
+
}
|
33
|
+
async getAuthUser() {
|
34
|
+
let authUser = await get(AppConsts.AUTH_USER_LOCALSTORAGE);
|
35
|
+
if (authUser && authUser.JWToken) {
|
36
|
+
if (new Date(authUser.ExpiresOn).getTime() > new Date().getTime()) {
|
37
|
+
return authUser;
|
38
|
+
}
|
39
|
+
}
|
40
|
+
return null;
|
41
|
+
}
|
42
|
+
getAuthUserSync() {
|
43
|
+
let authUser = JSON.parse(localStorage.getItem(AppConsts.AUTH_USER_LOCALSTORAGE));
|
44
|
+
if (authUser && authUser.JWToken) {
|
45
|
+
if (new Date(authUser.ExpiresOn).getTime() > new Date().getTime()) {
|
46
|
+
return authUser;
|
47
|
+
}
|
48
|
+
}
|
49
|
+
return null;
|
50
|
+
}
|
51
|
+
getTokenSync() {
|
52
|
+
let authUser = JSON.parse(localStorage.getItem(AppConsts.AUTH_USER_LOCALSTORAGE));
|
53
|
+
if (authUser && authUser.JWToken) {
|
54
|
+
if (new Date(authUser.ExpiresOn).getTime() > new Date().getTime()) {
|
55
|
+
return authUser.JWToken;
|
56
|
+
}
|
57
|
+
}
|
58
|
+
return null;
|
59
|
+
}
|
60
|
+
async getTokenExpiry() {
|
61
|
+
let authUser = await get(AppConsts.AUTH_USER_LOCALSTORAGE);
|
62
|
+
if (!authUser) {
|
63
|
+
return 0;
|
64
|
+
}
|
65
|
+
let timeDiff = 0;
|
66
|
+
if (authUser.ExpiresOn) {
|
67
|
+
timeDiff = new Date(authUser.ExpiresOn).getTime() - new Date().getTime();
|
68
|
+
}
|
69
|
+
return Math.max(0, timeDiff);
|
70
|
+
}
|
71
|
+
async saveAuthUser(authUser) {
|
72
|
+
AuthStore.state.authUser = Object.assign({}, authUser);
|
73
|
+
AuthStore.state.isAuthenticated = true;
|
74
|
+
await set(AppConsts.AUTH_USER_LOCALSTORAGE, authUser);
|
75
|
+
}
|
76
|
+
async removeAuthUser() {
|
77
|
+
AuthStore.state.authUser = null;
|
78
|
+
AuthStore.state.isAuthenticated = false;
|
79
|
+
await remove(AppConsts.AUTH_USER_LOCALSTORAGE);
|
80
|
+
}
|
81
|
+
}
|
82
|
+
|
83
|
+
export { AppConsts as A, TokenService as T };
|
@@ -2417,7 +2417,7 @@ function GetGoalAppData(title, description, category, percentage, goalText) {
|
|
2417
2417
|
Description: description,
|
2418
2418
|
Category: category,
|
2419
2419
|
Percentage: percentage,
|
2420
|
-
GoalText: goalText
|
2420
|
+
GoalText: goalText,
|
2421
2421
|
};
|
2422
2422
|
}
|
2423
2423
|
function MyMoodTemplate(feeling, intensity, location) {
|
@@ -2443,7 +2443,7 @@ class SparkleGlobal {
|
|
2443
2443
|
SparkleGlobal.MY_GOALS_APP_ID = 1;
|
2444
2444
|
SparkleGlobal.MY_HEALTH_APP_ID = 2;
|
2445
2445
|
SparkleGlobal.MY_MOOD_APP_ID = 3;
|
2446
|
-
SparkleGlobal.LOCALSTORAGE_CLASSROOM_MODE =
|
2446
|
+
SparkleGlobal.LOCALSTORAGE_CLASSROOM_MODE = 'SPARKLE_CLASSROOM_MODE';
|
2447
2447
|
function date(date) {
|
2448
2448
|
return format(new Date(date), 'DD MMM YYYY');
|
2449
2449
|
}
|
@@ -1 +1 @@
|
|
1
|
-
export{A as AuthService,P as PrivateRoute,i as initSetupEnvironmentConfig,s as setupEnvironmentConfig}from"./p-
|
1
|
+
export{A as AuthService,P as PrivateRoute,i as initSetupEnvironmentConfig,s as setupEnvironmentConfig}from"./p-38fa5987.js";export{E as EnvironmentConfigService}from"./p-bd90903e.js";export{A as AssetsService}from"./p-408176ba.js";export{A as AuthStore}from"./p-2f569553.js";import"./p-ee1e0eb4.js";import"./p-5d409601.js";import"./p-967a2ed7.js";import"./p-2ff67662.js";import"./p-871106e0.js";import"./p-add30d46.js";import"./p-d68092b7.js";import"./p-ed9de327.js";
|
@@ -0,0 +1 @@
|
|
1
|
+
import{H as t}from"./p-967a2ed7.js";import{d as a}from"./p-2f569553.js";const{state:e,reset:s}=a({mediaUploading:!1}),r={state:e,reset:s};class o{constructor(){}static getInstance(){return o.instance||(o.instance=new o),o.instance}async uploadImage(a){let e,s=new FormData;for(let t=0;t<a.length;t++)s.append("uploads[]",a[t],a[t].name);r.state.mediaUploading=!0;try{e=await t.http.post("api/v1/MediaItems/Upload",s),e&&(r.state.mediaUploading=!1)}catch(t){r.state.mediaUploading=!1}return e}}export{o as M,r as m}
|
@@ -0,0 +1 @@
|
|
1
|
+
import{r,h as a,c as t,H as e,e as c}from"./p-ee1e0eb4.js";const o=class{constructor(a){r(this,a),this.character="jen",this.position="right"}componentDidLoad(){console.log(this.character)}render(){return a(e,null,a("div",{class:`character-phrase-block ${this.position}`},a("div",{class:`character-box ${this.position}`},a("slot",null)),a("div",{class:`character-image-block ${this.position}`},a("img",{class:"image-animation",src:t("./assets/characters/"+this.character+".png")}))))}static get assetsDirs(){return["assets"]}get el(){return c(this)}};o.style='sparkle-character-intro{--sparkle-character-background-color:#e7e7e7}sparkle-character-intro .character-phrase-block{display:flex;width:100%;min-height:200px;align-items:center;padding:20px}sparkle-character-intro.shift-up .character-phrase-block{padding-top:0px !important}sparkle-character-intro.shift-up-overlap .character-phrase-block{padding-top:0px !important;margin-top:-50px !important}sparkle-character-intro .character-phrase-block.right{justify-content:flex-end}sparkle-character-intro .character-phrase-block.left{justify-content:flex-start}sparkle-character-intro .character-phrase-block.left .character-box{order:2}sparkle-character-intro .character-phrase-block.left .character-image-block{order:1}sparkle-character-intro .character-box{width:80%;border-radius:15px;background:var(--sparkle-character-background-color);color:var(--text-color);padding:20px;text-align:center;position:relative;box-shadow:0px 1px 3px rgba(2, 8, 20, 0.06), 0px 1px 2px rgba(2, 8, 20, 0.04)}sparkle-character-intro .character-box.right:before{content:"";width:0px;height:0px;position:absolute;border-left:15px solid var(--sparkle-character-background-color);border-right:15px solid transparent;border-top:15px solid var(--sparkle-character-background-color);border-bottom:15px solid transparent;right:-16px;top:0px}sparkle-character-intro .character-box.left:before{content:"";width:0px;height:0px;position:absolute;border-left:15px solid transparent;border-right:15px solid var(--sparkle-character-background-color);border-top:15px solid var(--sparkle-character-background-color);border-bottom:15px solid transparent;left:-16px;top:0px}sparkle-character-intro img{max-width:100%;border:0}sparkle-character-intro .character-image-block{float:left;width:20%}sparkle-character-intro .character-image-block.right{transform:rotateY(180deg)}';export{o as sparkle_character_intro}
|
@@ -1 +1 @@
|
|
1
|
-
import{H as e}from"./p-
|
1
|
+
import{H as e}from"./p-967a2ed7.js";import{d as t}from"./p-2f569553.js";const{state:a,onChange:s,reset:r}=t({user:{FirstName:"",LastName:"",ProfileText:"",ProfileImage:"",IsVerified:!1,Roles:[],FacilitatorClassList:[]},loaded:!1,updateLoading:!1,enrollmentList:[]}),n={state:a,onChange:s,reset:r};class i{constructor(){}static getInstance(){return i.instance||(i.instance=new i),i.instance}async enrollClass(t){let a=await e.http.post("api/v1/Student/EnrollClass",t);return a&&(n.state.enrollmentList=[...n.state.enrollmentList,a.Data]),a}async leaveClass(t){let a=await e.http.post("api/v1/Student/LeaveClass",t);return a&&(n.state.enrollmentList=n.state.enrollmentList.filter((e=>e.Id!=a.Data))),a}async fetchUserConfiguration(){let t=await e.http.get("api/v1/Student/UserConfiguration");return t&&(n.state.enrollmentList=t.Data.EnrollmentList,n.state.user.FirstName=t.Data.FirstName,n.state.user.LastName=t.Data.LastName,n.state.user.ProfileText=t.Data.ProfileText,n.state.user.ProfileImage=t.Data.ProfileImage,n.state.user.IsVerified=t.Data.IsVerified,n.state.user.Roles=t.Data.Roles,n.state.user.FacilitatorClassList=t.Data.FacilitatorClassList),t}async updateProfile(t){n.state.updateLoading=!0;let a=await e.http.post("api/Account/update-profile",t);return console.log("after fetch",a),a&&(n.state.updateLoading=!1,n.state.user=Object.assign(Object.assign({},n.state.user),{FirstName:a.Data.FirstName,LastName:a.Data.LastName,ProfileText:a.Data.ProfileText,ProfileImage:a.Data.ProfileImage})),a}async submitFeedback(t){return await e.http.post("api/v1/Feedback",t)}}export{i as S,n as u}
|
@@ -0,0 +1 @@
|
|
1
|
+
import{r as s,h as t,e,H as r}from"./p-ee1e0eb4.js";const n=class{constructor(t){s(this,t),this.submitted=!0}async onSubmit(s){s.preventDefault(),this.submitted=!0}render(){return t(r,null,"Assignment")}get el(){return e(this)}};n.style=":host{display:block}";export{n as sparkle_assignment}
|
@@ -1 +1 @@
|
|
1
|
-
import{H as a}from"./p-
|
1
|
+
import{H as a}from"./p-967a2ed7.js";import{d as e}from"./p-2f569553.js";const{state:t,onChange:s}=e({pageNotes:[],allPageNotes:[],onlineStudents:[],dashboardData:null,isConnected:!1,loading:!1,dashboardDataLoading:!1,notesLoading:!1,classes:[],classesLoading:!1}),o={state:t,onChange:s};class r{constructor(){}static getInstance(){return r.instance||(r.instance=new r),r.instance}async fetchClasses(){o.state.classesLoading=!0;let e=await a.http.get("api/v1/Teacher/Classes");return e&&(o.state.classes=e.Data,o.state.classesLoading=!1),e}async fetchDashboardData(e){o.state.dashboardDataLoading=!0;let t=await a.http.get(`api/v1/Teacher/Dashboard/${e.ClassId}`);return t&&(o.state.dashboardData=t.Data,o.state.dashboardDataLoading=!1),t}async fetchNotes(e){o.state.notesLoading=!0;let t=await a.http.get(`api/v1/Teacher/Notes/${e.showAllNotes}`);return t&&(e.showAllNotes?o.state.allPageNotes=t.Data:o.state.pageNotes=t.Data,o.state.notesLoading=!1),t}async addFacilitatorNote(e){o.state.notesLoading=!0;let t=await a.http.post("api/v1/Teacher/Notes",e);return t&&(o.state.pageNotes=[...o.state.pageNotes,t.Data]),o.state.notesLoading=!1,t}async updateFacilitatorNote(e){o.state.notesLoading=!0;let t=await a.http.put(`api/v1/Teacher/Notes/${e.Id}`,e);return t&&(o.state.pageNotes=o.state.pageNotes.map((a=>a.Id==t.Data.Id?t.Data:a))),o.state.notesLoading=!1,t}async deleteFacilitatorNote(e){o.state.notesLoading=!0;let t=await a.http.delete(`api/v1/Teacher/Notes/${e}`);return t&&(o.state.pageNotes=o.state.pageNotes.filter((a=>a.Id!=e))),o.state.notesLoading=!1,t}}export{r as F,o as f}
|
@@ -0,0 +1 @@
|
|
1
|
+
import{c as t,h as e}from"./p-ee1e0eb4.js";import{r,g as n}from"./p-5d409601.js";import{H as a}from"./p-967a2ed7.js";import{T as o,A as i}from"./p-ed9de327.js";import{A as s}from"./p-2f569553.js";const c=new class{constructor(){this.sample=t=>t[Math.floor(Math.random()*t.length)],this.keyBy=(t,e,r)=>t.reduce(((t,n)=>(t[e(n)]=r?r(n):n,t)),{}),this.debounce=(t,e)=>{let r=null;return(...n)=>{clearTimeout(r),r=setTimeout(t,e,...n)}}}loadScript(t){var e=document.createElement("script");e.type="text/javascript",e.src=t,document.body.appendChild(e)}loadScriptAsync(t){return new Promise((function(e,r){const n=document.createElement("script");let a=!1;n.type="text/javascript",n.src=t,n.async=!0,n.onerror=function(t){r(t)},n.onload=n.onreadystatechange=function(){a||this.readyState&&"complete"!=this.readyState||(a=!0,e(!0))};const o=document.getElementsByTagName("script")[0];o.parentElement.insertBefore(n,o)}))}extend(...t){let e,r,n,a,o,i,s,c=t[0]||{},l=1,u=t.length,p=!1;for("boolean"==typeof c&&(p=c,c=t[l]||{},l++),"object"!=typeof c&&"function"!=typeof c&&(c={}),l===u&&(c=this,l--);l<u;l++)if(null!==(e=t[l]))for(r in e)n=c[r],o=e[r],c!==o&&(a=Array.isArray(n)?"array":typeof n,p&&o&&((i=Array.isArray(o))||"object"==typeof o)?(i?(i=!1,s=n&&"array"===a?n:[]):s=n&&"object"===a?n:{},c[r]=this.extend(p,s,o)):void 0!==o&&(c[r]=o));return c}setLocalization(){if(!sparkle.utils.getCookieValue("Sparkle.Localization.CultureName")){let t=navigator.language;sparkle.utils.setCookieValue("Sparkle.Localization.CultureName",t,new Date((new Date).getTime()+15768e7),sparkle.appPath)}}};async function l(t){if(!window)return;const e=window,r=e.Sparkle;if(!r||!r.config||"Object"===r.config.constructor.name)return e.Sparkle=e.Sparkle||{},e.Sparkle.config=Object.assign(Object.assign({},e.Sparkle.config),t),e.Sparkle.config;console.error("Sparkle config was already initialized")}async function u(e){await c.loadScriptAsync(t("../assets/lib/sparkle.js")),await l(e)}class p{constructor(){}static getInstance(){return p.instance||(p.instance=new p),p.instance}async authenticate(t){const e={"Content-Type":"application/json"};let r;s.state.loading=!0;try{if(r=await a.http.post("api/Account/Authenticate",t,{headers:e}),r){const t=r.Data,e={Id:t.Id,UserName:t.UserName,Email:t.Email,Roles:t.Roles,IsVerified:t.IsVerified,JWToken:t.JWToken,IssuedOn:t.IssuedOn,ExpiresOn:t.ExpiresOn,RefreshToken:t.RefreshToken,PhotoUrl:"",IsFacilitator:t.Roles.indexOf("Facilitator")>0};return await o.getInstance().saveAuthUser(e),s.state.loading=!1,e}}catch(t){return s.state.loading=!1,t}}async signOut(){await r(i.AUTH_USER_LOCALSTORAGE),await o.getInstance().removeAuthUser(),sessionStorage.clear()}async getLocalAuthUser(){return n(i.AUTH_USER_LOCALSTORAGE)}}const f=t=>{var{component:r,permission:n,render:a}=t,o=function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var a=0;for(n=Object.getOwnPropertySymbols(t);a<n.length;a++)e.indexOf(n[a])<0&&Object.prototype.propertyIsEnumerable.call(t,n[a])&&(r[n[a]]=t[n[a]])}return r}(t,["component","permission","render"]);const i=r;return e("stencil-route",Object.assign({},o,{routeRender:t=>s.state.isAuthenticated?n&&!sparkle.auth.isGranted(n)?e("stencil-router-redirect",{url:"/unauthorized"}):i?e(i,Object.assign({},t,t.componentProps)):a(t):e("stencil-router-redirect",{url:"/login"})}))};export{p as A,f as P,u as i,l as s}
|
@@ -1 +1 @@
|
|
1
|
-
import{E as t}from"./p-
|
1
|
+
import{E as t}from"./p-bd90903e.js";class s{constructor(){this.assetsList=void 0}static getInstance(){return s.instance||(s.instance=new s),s.instance}async assets(){return void 0===this.assetsList&&(this.assetsList=await this.init()),this.assetsList}async init(){try{const s=t.getInstance().get("sparkle"),a=await fetch(`${s.globalAssetsUrl}/assets.json`);if(!a)return;return await a.json()}catch(t){return}}async loadJsonFile(t){try{const s=await fetch(`${t}`);if(!s)return;return await s.json()}catch(t){return}}}export{s as A}
|
@@ -0,0 +1 @@
|
|
1
|
+
import{H as t}from"./p-967a2ed7.js";import{d as e}from"./p-2f569553.js";const{state:s,reset:a}=e({posts:[],postsLoading:!1,createPostLoading:!1,postIdLoading:null}),o={state:s,reset:a};class n{constructor(){}static getInstance(){return n.instance||(n.instance=new n),n.instance}async getAllPosts(){o.state.postsLoading=!0;let e=await t.http.get("api/v1/Feed/GetAll");return e&&(o.state.posts=e.Data,o.state.postsLoading=!1),e}async createPost(e){o.state.createPostLoading=!0;let s=await t.http.post("api/v1/Feed/PostFeed",e);return s&&(o.state.posts=[s.Data,...o.state.posts],o.state.createPostLoading=!1),s}async createPostComment(e){o.state.postIdLoading=e.PostId;let s=await t.http.post("api/v1/Feed/Comment",e);return s&&(o.state.posts=o.state.posts.map((t=>t.Id==s.Data.ClassFeedPostId?Object.assign(Object.assign({},t),{Comments:[...t.Comments,s.Data]}):t)),o.state.postIdLoading=null),s}}export{n as F,o as f}
|