@sparkle-learning/core 0.0.52 → 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.
Files changed (148) hide show
  1. package/dist/cjs/{PrivateRoute-074c584e.js → PrivateRoute-e2047db2.js} +18 -30
  2. package/dist/cjs/{feed.service-b4f09441.js → appdata.service-d28cf2d6.js} +4 -56
  3. package/dist/cjs/{assets.service-0c759d51.js → assets.service-bfa75092.js} +1 -1
  4. package/dist/cjs/{environment-config.service-0e02b049.js → environment-config.service-c8ff1f3d.js} +0 -1
  5. package/dist/cjs/{facilitator.service-9e990274.js → facilitator.service-0b9f6ac7.js} +1 -1
  6. package/dist/cjs/feed.service-6df9382f.js +57 -0
  7. package/dist/cjs/header-mobile-collapse_61.cjs.entry.js +289 -3279
  8. package/dist/cjs/{httpService-7211d93b.js → httpService-d8a5b474.js} +13 -11
  9. package/dist/cjs/index.cjs.js +5 -4
  10. package/dist/cjs/{ion-select_2.cjs.entry.js → ion-select_3.cjs.entry.js} +127 -0
  11. package/dist/cjs/loader.cjs.js +1 -1
  12. package/dist/cjs/media.service-2bc73d37.js +40 -0
  13. package/dist/cjs/signalR.service-0d5da1d3.js +2985 -0
  14. package/dist/cjs/sparkle-animation-player.cjs.entry.js +2 -1
  15. package/dist/cjs/sparkle-assignment.cjs.entry.js +25 -0
  16. package/dist/cjs/sparkle-character-intro.cjs.entry.js +2 -2
  17. package/dist/cjs/sparkle-core.cjs.js +1 -1
  18. package/dist/cjs/sparkle-discussion-questions_2.cjs.entry.js +281 -0
  19. package/dist/cjs/sparkle-discussion.cjs.entry.js +42 -0
  20. package/dist/cjs/sparkle-facilitator-notes-form.cjs.entry.js +5 -3
  21. package/dist/cjs/sparkle-feedback.cjs.entry.js +5 -3
  22. package/dist/cjs/sparkle-goal-form.cjs.entry.js +11 -8
  23. package/dist/cjs/sparkle-quiz-container.cjs.entry.js +1 -1
  24. package/dist/cjs/sparkle-quiz-old.cjs.entry.js +120 -0
  25. package/dist/cjs/sparkle-quiz.cjs.entry.js +31 -48
  26. package/dist/cjs/{student.service-2e58f237.js → student.service-d8ec2551.js} +1 -1
  27. package/dist/cjs/token.service-bfb0089b.js +86 -0
  28. package/dist/cjs/{util-d383acb8.js → util-47e320b2.js} +2 -2
  29. package/dist/collection/PrivateRoute.js +2 -2
  30. package/dist/collection/collection-manifest.json +6 -2
  31. package/dist/collection/components/layout/facilitator/facilitator-page.js +2 -3
  32. package/dist/collection/components/layout/page/page.css +4 -0
  33. package/dist/collection/components/layout/page/page.js +39 -26
  34. package/dist/collection/components/sparkle-animation-player/sparkle-animation-player.js +1 -0
  35. package/dist/collection/components/sparkle-assignment/sparkle-assignment.css +3 -0
  36. package/dist/collection/components/sparkle-assignment/sparkle-assignment.js +25 -0
  37. package/dist/collection/components/sparkle-character-intro/sparkle-character-intro.css +8 -1
  38. package/dist/collection/components/sparkle-character-intro/sparkle-character-intro.js +10 -6
  39. package/dist/collection/components/sparkle-course-root/sparkle-course-root.js +12 -1
  40. package/dist/collection/components/sparkle-discussion/sparkle-discussion-questions/sparkle-discussion-questions.css +157 -0
  41. package/dist/collection/components/sparkle-discussion/sparkle-discussion-questions/sparkle-discussion-questions.js +232 -0
  42. package/dist/collection/components/sparkle-discussion/sparkle-discussion-results/sparkle-discussion-results.css +158 -0
  43. package/dist/collection/components/sparkle-discussion/sparkle-discussion-results/sparkle-discussion-results.js +274 -0
  44. package/dist/collection/components/sparkle-discussion/sparkle-discussion.css +5 -0
  45. package/dist/collection/components/sparkle-discussion/sparkle-discussion.js +112 -0
  46. package/dist/collection/components/sparkle-feed-post/sparkle-feed-post.js +54 -67
  47. package/dist/collection/components/sparkle-login/sparkle-login.js +2 -1
  48. package/dist/collection/components/sparkle-quiz/{sparkle-quiz/sparkle-quiz.css → sparkle-quiz-old/sparkle-quiz-old.css} +1 -1
  49. package/dist/collection/components/sparkle-quiz/{sparkle-quiz/sparkle-quiz.js → sparkle-quiz-old/sparkle-quiz-old.js} +4 -4
  50. package/dist/collection/components/sparkle-quiz/{sparkle-quiz-v1.js → sparkle-quiz.js} +23 -25
  51. package/dist/collection/components/sparkle-quiz-container/sparkle-quiz-container.js +1 -1
  52. package/dist/collection/components/sparkle-root/sparkle-root.js +12 -10
  53. package/dist/collection/services/assignment.service.js +14 -0
  54. package/dist/collection/services/auth/auth.service.js +15 -14
  55. package/dist/collection/services/environment/environment-config.js +1 -1
  56. package/dist/collection/services/environment/environment-config.service.js +0 -1
  57. package/dist/collection/services/httpService.js +12 -10
  58. package/dist/collection/services/signalR.service.js +17 -19
  59. package/dist/collection/services/token.service.js +68 -0
  60. package/dist/collection/util.js +5 -2
  61. package/dist/esm/{PrivateRoute-c5441f35.js → PrivateRoute-c6e80d5d.js} +17 -29
  62. package/dist/esm/{feed.service-8fbe4ce3.js → appdata.service-d1058e00.js} +5 -55
  63. package/dist/esm/{assets.service-66e848b8.js → assets.service-def1d63c.js} +1 -1
  64. package/dist/esm/{environment-config.service-2b5d692b.js → environment-config.service-b191f276.js} +0 -1
  65. package/dist/esm/{facilitator.service-b0292f7f.js → facilitator.service-53e05a01.js} +1 -1
  66. package/dist/esm/feed.service-8385ad7a.js +54 -0
  67. package/dist/esm/header-mobile-collapse_61.entry.js +278 -3268
  68. package/dist/esm/{httpService-7b75b095.js → httpService-db476835.js} +13 -11
  69. package/dist/esm/index.js +5 -4
  70. package/dist/esm/{ion-select_2.entry.js → ion-select_3.entry.js} +127 -1
  71. package/dist/esm/loader.js +1 -1
  72. package/dist/esm/media.service-b68cbfff.js +37 -0
  73. package/dist/esm/signalR.service-4a2d5a92.js +2982 -0
  74. package/dist/esm/sparkle-animation-player.entry.js +2 -1
  75. package/dist/esm/sparkle-assignment.entry.js +21 -0
  76. package/dist/esm/sparkle-character-intro.entry.js +3 -3
  77. package/dist/esm/sparkle-core.js +1 -1
  78. package/dist/esm/sparkle-discussion-questions_2.entry.js +276 -0
  79. package/dist/esm/sparkle-discussion.entry.js +38 -0
  80. package/dist/esm/sparkle-facilitator-notes-form.entry.js +5 -3
  81. package/dist/esm/sparkle-feedback.entry.js +5 -3
  82. package/dist/esm/sparkle-goal-form.entry.js +8 -5
  83. package/dist/esm/sparkle-quiz-container.entry.js +1 -1
  84. package/dist/esm/sparkle-quiz-old.entry.js +116 -0
  85. package/dist/esm/sparkle-quiz.entry.js +31 -48
  86. package/dist/esm/{student.service-0746418b.js → student.service-6457aaa0.js} +1 -1
  87. package/dist/esm/token.service-20f1a256.js +83 -0
  88. package/dist/esm/{util-6ef753e9.js → util-57cc8006.js} +2 -2
  89. package/dist/sparkle-core/index.esm.js +1 -1
  90. package/dist/sparkle-core/p-11ac00b0.js +1 -0
  91. package/dist/sparkle-core/p-13ec39db.entry.js +1 -0
  92. package/dist/sparkle-core/{p-5efc6566.js → p-17b6b07e.js} +1 -1
  93. package/dist/sparkle-core/p-33a7151d.entry.js +1 -0
  94. package/dist/sparkle-core/{p-fbccd30c.js → p-38f707fb.js} +1 -1
  95. package/dist/sparkle-core/p-38fa5987.js +1 -0
  96. package/dist/sparkle-core/{p-9a443f51.js → p-408176ba.js} +1 -1
  97. package/dist/sparkle-core/p-630a4fa0.js +1 -0
  98. package/dist/sparkle-core/{p-0335c863.entry.js → p-6a1fc0af.entry.js} +26 -26
  99. package/dist/sparkle-core/p-6fab3a4b.js +1 -0
  100. package/dist/sparkle-core/p-71720d6e.entry.js +1 -0
  101. package/dist/sparkle-core/{p-162bff1a.entry.js → p-72053ae0.entry.js} +1 -1
  102. package/dist/sparkle-core/p-85d4cd5c.entry.js +1 -0
  103. package/dist/sparkle-core/p-967a2ed7.js +1 -0
  104. package/dist/sparkle-core/{p-ff0e0d4e.entry.js → p-98daeddb.entry.js} +1 -1
  105. package/dist/sparkle-core/p-98f7780c.entry.js +1 -0
  106. package/dist/sparkle-core/p-bd90903e.js +1 -0
  107. package/dist/sparkle-core/{p-a49ab4e8.entry.js → p-c64a34cd.entry.js} +1 -1
  108. package/dist/sparkle-core/{p-564e64fc.entry.js → p-ca907214.entry.js} +2 -2
  109. package/dist/sparkle-core/p-d51f30ca.js +1 -0
  110. package/dist/sparkle-core/p-dcff298d.entry.js +1 -0
  111. package/dist/sparkle-core/p-e50c8b04.entry.js +1 -0
  112. package/dist/sparkle-core/p-ed9de327.js +1 -0
  113. package/dist/sparkle-core/p-f891c79a.entry.js +1 -0
  114. package/dist/sparkle-core/sparkle-core.esm.js +1 -1
  115. package/dist/types/components/layout/page/page.d.ts +2 -0
  116. package/dist/types/components/sparkle-assignment/sparkle-assignment.d.ts +6 -0
  117. package/dist/types/components/sparkle-course-root/sparkle-course-root.d.ts +1 -0
  118. package/dist/types/components/sparkle-discussion/sparkle-discussion-questions/sparkle-discussion-questions.d.ts +28 -0
  119. package/dist/types/components/sparkle-discussion/sparkle-discussion-results/sparkle-discussion-results.d.ts +45 -0
  120. package/dist/types/components/sparkle-discussion/sparkle-discussion.d.ts +11 -0
  121. package/dist/types/components/sparkle-feed-post/sparkle-feed-post.d.ts +3 -2
  122. package/dist/types/components/sparkle-quiz/{sparkle-quiz/sparkle-quiz.d.ts → sparkle-quiz-old/sparkle-quiz-old.d.ts} +1 -1
  123. package/dist/types/components/sparkle-quiz/sparkle-quiz.d.ts +36 -36
  124. package/dist/types/components.d.ts +115 -37
  125. package/dist/types/models/class.model.d.ts +4 -0
  126. package/dist/types/services/assignment.service.d.ts +8 -0
  127. package/dist/types/services/auth/auth.service.d.ts +1 -1
  128. package/dist/types/services/environment/environment-config.d.ts +3 -0
  129. package/dist/types/services/token.service.d.ts +12 -0
  130. package/dist/types/util.d.ts +1 -0
  131. package/package.json +1 -1
  132. package/dist/cjs/sparkle-feed-post.cjs.entry.js +0 -124
  133. package/dist/cjs/sparkle-quiz-v1.cjs.entry.js +0 -105
  134. package/dist/esm/sparkle-feed-post.entry.js +0 -120
  135. package/dist/esm/sparkle-quiz-v1.entry.js +0 -101
  136. package/dist/sparkle-core/p-15403881.entry.js +0 -1
  137. package/dist/sparkle-core/p-1d4c7c11.js +0 -1
  138. package/dist/sparkle-core/p-370609ba.entry.js +0 -1
  139. package/dist/sparkle-core/p-41a9ece7.entry.js +0 -1
  140. package/dist/sparkle-core/p-462bffba.js +0 -1
  141. package/dist/sparkle-core/p-58e4bbe5.entry.js +0 -1
  142. package/dist/sparkle-core/p-600cf6a3.js +0 -1
  143. package/dist/sparkle-core/p-80d6b0e6.entry.js +0 -1
  144. package/dist/sparkle-core/p-af3cc111.entry.js +0 -1
  145. package/dist/sparkle-core/p-b226f54d.js +0 -1
  146. package/dist/types/components/sparkle-quiz/sparkle-quiz-v1.d.ts +0 -41
  147. /package/dist/collection/components/sparkle-quiz/{sparkle-quiz-v1.css → sparkle-quiz.css} +0 -0
  148. /package/dist/sparkle-core/{p-935e7cfc.js → p-8b56f734.js} +0 -0
@@ -4,13 +4,15 @@ Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
5
  const index = require('./index-51e8292e.js');
6
6
  const overlays = require('./overlays-32df265a.js');
7
- const facilitator_service = require('./facilitator.service-9e990274.js');
7
+ const facilitator_service = require('./facilitator.service-0b9f6ac7.js');
8
8
  require('./ionic-global-2cde9d3a.js');
9
9
  require('./hardware-back-button-92d97ff8.js');
10
10
  require('./helpers-c2496722.js');
11
- require('./httpService-7211d93b.js');
11
+ require('./httpService-d8a5b474.js');
12
12
  require('./auth.store-1e630a7d.js');
13
- require('./environment-config.service-0e02b049.js');
13
+ require('./environment-config.service-c8ff1f3d.js');
14
+ require('./token.service-bfb0089b.js');
15
+ require('./localstorage.service-6346a41d.js');
14
16
 
15
17
  const LoadingSpinner = () => (index.h("div", { class: "spinner-border", role: "status" }));
16
18
 
@@ -3,11 +3,13 @@
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
5
  const index = require('./index-51e8292e.js');
6
- const student_service = require('./student.service-2e58f237.js');
6
+ const student_service = require('./student.service-d8ec2551.js');
7
7
  const overlays = require('./overlays-32df265a.js');
8
- require('./httpService-7211d93b.js');
8
+ require('./httpService-d8a5b474.js');
9
9
  require('./auth.store-1e630a7d.js');
10
- require('./environment-config.service-0e02b049.js');
10
+ require('./environment-config.service-c8ff1f3d.js');
11
+ require('./token.service-bfb0089b.js');
12
+ require('./localstorage.service-6346a41d.js');
11
13
  require('./ionic-global-2cde9d3a.js');
12
14
  require('./hardware-back-button-92d97ff8.js');
13
15
  require('./helpers-c2496722.js');
@@ -3,16 +3,19 @@
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
5
  const index = require('./index-51e8292e.js');
6
- const util = require('./util-d383acb8.js');
7
- const environmentConfig_service = require('./environment-config.service-0e02b049.js');
8
- const assets_service = require('./assets.service-0c759d51.js');
9
- const feed_service = require('./feed.service-b4f09441.js');
10
- require('./httpService-7211d93b.js');
6
+ const util = require('./util-47e320b2.js');
7
+ const environmentConfig_service = require('./environment-config.service-c8ff1f3d.js');
8
+ const assets_service = require('./assets.service-bfa75092.js');
9
+ const appdata_service = require('./appdata.service-d28cf2d6.js');
10
+ const feed_service = require('./feed.service-6df9382f.js');
11
+ require('./httpService-d8a5b474.js');
11
12
  require('./auth.store-1e630a7d.js');
12
13
  require('./overlays-32df265a.js');
13
14
  require('./ionic-global-2cde9d3a.js');
14
15
  require('./hardware-back-button-92d97ff8.js');
15
16
  require('./helpers-c2496722.js');
17
+ require('./token.service-bfb0089b.js');
18
+ require('./localstorage.service-6346a41d.js');
16
19
 
17
20
  const sparkleGoalFormCss = ":host{display:block}";
18
21
 
@@ -112,7 +115,7 @@ const SparkleGoalForm = class {
112
115
  if (this.name.valid && this.description.valid && this.category.valid && this.goalUpdateText.valid) {
113
116
  //update
114
117
  var appData = util.GetGoalAppData(this.name.value, this.description.value, this.category.value, this.progress, this.goalUpdateText.value);
115
- const result = await feed_service.AppDataService.getInstance().updateGoal({ Id: this.appData.Id, MiniAppId: util.SparkleGlobal.MY_GOALS_APP_ID, AppJsonData: JSON.stringify(appData) });
118
+ const result = await appdata_service.AppDataService.getInstance().updateGoal({ Id: this.appData.Id, MiniAppId: util.SparkleGlobal.MY_GOALS_APP_ID, AppJsonData: JSON.stringify(appData) });
116
119
  if (result.Succeeded) {
117
120
  if (this.public) {
118
121
  await this.postToFeed();
@@ -127,7 +130,7 @@ const SparkleGoalForm = class {
127
130
  if (this.name.valid && this.description.valid && this.category.valid) {
128
131
  //add
129
132
  var appData = util.GetGoalAppData(this.name.value, this.description.value, this.category.value, this.progress, this.goalUpdateText.value);
130
- const result = await feed_service.AppDataService.getInstance().createGoal({ MiniAppId: util.SparkleGlobal.MY_GOALS_APP_ID, AppJsonData: JSON.stringify(appData) });
133
+ const result = await appdata_service.AppDataService.getInstance().createGoal({ MiniAppId: util.SparkleGlobal.MY_GOALS_APP_ID, AppJsonData: JSON.stringify(appData) });
131
134
  if (result.Succeeded) {
132
135
  this.dismiss();
133
136
  }
@@ -163,7 +166,7 @@ const SparkleGoalForm = class {
163
166
  }
164
167
  render() {
165
168
  return [
166
- index.h("div", null, index.h("ion-toolbar", { color: "primary" }, index.h("ion-buttons", { slot: "start" }, index.h("ion-back-button", { defaultHref: "home", onClick: () => this.dismiss() })), index.h("ion-title", null, "Add New Goal")), index.h("div", { class: "inner-content" }, index.h("form", { class: "ion-padding", novalidate: true, onSubmit: (e) => this.onSubmit(e) }, index.h("ion-list", { "no-lines": true }, index.h("ion-item", null, index.h("ion-label", { position: "stacked", color: "primary" }, "Title"), index.h("ion-input", { name: "title", type: "text", value: this.name.value, onInput: (ev) => this.handleTitle(ev), required: true })), index.h("ion-text", { color: "danger" }, index.h("p", { hidden: this.name.valid || this.submitted === false, class: "ion-padding-start" }, "Title is required")), index.h("ion-item", null, index.h("ion-label", { position: "stacked", color: "primary" }, "Description"), index.h("ion-textarea", { name: "desciption", value: this.description.value, onInput: (ev) => this.handleDescription(ev), required: true })), index.h("ion-text", { color: "danger" }, index.h("p", { hidden: this.description.valid || this.submitted === false, class: "ion-padding-start" }, "Description is required")), index.h("ion-item", null, index.h("ion-label", null, "Category"), index.h("ion-select", { value: this.category.value, onIonChange: (e) => this.handleCategory(e) }, index.h("ion-select-option", { value: "Emotional" }, "Emotional"), index.h("ion-select-option", { value: "Interpersonal" }, "Interpersonal"), index.h("ion-select-option", { value: "Learning" }, "Learning"), index.h("ion-select-option", { value: "Financial" }, "Financial"), index.h("ion-select-option", { value: "Physical" }, "Physical"))), index.h("ion-text", { color: "danger" }, index.h("p", { hidden: this.category.valid || this.submitted === false, class: "ion-padding-start" }, "Category is required")), this.renderEditBookingFields()), index.h("div", { class: "ion-padding" }, this.appData && index.h("ion-button", { type: "submit", expand: "block", disabled: feed_service.goalStore.state.goalLoading || feed_service.feedStore.state.postIdLoading > 0 }, feed_service.goalStore.state.goalLoading && index.h("ion-spinner", { name: "dots" }), " Update"), !this.appData && index.h("ion-button", { type: "submit", expand: "block", disabled: feed_service.goalStore.state.goalLoading }, feed_service.goalStore.state.goalLoading && index.h("ion-spinner", { name: "dots" }), " Add")))))
169
+ index.h("div", null, index.h("ion-toolbar", { color: "primary" }, index.h("ion-buttons", { slot: "start" }, index.h("ion-back-button", { defaultHref: "home", onClick: () => this.dismiss() })), index.h("ion-title", null, "Add New Goal")), index.h("div", { class: "inner-content" }, index.h("form", { class: "ion-padding", novalidate: true, onSubmit: (e) => this.onSubmit(e) }, index.h("ion-list", { "no-lines": true }, index.h("ion-item", null, index.h("ion-label", { position: "stacked", color: "primary" }, "Title"), index.h("ion-input", { name: "title", type: "text", value: this.name.value, onInput: (ev) => this.handleTitle(ev), required: true })), index.h("ion-text", { color: "danger" }, index.h("p", { hidden: this.name.valid || this.submitted === false, class: "ion-padding-start" }, "Title is required")), index.h("ion-item", null, index.h("ion-label", { position: "stacked", color: "primary" }, "Description"), index.h("ion-textarea", { name: "desciption", value: this.description.value, onInput: (ev) => this.handleDescription(ev), required: true })), index.h("ion-text", { color: "danger" }, index.h("p", { hidden: this.description.valid || this.submitted === false, class: "ion-padding-start" }, "Description is required")), index.h("ion-item", null, index.h("ion-label", null, "Category"), index.h("ion-select", { value: this.category.value, onIonChange: (e) => this.handleCategory(e) }, index.h("ion-select-option", { value: "Emotional" }, "Emotional"), index.h("ion-select-option", { value: "Interpersonal" }, "Interpersonal"), index.h("ion-select-option", { value: "Learning" }, "Learning"), index.h("ion-select-option", { value: "Financial" }, "Financial"), index.h("ion-select-option", { value: "Physical" }, "Physical"))), index.h("ion-text", { color: "danger" }, index.h("p", { hidden: this.category.valid || this.submitted === false, class: "ion-padding-start" }, "Category is required")), this.renderEditBookingFields()), index.h("div", { class: "ion-padding" }, this.appData && index.h("ion-button", { type: "submit", expand: "block", disabled: appdata_service.goalStore.state.goalLoading || feed_service.feedStore.state.postIdLoading > 0 }, appdata_service.goalStore.state.goalLoading && index.h("ion-spinner", { name: "dots" }), " Update"), !this.appData && index.h("ion-button", { type: "submit", expand: "block", disabled: appdata_service.goalStore.state.goalLoading }, appdata_service.goalStore.state.goalLoading && index.h("ion-spinner", { name: "dots" }), " Add")))))
167
170
  ];
168
171
  }
169
172
  get el() { return index.getElement(this); }
@@ -39,7 +39,7 @@ const SparkleQuizContainer = class {
39
39
  //post api
40
40
  }
41
41
  render() {
42
- return (index.h(index.Host, null, this.questionIds && this.questionIds.split(",").map((id => index.h("sparkle-quiz", { questionId: +id, submitted: this.submitted, showInstantResult: this.showInstantResult }))), index.h("ion-button", { slot: "end", onClick: () => this.submitQuiz() }, "Submit")));
42
+ return (index.h(index.Host, null, this.questionIds && this.questionIds.split(",").map((id => index.h("sparkle-quiz-v1", { questionId: +id, submitted: this.submitted, showInstantResult: this.showInstantResult }))), index.h("ion-button", { slot: "end", onClick: () => this.submitQuiz() }, "Submit")));
43
43
  }
44
44
  };
45
45
  SparkleQuizContainer.style = sparkleQuizContainerCss;
@@ -0,0 +1,120 @@
1
+ 'use strict';
2
+
3
+ Object.defineProperty(exports, '__esModule', { value: true });
4
+
5
+ const index = require('./index-51e8292e.js');
6
+
7
+ const sparkleQuizOldCss = "sparkle-quiz-old{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)}";
8
+
9
+ const SparkleQuizOld = class {
10
+ constructor(hostRef) {
11
+ index.registerInstance(this, hostRef);
12
+ this.quizAnswerChanged = index.createEvent(this, "quizAnswerChanged", 7);
13
+ this.type = 'TEXT';
14
+ this.scale = 'FIVE-POINTS';
15
+ this.options = [];
16
+ }
17
+ // private pageInfo: any;
18
+ // @Watch('questionId')
19
+ // async loadQuestion() {
20
+ // if (this.quizData) {
21
+ // this.question = this.quizData[+this.questionId];
22
+ // }
23
+ // }
24
+ //@State() question: SparkleQuizQuestion;
25
+ //@State() quizData: { [key: string]: SparkleQuizQuestion };
26
+ async componentWillLoad() { }
27
+ async componentDidLoad() {
28
+ this.options = [];
29
+ if (this.el.querySelector("[slot='options']")) {
30
+ Array.from(this.el.querySelector("[slot='options']").querySelectorAll('option')).forEach(el => {
31
+ this.options = [...this.options, { option: el.innerText }];
32
+ });
33
+ console.log(this.questionText, this.options);
34
+ }
35
+ this.quizAnswerChanged.emit({
36
+ question: null,
37
+ answer: '1',
38
+ });
39
+ }
40
+ quizInputChangeHandler(event) {
41
+ this.quizAnswerChanged.emit({
42
+ question: event.detail.question,
43
+ answer: event.detail.value,
44
+ });
45
+ }
46
+ quizFeedbackChangeHandler(event) {
47
+ this.quizAnswerChanged.emit({
48
+ question: event.detail.question,
49
+ answer: event.detail.value,
50
+ });
51
+ }
52
+ quizSelectChangeHandler(event) {
53
+ this.quizAnswerChanged.emit({
54
+ question: event.detail.question,
55
+ answer: event.detail.value,
56
+ });
57
+ }
58
+ quizOpinionChangeHandler(event) {
59
+ this.quizAnswerChanged.emit({
60
+ question: event.detail.question,
61
+ answer: event.detail.value,
62
+ });
63
+ }
64
+ getQuestionFeedback() {
65
+ if (this.type == 'MULTIPLE-CHOICE') {
66
+ // const feedbacks = this.question.options.filter(x => x.correct == true).map(x => x.feedback);
67
+ // return feedbacks.length > 0 && feedbacks.map(feedback => <small>{feedback}</small>);
68
+ return index.h("small", null);
69
+ }
70
+ else if (this.type == 'FEEDBACK' || this.type == 'TEXT') {
71
+ return this.feedback && index.h("small", null, " ", this.feedback);
72
+ }
73
+ }
74
+ showAnswerStatus() {
75
+ return index.h("div", null, this.correct ? index.h("strong", null, "Good job!") : index.h("strong", null, "Incorrect answer, please try again."));
76
+ }
77
+ renderQuestion() {
78
+ var question = {
79
+ questionId: this.questionId,
80
+ questionText: this.questionText,
81
+ questionType: this.type,
82
+ scale: this.scale,
83
+ showOptionNumber: this.showOptionNumber,
84
+ options: this.options,
85
+ //options: Array<SparkleQuizQuestionOption>;
86
+ feedback: this.feedback,
87
+ };
88
+ if (this.type == 'MULTIPLE-CHOICE') {
89
+ return index.h("sparkle-quiz-select", { question: question, allowMultiple: true });
90
+ }
91
+ else if (this.type == 'FEEDBACK') {
92
+ return index.h("sparkle-quiz-feedback", { question: question });
93
+ }
94
+ else if (this.type == 'TEXT') {
95
+ return index.h("sparkle-quiz-input", { question: question });
96
+ }
97
+ else if (this.type == 'OPINION') {
98
+ return index.h("sparkle-quiz-opinion", { question: question });
99
+ }
100
+ else if (this.type == 'POLL') {
101
+ return index.h("sparkle-quiz-poll", { question: question });
102
+ }
103
+ }
104
+ render() {
105
+ if (this.questionText) {
106
+ let classes = {
107
+ correct: this.submitted && this.correct,
108
+ incorrect: this.submitted && !this.correct,
109
+ };
110
+ return (index.h("div", { class: classes, ref: el => (this.containerRef = el) }, index.h("div", { hidden: true }, index.h("slot", null)), this.renderQuestion(), this.submitted && this.showInstantResult && index.h("div", { class: "feedback-container" }, [this.showAnswerStatus(), this.getQuestionFeedback()])));
111
+ }
112
+ else {
113
+ return index.h("p", null, "No question found.");
114
+ }
115
+ }
116
+ get el() { return index.getElement(this); }
117
+ };
118
+ SparkleQuizOld.style = sparkleQuizOldCss;
119
+
120
+ exports.sparkle_quiz_old = SparkleQuizOld;
@@ -3,35 +3,26 @@
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
5
  const index = require('./index-51e8292e.js');
6
+ const assets_service = require('./assets.service-bfa75092.js');
7
+ const environmentConfig_service = require('./environment-config.service-c8ff1f3d.js');
6
8
 
7
- 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)}";
9
+ 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)}";
8
10
 
9
11
  const SparkleQuiz = class {
10
12
  constructor(hostRef) {
11
13
  index.registerInstance(this, hostRef);
12
14
  this.quizAnswerChanged = index.createEvent(this, "quizAnswerChanged", 7);
13
- this.type = 'TEXT';
14
- this.scale = 'FIVE-POINTS';
15
- this.options = [];
16
15
  }
17
- // private pageInfo: any;
18
- // @Watch('questionId')
19
- // async loadQuestion() {
20
- // if (this.quizData) {
21
- // this.question = this.quizData[+this.questionId];
22
- // }
23
- // }
24
- //@State() question: SparkleQuizQuestion;
25
- //@State() quizData: { [key: string]: SparkleQuizQuestion };
16
+ async loadQuestion() {
17
+ if (this.quizData) {
18
+ this.question = this.quizData[+this.questionId];
19
+ }
20
+ }
26
21
  async componentWillLoad() { }
27
22
  async componentDidLoad() {
28
- this.options = [];
29
- if (this.el.querySelector("[slot='options']")) {
30
- Array.from(this.el.querySelector("[slot='options']").querySelectorAll('option')).forEach(el => {
31
- this.options = [...this.options, { option: el.innerText }];
32
- });
33
- console.log(this.questionText, this.options);
34
- }
23
+ const config = environmentConfig_service.EnvironmentConfigService.getInstance().get('sparkle');
24
+ this.quizData = await assets_service.AssetsService.getInstance().loadJsonFile(config.quizPath);
25
+ await this.loadQuestion();
35
26
  this.quizAnswerChanged.emit({
36
27
  question: null,
37
28
  answer: '1',
@@ -62,58 +53,50 @@ const SparkleQuiz = class {
62
53
  });
63
54
  }
64
55
  getQuestionFeedback() {
65
- if (this.type == 'MULTIPLE-CHOICE') {
66
- // const feedbacks = this.question.options.filter(x => x.correct == true).map(x => x.feedback);
67
- // return feedbacks.length > 0 && feedbacks.map(feedback => <small>{feedback}</small>);
68
- return index.h("small", null);
56
+ if (this.question.questionType == 'MULTIPLE-CHOICE') {
57
+ const feedbacks = this.question.options.filter(x => x.correct == true).map(x => x.feedback);
58
+ return feedbacks.length > 0 && feedbacks.map(feedback => index.h("small", null, feedback));
69
59
  }
70
- else if (this.type == 'FEEDBACK' || this.type == 'TEXT') {
71
- return this.feedback && index.h("small", null, " ", this.feedback);
60
+ else if (this.question.questionType == 'FEEDBACK' || this.question.questionType == 'TEXT') {
61
+ return this.question.feedback && index.h("small", null, " ", this.question.feedback);
72
62
  }
73
63
  }
74
64
  showAnswerStatus() {
75
65
  return index.h("div", null, this.correct ? index.h("strong", null, "Good job!") : index.h("strong", null, "Incorrect answer, please try again."));
76
66
  }
77
67
  renderQuestion() {
78
- var question = {
79
- questionId: this.questionId,
80
- questionText: this.questionText,
81
- questionType: this.type,
82
- scale: this.scale,
83
- showOptionNumber: this.showOptionNumber,
84
- options: this.options,
85
- //options: Array<SparkleQuizQuestionOption>;
86
- feedback: this.feedback,
87
- };
88
- if (this.type == 'MULTIPLE-CHOICE') {
89
- return index.h("sparkle-quiz-select", { question: question, allowMultiple: true });
68
+ if (this.question.questionType == 'MULTIPLE-CHOICE') {
69
+ return index.h("sparkle-quiz-select", { question: this.question, allowMultiple: true });
90
70
  }
91
- else if (this.type == 'FEEDBACK') {
92
- return index.h("sparkle-quiz-feedback", { question: question });
71
+ else if (this.question.questionType == 'FEEDBACK') {
72
+ return index.h("sparkle-quiz-feedback", { question: this.question });
93
73
  }
94
- else if (this.type == 'TEXT') {
95
- return index.h("sparkle-quiz-input", { question: question });
74
+ else if (this.question.questionType == 'TEXT') {
75
+ return index.h("sparkle-quiz-input", { question: this.question });
96
76
  }
97
- else if (this.type == 'OPINION') {
98
- return index.h("sparkle-quiz-opinion", { question: question });
77
+ else if (this.question.questionType == 'OPINION') {
78
+ return index.h("sparkle-quiz-opinion", { question: this.question });
99
79
  }
100
- else if (this.type == 'POLL') {
101
- return index.h("sparkle-quiz-poll", { question: question });
80
+ else if (this.question.questionType == 'POLL') {
81
+ return index.h("sparkle-quiz-poll", { question: this.question });
102
82
  }
103
83
  }
104
84
  render() {
105
- if (this.questionText) {
85
+ if (this.question) {
106
86
  let classes = {
107
87
  correct: this.submitted && this.correct,
108
88
  incorrect: this.submitted && !this.correct,
109
89
  };
110
- return (index.h("div", { class: classes, ref: el => (this.containerRef = el) }, index.h("div", { hidden: true }, index.h("slot", null)), this.renderQuestion(), this.submitted && this.showInstantResult && index.h("div", { class: "feedback-container" }, [this.showAnswerStatus(), this.getQuestionFeedback()])));
90
+ return (index.h("div", { class: classes }, this.renderQuestion(), this.submitted && this.showInstantResult && index.h("div", { class: "feedback-container" }, [this.showAnswerStatus(), this.getQuestionFeedback()])));
111
91
  }
112
92
  else {
113
93
  return index.h("p", null, "No question found.");
114
94
  }
115
95
  }
116
96
  get el() { return index.getElement(this); }
97
+ static get watchers() { return {
98
+ "questionId": ["loadQuestion"]
99
+ }; }
117
100
  };
118
101
  SparkleQuiz.style = sparkleQuizCss;
119
102
 
@@ -1,6 +1,6 @@
1
1
  'use strict';
2
2
 
3
- const httpService = require('./httpService-7211d93b.js');
3
+ const httpService = require('./httpService-d8a5b474.js');
4
4
  const auth_store = require('./auth.store-1e630a7d.js');
5
5
 
6
6
  const { state, onChange, reset } = auth_store.createStore({
@@ -0,0 +1,86 @@
1
+ 'use strict';
2
+
3
+ const auth_store = require('./auth.store-1e630a7d.js');
4
+ const localstorage_service = require('./localstorage.service-6346a41d.js');
5
+
6
+ const AppConsts = {
7
+ AUTH_USER_LOCALSTORAGE: "CurrentUser",
8
+ userManagement: {
9
+ defaultAdminUserName: 'admin',
10
+ },
11
+ localization: {
12
+ defaultLocalizationSourceName: 'Test',
13
+ },
14
+ authorization: {
15
+ encrptedAuthTokenName: 'enc_auth_token',
16
+ }
17
+ };
18
+
19
+ class TokenService {
20
+ static getInstance() {
21
+ if (!TokenService.instance) {
22
+ TokenService.instance = new TokenService();
23
+ }
24
+ return TokenService.instance;
25
+ }
26
+ async getToken() {
27
+ let authUser = await localstorage_service.get(AppConsts.AUTH_USER_LOCALSTORAGE);
28
+ if (authUser && authUser.JWToken) {
29
+ if (new Date(authUser.ExpiresOn).getTime() > new Date().getTime()) {
30
+ return authUser.JWToken;
31
+ }
32
+ }
33
+ return null;
34
+ }
35
+ async getAuthUser() {
36
+ let authUser = await localstorage_service.get(AppConsts.AUTH_USER_LOCALSTORAGE);
37
+ if (authUser && authUser.JWToken) {
38
+ if (new Date(authUser.ExpiresOn).getTime() > new Date().getTime()) {
39
+ return authUser;
40
+ }
41
+ }
42
+ return null;
43
+ }
44
+ getAuthUserSync() {
45
+ let authUser = JSON.parse(localStorage.getItem(AppConsts.AUTH_USER_LOCALSTORAGE));
46
+ if (authUser && authUser.JWToken) {
47
+ if (new Date(authUser.ExpiresOn).getTime() > new Date().getTime()) {
48
+ return authUser;
49
+ }
50
+ }
51
+ return null;
52
+ }
53
+ getTokenSync() {
54
+ let authUser = JSON.parse(localStorage.getItem(AppConsts.AUTH_USER_LOCALSTORAGE));
55
+ if (authUser && authUser.JWToken) {
56
+ if (new Date(authUser.ExpiresOn).getTime() > new Date().getTime()) {
57
+ return authUser.JWToken;
58
+ }
59
+ }
60
+ return null;
61
+ }
62
+ async getTokenExpiry() {
63
+ let authUser = await localstorage_service.get(AppConsts.AUTH_USER_LOCALSTORAGE);
64
+ if (!authUser) {
65
+ return 0;
66
+ }
67
+ let timeDiff = 0;
68
+ if (authUser.ExpiresOn) {
69
+ timeDiff = new Date(authUser.ExpiresOn).getTime() - new Date().getTime();
70
+ }
71
+ return Math.max(0, timeDiff);
72
+ }
73
+ async saveAuthUser(authUser) {
74
+ auth_store.AuthStore.state.authUser = Object.assign({}, authUser);
75
+ auth_store.AuthStore.state.isAuthenticated = true;
76
+ await localstorage_service.set(AppConsts.AUTH_USER_LOCALSTORAGE, authUser);
77
+ }
78
+ async removeAuthUser() {
79
+ auth_store.AuthStore.state.authUser = null;
80
+ auth_store.AuthStore.state.isAuthenticated = false;
81
+ await localstorage_service.remove(AppConsts.AUTH_USER_LOCALSTORAGE);
82
+ }
83
+ }
84
+
85
+ exports.AppConsts = AppConsts;
86
+ exports.TokenService = TokenService;
@@ -2419,7 +2419,7 @@ function GetGoalAppData(title, description, category, percentage, goalText) {
2419
2419
  Description: description,
2420
2420
  Category: category,
2421
2421
  Percentage: percentage,
2422
- GoalText: goalText
2422
+ GoalText: goalText,
2423
2423
  };
2424
2424
  }
2425
2425
  function MyMoodTemplate(feeling, intensity, location) {
@@ -2445,7 +2445,7 @@ class SparkleGlobal {
2445
2445
  SparkleGlobal.MY_GOALS_APP_ID = 1;
2446
2446
  SparkleGlobal.MY_HEALTH_APP_ID = 2;
2447
2447
  SparkleGlobal.MY_MOOD_APP_ID = 3;
2448
- SparkleGlobal.LOCALSTORAGE_CLASSROOM_MODE = "SPARKLE_CLASSROOM_MODE";
2448
+ SparkleGlobal.LOCALSTORAGE_CLASSROOM_MODE = 'SPARKLE_CLASSROOM_MODE';
2449
2449
  function date(date) {
2450
2450
  return format(new Date(date), 'DD MMM YYYY');
2451
2451
  }
@@ -17,9 +17,9 @@ const Route = (_a) => {
17
17
  const Component = component;
18
18
  return (h("stencil-route", Object.assign({}, props, { routeRender: (props) => {
19
19
  if (!AuthStore.state.isAuthenticated)
20
- return (h("stencil-router-redirect", { url: "/login" }));
20
+ return h("stencil-router-redirect", { url: "/login" });
21
21
  if (permission && !isGranted(permission)) {
22
- return (h("stencil-router-redirect", { url: "/unauthorized" }));
22
+ return h("stencil-router-redirect", { url: "/unauthorized" });
23
23
  }
24
24
  return Component ? h(Component, Object.assign({}, props, props.componentProps)) : render(props);
25
25
  } })));
@@ -21,10 +21,14 @@
21
21
  "./components/mini-apps/sparkle-mood/sparkle-mood.js",
22
22
  "./components/modal-image/modal-image.js",
23
23
  "./components/sparkle-animation-player/sparkle-animation-player.js",
24
+ "./components/sparkle-assignment/sparkle-assignment.js",
24
25
  "./components/sparkle-character-intro/sparkle-character-intro.js",
25
26
  "./components/sparkle-compass/sparkle-compass.js",
26
27
  "./components/sparkle-compass/sparkle-compass-post/sparkle-compass-post.js",
27
28
  "./components/sparkle-course-root/sparkle-course-root.js",
29
+ "./components/sparkle-discussion/sparkle-discussion.js",
30
+ "./components/sparkle-discussion/sparkle-discussion-questions/sparkle-discussion-questions.js",
31
+ "./components/sparkle-discussion/sparkle-discussion-results/sparkle-discussion-results.js",
28
32
  "./components/sparkle-emoji/sparkle-emoji.js",
29
33
  "./components/sparkle-feed-post/sparkle-feed-post.js",
30
34
  "./components/sparkle-feedback/sparkle-feedback.js",
@@ -32,10 +36,10 @@
32
36
  "./components/sparkle-intro/sparkle-intro.js",
33
37
  "./components/sparkle-login/sparkle-login.js",
34
38
  "./components/sparkle-poll/sparkle-poll.js",
35
- "./components/sparkle-quiz/sparkle-quiz-v1.js",
36
- "./components/sparkle-quiz/sparkle-quiz/sparkle-quiz.js",
39
+ "./components/sparkle-quiz/sparkle-quiz.js",
37
40
  "./components/sparkle-quiz/sparkle-quiz-feedback/sparkle-quiz-feedback.js",
38
41
  "./components/sparkle-quiz/sparkle-quiz-input/sparkle-quiz-input.js",
42
+ "./components/sparkle-quiz/sparkle-quiz-old/sparkle-quiz-old.js",
39
43
  "./components/sparkle-quiz/sparkle-quiz-opinion/sparkle-quiz-opinion.js",
40
44
  "./components/sparkle-quiz/sparkle-quiz-poll/sparkle-quiz-poll.js",
41
45
  "./components/sparkle-quiz/sparkle-quiz-select/sparkle-quiz-select.js",
@@ -71,7 +71,7 @@ export class FacilitatorPage {
71
71
  }
72
72
  path = /^\/docs\/pages\/[a-z]{2}\.json$/.test(path) ? path.replace('.json', '/index.json') : path;
73
73
  let lessonPath = this.getLessonPath(path);
74
- console.log(lessonPath);
74
+ console.log("lessonPath", lessonPath);
75
75
  return fetch(path).then(this.validateFetch).then(this.handleNotesPage).catch(this.handleBadFetch) &&
76
76
  fetch(lessonPath).then(this.validateFetch).then(this.handleLessonNotesPage).catch(this.handleLessonNotesBadFetch);
77
77
  }
@@ -84,7 +84,7 @@ export class FacilitatorPage {
84
84
  if (path === null || path === oldPath) {
85
85
  return;
86
86
  }
87
- if (SignalRService.getInstance().connection.connectionState == "Connected") {
87
+ if (SignalRService.getInstance().connection._connectionState == "Connected") {
88
88
  SignalRService.getInstance().callSignalR("NavigateFacilitatorPresentationCourseTo", { url: this.path.replace(".json", "") });
89
89
  }
90
90
  path = /^\/docs\/pages\/[a-z]{2}\.json$/.test(path) ? path.replace('.json', '/index.json') : path;
@@ -185,7 +185,6 @@ export class FacilitatorPage {
185
185
  return h(Template, { page: notesPage });
186
186
  }
187
187
  render() {
188
- console.log(facilitatorStore.state.classes);
189
188
  const { page } = this;
190
189
  const content = this.renderTabs();
191
190
  return h("div", { class: "container" },
@@ -177,3 +177,7 @@ sparkle-page .controls {
177
177
  display: flex;
178
178
  justify-content: flex-end;
179
179
  }
180
+
181
+ .controls ion-button ion-icon {
182
+ color: #fff;
183
+ }