@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
@@ -5,11 +5,11 @@
5
5
  * It contains typing information for all components that exist in this project.
6
6
  */
7
7
  import { HTMLStencilElement, JSXBase } from "./stencil-public-runtime";
8
+ import { SparkleQuizQuestion } from "./models/quiz.model";
8
9
  import { IPageResult } from "./models/page.model";
9
10
  import { RouterHistory } from "@stencil/router";
10
11
  import { ClassFeedPostViewModel, CommentViewModel, StudentAppDataViewModel } from "./models/class.model";
11
12
  import { IGoal } from "./models/goal.model";
12
- import { SparkleQuizQuestion } from "./models/quiz.model";
13
13
  import { EnvironmentSparkleConfig } from "./services/environment/environment-config";
14
14
  export namespace Components {
15
15
  interface CompassSvg {
@@ -23,6 +23,8 @@ export namespace Components {
23
23
  "playAnimation": () => Promise<void>;
24
24
  "src": string;
25
25
  }
26
+ interface SparkleAssignment {
27
+ }
26
28
  interface SparkleCharacterIntro {
27
29
  "character": string;
28
30
  "position": 'left' | 'right';
@@ -43,6 +45,25 @@ export namespace Components {
43
45
  }
44
46
  interface SparkleCourseRoot {
45
47
  }
48
+ interface SparkleDiscussion {
49
+ "allowPostToFeed": boolean;
50
+ "feedStartingText": string;
51
+ "isTeacherMode": boolean;
52
+ "questionIds": string;
53
+ }
54
+ interface SparkleDiscussionQuestions {
55
+ "allowPostToFeed": boolean;
56
+ "feedStartingText": string;
57
+ "isTeacherMode": boolean;
58
+ "postToFeedAssignmentName": string;
59
+ "questions": Array<SparkleQuizQuestion>;
60
+ }
61
+ interface SparkleDiscussionResults {
62
+ "allowPostToFeed": boolean;
63
+ "feedStartingText": string;
64
+ "isTeacherMode": boolean;
65
+ "questions": Array<SparkleQuizQuestion>;
66
+ }
46
67
  interface SparkleEmoji {
47
68
  "mood": string;
48
69
  "size": 'xs' | 'sm' | 'mg' | 'lg';
@@ -132,14 +153,9 @@ export namespace Components {
132
153
  }
133
154
  interface SparkleQuiz {
134
155
  "correct": boolean;
135
- "feedback": string;
136
156
  "questionId": number;
137
- "questionText": string;
138
- "scale": 'FIVE-POINTS' | 'TEN-POINTS';
139
157
  "showInstantResult": boolean;
140
- "showOptionNumber": boolean;
141
158
  "submitted": boolean;
142
- "type": 'MULTIPLE-CHOICE' | 'TEXT' | 'FEEDBACK' | 'OPINION' | 'POLL';
143
159
  }
144
160
  interface SparkleQuizContainer {
145
161
  "questionIds": string;
@@ -151,6 +167,17 @@ export namespace Components {
151
167
  interface SparkleQuizInput {
152
168
  "question": SparkleQuizQuestion;
153
169
  }
170
+ interface SparkleQuizOld {
171
+ "correct": boolean;
172
+ "feedback": string;
173
+ "questionId": number;
174
+ "questionText": string;
175
+ "scale": 'FIVE-POINTS' | 'TEN-POINTS';
176
+ "showInstantResult": boolean;
177
+ "showOptionNumber": boolean;
178
+ "submitted": boolean;
179
+ "type": 'MULTIPLE-CHOICE' | 'TEXT' | 'FEEDBACK' | 'OPINION' | 'POLL';
180
+ }
154
181
  interface SparkleQuizOpinion {
155
182
  "question": SparkleQuizQuestion;
156
183
  }
@@ -161,12 +188,6 @@ export namespace Components {
161
188
  "allowMultiple": boolean;
162
189
  "question": SparkleQuizQuestion;
163
190
  }
164
- interface SparkleQuizV1 {
165
- "correct": boolean;
166
- "questionId": number;
167
- "showInstantResult": boolean;
168
- "submitted": boolean;
169
- }
170
191
  interface SparkleResetPassword {
171
192
  "history": RouterHistory;
172
193
  }
@@ -223,6 +244,10 @@ export interface SparkleQuizInputCustomEvent<T> extends CustomEvent<T> {
223
244
  detail: T;
224
245
  target: HTMLSparkleQuizInputElement;
225
246
  }
247
+ export interface SparkleQuizOldCustomEvent<T> extends CustomEvent<T> {
248
+ detail: T;
249
+ target: HTMLSparkleQuizOldElement;
250
+ }
226
251
  export interface SparkleQuizOpinionCustomEvent<T> extends CustomEvent<T> {
227
252
  detail: T;
228
253
  target: HTMLSparkleQuizOpinionElement;
@@ -235,10 +260,6 @@ export interface SparkleQuizSelectCustomEvent<T> extends CustomEvent<T> {
235
260
  detail: T;
236
261
  target: HTMLSparkleQuizSelectElement;
237
262
  }
238
- export interface SparkleQuizV1CustomEvent<T> extends CustomEvent<T> {
239
- detail: T;
240
- target: HTMLSparkleQuizV1Element;
241
- }
242
263
  declare global {
243
264
  interface HTMLCompassSvgElement extends Components.CompassSvg, HTMLStencilElement {
244
265
  }
@@ -252,6 +273,12 @@ declare global {
252
273
  prototype: HTMLSparkleAnimationPlayerElement;
253
274
  new (): HTMLSparkleAnimationPlayerElement;
254
275
  };
276
+ interface HTMLSparkleAssignmentElement extends Components.SparkleAssignment, HTMLStencilElement {
277
+ }
278
+ var HTMLSparkleAssignmentElement: {
279
+ prototype: HTMLSparkleAssignmentElement;
280
+ new (): HTMLSparkleAssignmentElement;
281
+ };
255
282
  interface HTMLSparkleCharacterIntroElement extends Components.SparkleCharacterIntro, HTMLStencilElement {
256
283
  }
257
284
  var HTMLSparkleCharacterIntroElement: {
@@ -276,6 +303,24 @@ declare global {
276
303
  prototype: HTMLSparkleCourseRootElement;
277
304
  new (): HTMLSparkleCourseRootElement;
278
305
  };
306
+ interface HTMLSparkleDiscussionElement extends Components.SparkleDiscussion, HTMLStencilElement {
307
+ }
308
+ var HTMLSparkleDiscussionElement: {
309
+ prototype: HTMLSparkleDiscussionElement;
310
+ new (): HTMLSparkleDiscussionElement;
311
+ };
312
+ interface HTMLSparkleDiscussionQuestionsElement extends Components.SparkleDiscussionQuestions, HTMLStencilElement {
313
+ }
314
+ var HTMLSparkleDiscussionQuestionsElement: {
315
+ prototype: HTMLSparkleDiscussionQuestionsElement;
316
+ new (): HTMLSparkleDiscussionQuestionsElement;
317
+ };
318
+ interface HTMLSparkleDiscussionResultsElement extends Components.SparkleDiscussionResults, HTMLStencilElement {
319
+ }
320
+ var HTMLSparkleDiscussionResultsElement: {
321
+ prototype: HTMLSparkleDiscussionResultsElement;
322
+ new (): HTMLSparkleDiscussionResultsElement;
323
+ };
279
324
  interface HTMLSparkleEmojiElement extends Components.SparkleEmoji, HTMLStencilElement {
280
325
  }
281
326
  var HTMLSparkleEmojiElement: {
@@ -456,6 +501,12 @@ declare global {
456
501
  prototype: HTMLSparkleQuizInputElement;
457
502
  new (): HTMLSparkleQuizInputElement;
458
503
  };
504
+ interface HTMLSparkleQuizOldElement extends Components.SparkleQuizOld, HTMLStencilElement {
505
+ }
506
+ var HTMLSparkleQuizOldElement: {
507
+ prototype: HTMLSparkleQuizOldElement;
508
+ new (): HTMLSparkleQuizOldElement;
509
+ };
459
510
  interface HTMLSparkleQuizOpinionElement extends Components.SparkleQuizOpinion, HTMLStencilElement {
460
511
  }
461
512
  var HTMLSparkleQuizOpinionElement: {
@@ -474,12 +525,6 @@ declare global {
474
525
  prototype: HTMLSparkleQuizSelectElement;
475
526
  new (): HTMLSparkleQuizSelectElement;
476
527
  };
477
- interface HTMLSparkleQuizV1Element extends Components.SparkleQuizV1, HTMLStencilElement {
478
- }
479
- var HTMLSparkleQuizV1Element: {
480
- prototype: HTMLSparkleQuizV1Element;
481
- new (): HTMLSparkleQuizV1Element;
482
- };
483
528
  interface HTMLSparkleResetPasswordElement extends Components.SparkleResetPassword, HTMLStencilElement {
484
529
  }
485
530
  var HTMLSparkleResetPasswordElement: {
@@ -531,10 +576,14 @@ declare global {
531
576
  interface HTMLElementTagNameMap {
532
577
  "compass-svg": HTMLCompassSvgElement;
533
578
  "sparkle-animation-player": HTMLSparkleAnimationPlayerElement;
579
+ "sparkle-assignment": HTMLSparkleAssignmentElement;
534
580
  "sparkle-character-intro": HTMLSparkleCharacterIntroElement;
535
581
  "sparkle-compass": HTMLSparkleCompassElement;
536
582
  "sparkle-compass-post": HTMLSparkleCompassPostElement;
537
583
  "sparkle-course-root": HTMLSparkleCourseRootElement;
584
+ "sparkle-discussion": HTMLSparkleDiscussionElement;
585
+ "sparkle-discussion-questions": HTMLSparkleDiscussionQuestionsElement;
586
+ "sparkle-discussion-results": HTMLSparkleDiscussionResultsElement;
538
587
  "sparkle-emoji": HTMLSparkleEmojiElement;
539
588
  "sparkle-export-lessons": HTMLSparkleExportLessonsElement;
540
589
  "sparkle-facilitator-dashboard": HTMLSparkleFacilitatorDashboardElement;
@@ -565,10 +614,10 @@ declare global {
565
614
  "sparkle-quiz-container": HTMLSparkleQuizContainerElement;
566
615
  "sparkle-quiz-feedback": HTMLSparkleQuizFeedbackElement;
567
616
  "sparkle-quiz-input": HTMLSparkleQuizInputElement;
617
+ "sparkle-quiz-old": HTMLSparkleQuizOldElement;
568
618
  "sparkle-quiz-opinion": HTMLSparkleQuizOpinionElement;
569
619
  "sparkle-quiz-poll": HTMLSparkleQuizPollElement;
570
620
  "sparkle-quiz-select": HTMLSparkleQuizSelectElement;
571
- "sparkle-quiz-v1": HTMLSparkleQuizV1Element;
572
621
  "sparkle-reset-password": HTMLSparkleResetPasswordElement;
573
622
  "sparkle-root": HTMLSparkleRootElement;
574
623
  "sparkle-signup": HTMLSparkleSignupElement;
@@ -587,6 +636,8 @@ declare namespace LocalJSX {
587
636
  "initialClassMode"?: boolean;
588
637
  "src"?: string;
589
638
  }
639
+ interface SparkleAssignment {
640
+ }
590
641
  interface SparkleCharacterIntro {
591
642
  "character"?: string;
592
643
  "position"?: 'left' | 'right';
@@ -606,6 +657,25 @@ declare namespace LocalJSX {
606
657
  interface SparkleCourseRoot {
607
658
  "onPageChanged"?: (event: SparkleCourseRootCustomEvent<any>) => void;
608
659
  }
660
+ interface SparkleDiscussion {
661
+ "allowPostToFeed"?: boolean;
662
+ "feedStartingText"?: string;
663
+ "isTeacherMode"?: boolean;
664
+ "questionIds"?: string;
665
+ }
666
+ interface SparkleDiscussionQuestions {
667
+ "allowPostToFeed"?: boolean;
668
+ "feedStartingText"?: string;
669
+ "isTeacherMode"?: boolean;
670
+ "postToFeedAssignmentName"?: string;
671
+ "questions"?: Array<SparkleQuizQuestion>;
672
+ }
673
+ interface SparkleDiscussionResults {
674
+ "allowPostToFeed"?: boolean;
675
+ "feedStartingText"?: string;
676
+ "isTeacherMode"?: boolean;
677
+ "questions"?: Array<SparkleQuizQuestion>;
678
+ }
609
679
  interface SparkleEmoji {
610
680
  "mood"?: string;
611
681
  "size"?: 'xs' | 'sm' | 'mg' | 'lg';
@@ -698,15 +768,10 @@ declare namespace LocalJSX {
698
768
  }
699
769
  interface SparkleQuiz {
700
770
  "correct"?: boolean;
701
- "feedback"?: string;
702
771
  "onQuizAnswerChanged"?: (event: SparkleQuizCustomEvent<{ answer: any; question: SparkleQuizQuestion }>) => void;
703
772
  "questionId"?: number;
704
- "questionText"?: string;
705
- "scale"?: 'FIVE-POINTS' | 'TEN-POINTS';
706
773
  "showInstantResult"?: boolean;
707
- "showOptionNumber"?: boolean;
708
774
  "submitted"?: boolean;
709
- "type"?: 'MULTIPLE-CHOICE' | 'TEXT' | 'FEEDBACK' | 'OPINION' | 'POLL';
710
775
  }
711
776
  interface SparkleQuizContainer {
712
777
  "questionIds"?: string;
@@ -720,6 +785,18 @@ declare namespace LocalJSX {
720
785
  "onQuizInputChange"?: (event: SparkleQuizInputCustomEvent<{ value: string, question: SparkleQuizQuestion }>) => void;
721
786
  "question"?: SparkleQuizQuestion;
722
787
  }
788
+ interface SparkleQuizOld {
789
+ "correct"?: boolean;
790
+ "feedback"?: string;
791
+ "onQuizAnswerChanged"?: (event: SparkleQuizOldCustomEvent<{ answer: any; question: SparkleQuizQuestion }>) => void;
792
+ "questionId"?: number;
793
+ "questionText"?: string;
794
+ "scale"?: 'FIVE-POINTS' | 'TEN-POINTS';
795
+ "showInstantResult"?: boolean;
796
+ "showOptionNumber"?: boolean;
797
+ "submitted"?: boolean;
798
+ "type"?: 'MULTIPLE-CHOICE' | 'TEXT' | 'FEEDBACK' | 'OPINION' | 'POLL';
799
+ }
723
800
  interface SparkleQuizOpinion {
724
801
  "onQuizOpinionChange"?: (event: SparkleQuizOpinionCustomEvent<{ value: any, question: SparkleQuizQuestion }>) => void;
725
802
  "question"?: SparkleQuizQuestion;
@@ -733,13 +810,6 @@ declare namespace LocalJSX {
733
810
  "onQuizSelectChange"?: (event: SparkleQuizSelectCustomEvent<{ value: any[], question: SparkleQuizQuestion }>) => void;
734
811
  "question"?: SparkleQuizQuestion;
735
812
  }
736
- interface SparkleQuizV1 {
737
- "correct"?: boolean;
738
- "onQuizAnswerChanged"?: (event: SparkleQuizV1CustomEvent<{ answer: any, question: SparkleQuizQuestion }>) => void;
739
- "questionId"?: number;
740
- "showInstantResult"?: boolean;
741
- "submitted"?: boolean;
742
- }
743
813
  interface SparkleResetPassword {
744
814
  "history"?: RouterHistory;
745
815
  }
@@ -765,10 +835,14 @@ declare namespace LocalJSX {
765
835
  interface IntrinsicElements {
766
836
  "compass-svg": CompassSvg;
767
837
  "sparkle-animation-player": SparkleAnimationPlayer;
838
+ "sparkle-assignment": SparkleAssignment;
768
839
  "sparkle-character-intro": SparkleCharacterIntro;
769
840
  "sparkle-compass": SparkleCompass;
770
841
  "sparkle-compass-post": SparkleCompassPost;
771
842
  "sparkle-course-root": SparkleCourseRoot;
843
+ "sparkle-discussion": SparkleDiscussion;
844
+ "sparkle-discussion-questions": SparkleDiscussionQuestions;
845
+ "sparkle-discussion-results": SparkleDiscussionResults;
772
846
  "sparkle-emoji": SparkleEmoji;
773
847
  "sparkle-export-lessons": SparkleExportLessons;
774
848
  "sparkle-facilitator-dashboard": SparkleFacilitatorDashboard;
@@ -799,10 +873,10 @@ declare namespace LocalJSX {
799
873
  "sparkle-quiz-container": SparkleQuizContainer;
800
874
  "sparkle-quiz-feedback": SparkleQuizFeedback;
801
875
  "sparkle-quiz-input": SparkleQuizInput;
876
+ "sparkle-quiz-old": SparkleQuizOld;
802
877
  "sparkle-quiz-opinion": SparkleQuizOpinion;
803
878
  "sparkle-quiz-poll": SparkleQuizPoll;
804
879
  "sparkle-quiz-select": SparkleQuizSelect;
805
- "sparkle-quiz-v1": SparkleQuizV1;
806
880
  "sparkle-reset-password": SparkleResetPassword;
807
881
  "sparkle-root": SparkleRoot;
808
882
  "sparkle-signup": SparkleSignup;
@@ -819,10 +893,14 @@ declare module "@stencil/core" {
819
893
  interface IntrinsicElements {
820
894
  "compass-svg": LocalJSX.CompassSvg & JSXBase.HTMLAttributes<HTMLCompassSvgElement>;
821
895
  "sparkle-animation-player": LocalJSX.SparkleAnimationPlayer & JSXBase.HTMLAttributes<HTMLSparkleAnimationPlayerElement>;
896
+ "sparkle-assignment": LocalJSX.SparkleAssignment & JSXBase.HTMLAttributes<HTMLSparkleAssignmentElement>;
822
897
  "sparkle-character-intro": LocalJSX.SparkleCharacterIntro & JSXBase.HTMLAttributes<HTMLSparkleCharacterIntroElement>;
823
898
  "sparkle-compass": LocalJSX.SparkleCompass & JSXBase.HTMLAttributes<HTMLSparkleCompassElement>;
824
899
  "sparkle-compass-post": LocalJSX.SparkleCompassPost & JSXBase.HTMLAttributes<HTMLSparkleCompassPostElement>;
825
900
  "sparkle-course-root": LocalJSX.SparkleCourseRoot & JSXBase.HTMLAttributes<HTMLSparkleCourseRootElement>;
901
+ "sparkle-discussion": LocalJSX.SparkleDiscussion & JSXBase.HTMLAttributes<HTMLSparkleDiscussionElement>;
902
+ "sparkle-discussion-questions": LocalJSX.SparkleDiscussionQuestions & JSXBase.HTMLAttributes<HTMLSparkleDiscussionQuestionsElement>;
903
+ "sparkle-discussion-results": LocalJSX.SparkleDiscussionResults & JSXBase.HTMLAttributes<HTMLSparkleDiscussionResultsElement>;
826
904
  "sparkle-emoji": LocalJSX.SparkleEmoji & JSXBase.HTMLAttributes<HTMLSparkleEmojiElement>;
827
905
  "sparkle-export-lessons": LocalJSX.SparkleExportLessons & JSXBase.HTMLAttributes<HTMLSparkleExportLessonsElement>;
828
906
  "sparkle-facilitator-dashboard": LocalJSX.SparkleFacilitatorDashboard & JSXBase.HTMLAttributes<HTMLSparkleFacilitatorDashboardElement>;
@@ -853,10 +931,10 @@ declare module "@stencil/core" {
853
931
  "sparkle-quiz-container": LocalJSX.SparkleQuizContainer & JSXBase.HTMLAttributes<HTMLSparkleQuizContainerElement>;
854
932
  "sparkle-quiz-feedback": LocalJSX.SparkleQuizFeedback & JSXBase.HTMLAttributes<HTMLSparkleQuizFeedbackElement>;
855
933
  "sparkle-quiz-input": LocalJSX.SparkleQuizInput & JSXBase.HTMLAttributes<HTMLSparkleQuizInputElement>;
934
+ "sparkle-quiz-old": LocalJSX.SparkleQuizOld & JSXBase.HTMLAttributes<HTMLSparkleQuizOldElement>;
856
935
  "sparkle-quiz-opinion": LocalJSX.SparkleQuizOpinion & JSXBase.HTMLAttributes<HTMLSparkleQuizOpinionElement>;
857
936
  "sparkle-quiz-poll": LocalJSX.SparkleQuizPoll & JSXBase.HTMLAttributes<HTMLSparkleQuizPollElement>;
858
937
  "sparkle-quiz-select": LocalJSX.SparkleQuizSelect & JSXBase.HTMLAttributes<HTMLSparkleQuizSelectElement>;
859
- "sparkle-quiz-v1": LocalJSX.SparkleQuizV1 & JSXBase.HTMLAttributes<HTMLSparkleQuizV1Element>;
860
938
  "sparkle-reset-password": LocalJSX.SparkleResetPassword & JSXBase.HTMLAttributes<HTMLSparkleResetPasswordElement>;
861
939
  "sparkle-root": LocalJSX.SparkleRoot & JSXBase.HTMLAttributes<HTMLSparkleRootElement>;
862
940
  "sparkle-signup": LocalJSX.SparkleSignup & JSXBase.HTMLAttributes<HTMLSparkleSignupElement>;
@@ -20,6 +20,10 @@ export interface ClassFeedPostViewModel {
20
20
  MiniAppId: number;
21
21
  ProfileImageUrl: string;
22
22
  }
23
+ export interface CreateAssignmentRequestModel {
24
+ AssignmentName: string;
25
+ AssignmentData: string;
26
+ }
23
27
  export declare enum PostVisibility {
24
28
  Private = 0,
25
29
  Public = 1
@@ -0,0 +1,8 @@
1
+ import { IResult } from './httpService';
2
+ import { ClassFeedPostViewModel, CreateAssignmentRequestModel } from '../models/class.model';
3
+ export declare class AssignmentService {
4
+ private static instance;
5
+ private constructor();
6
+ static getInstance(): AssignmentService;
7
+ createAssignment(payload: CreateAssignmentRequestModel): Promise<IResult<ClassFeedPostViewModel>>;
8
+ }
@@ -1,4 +1,4 @@
1
- import { AuthUser } from "../../models/auth/auth.user";
1
+ import { AuthUser } from '../../models/auth/auth.user';
2
2
  interface AuthenticationModel {
3
3
  Email: string;
4
4
  Password: string;
@@ -1,3 +1,5 @@
1
+ export interface EnvironmentAuthConfig {
2
+ }
1
3
  export interface EnvironmentSparkleConfig {
2
4
  prod: boolean;
3
5
  appUrl: string;
@@ -11,6 +13,7 @@ export interface EnvironmentSparkleConfig {
11
13
  showModuleIndex: boolean;
12
14
  showSessionIndex: boolean;
13
15
  };
16
+ auth?: EnvironmentAuthConfig;
14
17
  }
15
18
  export interface EnvironmentConfig {
16
19
  sparkle: EnvironmentSparkleConfig;
@@ -0,0 +1,12 @@
1
+ import { AuthUser } from '../models/auth/auth.user';
2
+ export declare class TokenService {
3
+ private static instance;
4
+ static getInstance(): TokenService;
5
+ getToken(): Promise<string>;
6
+ getAuthUser(): Promise<AuthUser>;
7
+ getAuthUserSync(): AuthUser;
8
+ getTokenSync(): string;
9
+ getTokenExpiry(): Promise<number>;
10
+ saveAuthUser(authUser: AuthUser): Promise<void>;
11
+ removeAuthUser(): Promise<void>;
12
+ }
@@ -15,6 +15,7 @@ export declare function MyHealthTemplate(heartRate: number): string;
15
15
  export declare function MyHealthTemplateJSON(heartRate: number): string;
16
16
  export declare function MyGoalTemplate(goalName: string, text: string, progress: number): string;
17
17
  export declare function MyGoalTemplateJSON(goalName: string, goalUpdateText: string, progress: number): string;
18
+ export declare function FeedPostJSON(postText: string): string;
18
19
  export declare class SparkleGlobal {
19
20
  static MY_GOALS_APP_ID: number;
20
21
  static MY_HEALTH_APP_ID: number;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sparkle-learning/core",
3
- "version": "0.0.52",
3
+ "version": "0.0.54",
4
4
  "description": "sparkle",
5
5
  "main": "dist/index.cjs.js",
6
6
  "module": "dist/index.js",
@@ -1,124 +0,0 @@
1
- 'use strict';
2
-
3
- Object.defineProperty(exports, '__esModule', { value: true });
4
-
5
- const index = require('./index-51e8292e.js');
6
- const environmentConfig_service = require('./environment-config.service-0e02b049.js');
7
- require('./auth.store-1e630a7d.js');
8
-
9
- const sparkleFeedPostCss = ":host{display:block}.post-footer-container{display:flex;justify-content:flex-end}.post-footer{display:flex;justify-content:space-between;align-items:center}.error{color:red;margin-right:10px}.success{color:green;margin-right:10px}.uploaded-image{display:block;max-height:140px;width:auto !important}.public-post-toggle{display:flex;justify-content:flex-end;align-items:center}.assignment-name{display:none}";
10
-
11
- const SparkleFeedPost = class {
12
- constructor(hostRef) {
13
- index.registerInstance(this, hostRef);
14
- }
15
- // @Prop({ connect: 'ion-toast-controller' })
16
- // toastCtrl: HTMLIonToastControllerElement;
17
- componentDidLoad() {
18
- this.postText = this.textValue;
19
- if (this.ref && this.ref.innerText) {
20
- this.assignmentName = this.ref.innerText;
21
- console.log(this.assignmentName);
22
- }
23
- }
24
- setText(text) {
25
- this.postText = text;
26
- }
27
- // async postToFeed() {
28
- // const sparkleConfig: EnvironmentSparkleConfig = EnvironmentConfigService.getInstance().get('sparkle');
29
- // const tocData = await AssetsService.getInstance().loadJsonFile<ICourse>(sparkleConfig.tocPath);
30
- // var model = {
31
- // CourseId: tocData.id,
32
- // MiniAppId: SparkleGlobal.MY_GOALS_APP_ID,
33
- // PostText: MyGoalTemplate(this.name.value, this.goalUpdateText.value, this.progress),
34
- // PostTextJSON: MyGoalTemplateJSON(this.name.value, this.goalUpdateText.value, this.progress),
35
- // IsPublic: this.public,
36
- // ExternalResourceUrl: "",
37
- // }
38
- // const result = await FeedService.getInstance().createPost(model);
39
- // if (result.Succeeded) {
40
- // //show success toast
41
- // }
42
- // }
43
- isAuthenticated() {
44
- try {
45
- var sparkleConfig = environmentConfig_service.EnvironmentConfigService.getInstance().get('sparkle');
46
- if (!!sparkleConfig && !!sparkleConfig.auth && !!sparkleConfig.auth.getToken()) {
47
- return true;
48
- }
49
- }
50
- catch (_a) {
51
- return false;
52
- }
53
- }
54
- submitPost() {
55
- this.errorMessage = '';
56
- this.successMessage = '';
57
- //let formData = new FormData(this.el.querySelector("form")) as any;
58
- //var postText = this.el.getElementsByClassName("PostText")[0] as HTMLInputElement;
59
- this.el.getElementsByClassName('PostExternalUrl')[0];
60
- this.el.getElementsByClassName('IsPublic')[0];
61
- // this.dataSvc.saveData(data, '/api/class/feed').subscribe(
62
- // x => {
63
- // this.successMessage = 'Posted Successfully.';
64
- // // this.presentToast('Success');
65
- // },
66
- // error => {
67
- // this.errorMessage = 'There is an error while posting.';
68
- // // this.presentToast('There is an error');
69
- // },
70
- // );
71
- //TODO can we return data from the dataSvc so we know if it's successful and can update the form? (Perhaps replace it with the post itself?)
72
- // if (this.assignmentName) {
73
- // data.AssignmentData = JSON.stringify({ text: data.PostText, url: data.ExternalResourceUrl });
74
- // this.dataSvc.saveData(data, '/api/student/assignment-response').subscribe(
75
- // x => {
76
- // this.successMessage = 'Posted Successfully.';
77
- // // this.presentToast('Success');
78
- // },
79
- // error => {
80
- // this.errorMessage = 'There is an error while posting.';
81
- // // this.presentToast('There is an error');
82
- // },
83
- // );
84
- // }
85
- }
86
- uploadImage(evt) {
87
- // this.uploadImageLoading = true;
88
- // var files = evt.target.files;
89
- // this.dataSvc.uploadImage(files, '/api/mediaitems/upload').subscribe(
90
- // x => {
91
- // this.uploadImageLoading = false;
92
- // this.uploadedImage = x.length > 0 ? x[0].FullImageUrl : '';
93
- // this.externalResourceUrl = x.length > 0 ? x[0].FullImageUrl : '';
94
- // //this.successMessage = 'Posted Successfully.'
95
- // // this.presentToast('Success');
96
- // },
97
- // error => {
98
- // this.uploadImageLoading = false;
99
- // this.errorMessage = 'There is an error while uploading an image.';
100
- // },
101
- // );
102
- }
103
- selectFile() {
104
- var fileInput = document.getElementById('fileInput');
105
- fileInput.click();
106
- }
107
- renderUserInfo() {
108
- var tokenInfo = { Token: null, ProfileImageUrl: null };
109
- if (tokenInfo != null && tokenInfo.Token) {
110
- return (index.h("ion-avatar", { class: "header-avatar", slot: "end" }, index.h("img", { src: "/assets/img/avatar.png" })));
111
- }
112
- else {
113
- return (index.h("ion-button", { slot: "end", href: "/login" }, "Login to Post"));
114
- }
115
- }
116
- render() {
117
- const userInfo = this.renderUserInfo();
118
- return (index.h(index.Host, null, index.h("div", { class: "assignment-name", ref: el => (this.ref = el) }, index.h("slot", null)), index.h("ion-card", null, index.h("ion-item", { class: "header", lines: "full" }, userInfo), index.h("ion-card-content", null, index.h("form", null, index.h("ion-list", null, index.h("ion-item", { class: "padding" }, index.h("ion-textarea", { class: "PostText", required: true, placeholder: "Post Text", name: "PostText", value: this.postText })), index.h("ion-item", { class: "padding" }, index.h("ion-input", { class: "PostExternalUrl", required: true, type: "text", placeholder: "URL", name: "ExternalResourceUrl", value: this.externalResourceUrl })), this.uploadedImage ? (index.h("ion-item", { class: "padding" }, index.h("img", { class: "uploaded-image", src: this.uploadedImage }))) : (''), index.h("ion-item", { lines: "none" }, index.h("input", { type: "file", id: "fileInput", onChange: evt => this.uploadImage(evt), style: { display: 'none' }, accept: "image/*" }), this.uploadImageLoading ? index.h("ion-spinner", { color: "primary" }) : '', index.h("ion-button", { slot: "start", onClick: evt => this.selectFile() }, index.h("ion-icon", { name: "add" }), "Upload Image")), index.h("div", { class: "public-post-toggle" }, index.h("ion-toggle", { class: "IsPublic", color: "primary", name: "IsPublic" }), index.h("div", null, "Public Post")), index.h("div", { class: "post-footer-container" }, index.h("div", { class: "post-footer" }, index.h("div", null, index.h("div", { class: "error" }, this.errorMessage), index.h("div", { class: "success" }, this.successMessage)), index.h("ion-button", { slot: "end", size: "default", onClick: evt => this.submitPost(), disabled: !this.isAuthenticated() }, "Post")))))))));
119
- }
120
- get el() { return index.getElement(this); }
121
- };
122
- SparkleFeedPost.style = sparkleFeedPostCss;
123
-
124
- exports.sparkle_feed_post = SparkleFeedPost;
@@ -1,105 +0,0 @@
1
- 'use strict';
2
-
3
- Object.defineProperty(exports, '__esModule', { value: true });
4
-
5
- const index = require('./index-51e8292e.js');
6
- const assets_service = require('./assets.service-0c759d51.js');
7
- const environmentConfig_service = require('./environment-config.service-0e02b049.js');
8
-
9
- const sparkleQuizV1Css = "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)}";
10
-
11
- const SparkleQuizV1 = class {
12
- constructor(hostRef) {
13
- index.registerInstance(this, hostRef);
14
- this.quizAnswerChanged = index.createEvent(this, "quizAnswerChanged", 7);
15
- }
16
- async loadQuestion() {
17
- if (this.quizData) {
18
- this.question = this.quizData[+this.questionId];
19
- }
20
- }
21
- async componentWillLoad() {
22
- }
23
- async componentDidLoad() {
24
- const config = environmentConfig_service.EnvironmentConfigService.getInstance().get('sparkle');
25
- this.quizData = await assets_service.AssetsService.getInstance().loadJsonFile(config.quizPath);
26
- await this.loadQuestion();
27
- this.quizAnswerChanged.emit({
28
- question: null,
29
- answer: "1"
30
- });
31
- }
32
- quizInputChangeHandler(event) {
33
- this.quizAnswerChanged.emit({
34
- question: event.detail.question,
35
- answer: event.detail.value
36
- });
37
- }
38
- quizFeedbackChangeHandler(event) {
39
- this.quizAnswerChanged.emit({
40
- question: event.detail.question,
41
- answer: event.detail.value
42
- });
43
- }
44
- quizSelectChangeHandler(event) {
45
- this.quizAnswerChanged.emit({
46
- question: event.detail.question,
47
- answer: event.detail.value
48
- });
49
- }
50
- quizOpinionChangeHandler(event) {
51
- this.quizAnswerChanged.emit({
52
- question: event.detail.question,
53
- answer: event.detail.value
54
- });
55
- }
56
- getQuestionFeedback() {
57
- if (this.question.questionType == "MULTIPLE-CHOICE") {
58
- const feedbacks = this.question.options.filter(x => x.correct == true).map(x => x.feedback);
59
- return feedbacks.length > 0 && feedbacks.map(feedback => index.h("small", null, feedback));
60
- }
61
- else if (this.question.questionType == "FEEDBACK" || this.question.questionType == "TEXT") {
62
- return this.question.feedback && index.h("small", null, " ", this.question.feedback);
63
- }
64
- }
65
- showAnswerStatus() {
66
- return index.h("div", null, this.correct ? index.h("strong", null, "Good job!") : index.h("strong", null, "Incorrect answer, please try again."));
67
- }
68
- renderQuestion() {
69
- if (this.question.questionType == "MULTIPLE-CHOICE") {
70
- return index.h("sparkle-quiz-select", { question: this.question, allowMultiple: true });
71
- }
72
- else if (this.question.questionType == "FEEDBACK") {
73
- return index.h("sparkle-quiz-feedback", { question: this.question });
74
- }
75
- else if (this.question.questionType == "TEXT") {
76
- return index.h("sparkle-quiz-input", { question: this.question });
77
- }
78
- else if (this.question.questionType == "OPINION") {
79
- return index.h("sparkle-quiz-opinion", { question: this.question });
80
- }
81
- else if (this.question.questionType == "POLL") {
82
- return index.h("sparkle-quiz-poll", { question: this.question });
83
- }
84
- }
85
- render() {
86
- if (this.question) {
87
- let classes = {
88
- 'correct': this.submitted && this.correct,
89
- 'incorrect': this.submitted && !this.correct
90
- };
91
- return index.h("div", { class: classes }, this.renderQuestion(), this.submitted && this.showInstantResult && index.h("div", { class: "feedback-container" }, [this.showAnswerStatus(),
92
- this.getQuestionFeedback()]));
93
- }
94
- else {
95
- return index.h("p", null, "No question found.");
96
- }
97
- }
98
- get el() { return index.getElement(this); }
99
- static get watchers() { return {
100
- "questionId": ["loadQuestion"]
101
- }; }
102
- };
103
- SparkleQuizV1.style = sparkleQuizV1Css;
104
-
105
- exports.sparkle_quiz_v1 = SparkleQuizV1;