@sparkle-learning/core 0.0.52 → 0.0.53

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 (42) hide show
  1. package/dist/cjs/header-mobile-collapse_61.cjs.entry.js +15 -2994
  2. package/dist/cjs/{ion-select_2.cjs.entry.js → ion-select_3.cjs.entry.js} +118 -0
  3. package/dist/cjs/loader.cjs.js +1 -1
  4. package/dist/cjs/signalR.service-5672eebc.js +2987 -0
  5. package/dist/cjs/sparkle-animation-player.cjs.entry.js +1 -0
  6. package/dist/cjs/sparkle-core.cjs.js +1 -1
  7. package/dist/cjs/sparkle-discussion-questions_2.cjs.entry.js +272 -0
  8. package/dist/cjs/sparkle-discussion.cjs.entry.js +40 -0
  9. package/dist/collection/collection-manifest.json +3 -0
  10. package/dist/collection/components/sparkle-animation-player/sparkle-animation-player.js +1 -0
  11. package/dist/collection/components/sparkle-course-root/sparkle-course-root.js +1 -1
  12. package/dist/collection/components/sparkle-discussion/sparkle-discussion-questions/sparkle-discussion-questions.css +157 -0
  13. package/dist/collection/components/sparkle-discussion/sparkle-discussion-questions/sparkle-discussion-questions.js +230 -0
  14. package/dist/collection/components/sparkle-discussion/sparkle-discussion-results/sparkle-discussion-results.css +158 -0
  15. package/dist/collection/components/sparkle-discussion/sparkle-discussion-results/sparkle-discussion-results.js +268 -0
  16. package/dist/collection/components/sparkle-discussion/sparkle-discussion.css +0 -0
  17. package/dist/collection/components/sparkle-discussion/sparkle-discussion.js +110 -0
  18. package/dist/esm/header-mobile-collapse_61.entry.js +3 -2982
  19. package/dist/esm/{ion-select_2.entry.js → ion-select_3.entry.js} +118 -1
  20. package/dist/esm/loader.js +1 -1
  21. package/dist/esm/signalR.service-9d5b9f36.js +2984 -0
  22. package/dist/esm/sparkle-animation-player.entry.js +1 -0
  23. package/dist/esm/sparkle-core.js +1 -1
  24. package/dist/esm/sparkle-discussion-questions_2.entry.js +267 -0
  25. package/dist/esm/sparkle-discussion.entry.js +36 -0
  26. package/dist/sparkle-core/{p-0335c863.entry.js → p-0a5d7c4f.entry.js} +26 -26
  27. package/dist/sparkle-core/p-18cdd458.entry.js +1 -0
  28. package/dist/sparkle-core/p-30767c1c.entry.js +1 -0
  29. package/dist/sparkle-core/p-3265ed87.entry.js +1 -0
  30. package/dist/sparkle-core/{p-564e64fc.entry.js → p-44334ef3.entry.js} +2 -2
  31. package/dist/sparkle-core/p-4c9f994f.js +1 -0
  32. package/dist/sparkle-core/sparkle-core.esm.js +1 -1
  33. package/dist/types/components/sparkle-discussion/sparkle-discussion-questions/sparkle-discussion-questions.d.ts +28 -0
  34. package/dist/types/components/sparkle-discussion/sparkle-discussion-results/sparkle-discussion-results.d.ts +45 -0
  35. package/dist/types/components/sparkle-discussion/sparkle-discussion.d.ts +11 -0
  36. package/dist/types/components.d.ts +66 -1
  37. package/package.json +1 -1
  38. package/dist/cjs/sparkle-feed-post.cjs.entry.js +0 -124
  39. package/dist/esm/sparkle-feed-post.entry.js +0 -120
  40. package/dist/sparkle-core/p-15403881.entry.js +0 -1
  41. package/dist/sparkle-core/p-41a9ece7.entry.js +0 -1
  42. package/dist/types/components/sparkle-quiz/sparkle-quiz.d.ts +0 -41
@@ -0,0 +1,157 @@
1
+ div.question {
2
+ margin-bottom: 5px;
3
+ }
4
+ div.question ul {
5
+ padding-left: 5px;
6
+ }
7
+ div.question li {
8
+ list-style-type: none;
9
+ cursor: pointer;
10
+ background: #e5053a;
11
+ border-radius: 4px;
12
+ vertical-align: middle;
13
+ line-height: 40px;
14
+ padding-left: 20px;
15
+ color: #fff;
16
+ margin-bottom: 5px;
17
+ }
18
+ .question h3 {
19
+ color: #333;
20
+ padding-top: 14px;
21
+ margin-bottom: 4px;
22
+ font-size: 16px;
23
+ }
24
+ div.question li.selected {
25
+ font-weight: bold;
26
+ background: #9e0428;
27
+ }
28
+ input[type='text'] {
29
+ width: 100%;
30
+ padding: 12px 20px;
31
+ margin: 8px 0;
32
+ box-sizing: border-box;
33
+ border: 2px solid #ccc;
34
+ -webkit-transition: 0.5s;
35
+ transition: 0.5s;
36
+ outline: none;
37
+ }
38
+
39
+ input[type='text']:focus {
40
+ border: 2px solid var(--ion-color-primary);
41
+ }
42
+ ion-item .item-native {
43
+ padding-left: 0px !important;
44
+ }
45
+ ion-button.suggetion-btn {
46
+ margin-left: 0px !important;
47
+ }
48
+
49
+ /* ion-alert {
50
+ .alert-wrapper {
51
+ --min-width: 320px;
52
+ border: 1px solid #e5053a !important;
53
+ }
54
+ .alert-button {
55
+ background-color: var(--ion-color-primary);
56
+ color: #fff;
57
+ }
58
+ .alert-button-group button {
59
+ background-color: var(--ion-color-primary) !important;
60
+ color: #fff !important;
61
+ }
62
+ .alert-button-group {
63
+ justify-content: space-between !important;
64
+ padding: 10px 12px 10px 24px !important;
65
+ }
66
+ .alert-radio-icon {
67
+ display: none !important;
68
+ }
69
+ .alert-head {
70
+ display: none;
71
+ }
72
+ .alert-radio-label {
73
+ padding: 13px 26px 13px 34px !important;
74
+ }
75
+ .alert-radio-group {
76
+ padding: 20px 0px !important;
77
+ border-bottom: none !important;
78
+ }
79
+ .alert-radio-button {
80
+ &[aria-checked="true"] {
81
+ border-top: 1px solid #e5053a !important;
82
+ border-bottom: 1px solid #e5053a !important;
83
+ .alert-radio-label {
84
+ color: #e5053a !important;
85
+ }
86
+ }
87
+ }
88
+ ion-backdrop {
89
+ opacity: 0.1 !important;
90
+ }
91
+ }
92
+ ion-item {
93
+ ion-label {
94
+ color: var(--ion-color-primary) !important;
95
+ ion-icon {
96
+ transform: rotate(-90deg) !important;
97
+ }
98
+ }
99
+ }
100
+ */
101
+ .graph-container {
102
+ display: flex;
103
+ flex-direction: row;
104
+ flex-wrap: wrap;
105
+ flex-direction: column;
106
+ }
107
+ .graph-container .question-title {
108
+ width: 100%;
109
+ }
110
+ .graph-container div.question {
111
+ display: flex;
112
+ flex-direction: column;
113
+ justify-content: flex-end;
114
+ flex-basis: 100px;
115
+ }
116
+ .graph-container div.question p {
117
+ text-align: center;
118
+ }
119
+ .answer-column {
120
+ background-color: antiquewhite;
121
+ flex: 0 0 auto;
122
+ text-align: center;
123
+ color: #c0873c;
124
+ flex-basis: 100px;
125
+ }
126
+ .toggle-mode {
127
+ color: #888;
128
+ }
129
+
130
+ .cloud {
131
+ display: inline;
132
+ list-style-type: none;
133
+ width: 400px;
134
+ }
135
+ .cloud > div {
136
+ list-style: none;
137
+ display: inline;
138
+ padding: 20px;
139
+ }
140
+ .cloud > div:nth-of-type(3n + 1) {
141
+ font-size: 1.25em;
142
+ }
143
+ .cloud > div:nth-of-type(4n + 3) {
144
+ font-size: 1.5em;
145
+ }
146
+ .cloud > div:nth-of-type(5n - 3) {
147
+ font-size: 1em;
148
+ }
149
+
150
+ .bar-graph-column {
151
+ display: flex;
152
+ align-items: flex-end;
153
+ }
154
+ .bar-graph-questions {
155
+ display: flex;
156
+ align-items: flex-start;
157
+ }
@@ -0,0 +1,230 @@
1
+ import { Component, Element, State, Prop, h } from '@stencil/core';
2
+ import { SignalRService } from '../../../services/signalR.service';
3
+ export class SparkleDiscussionQuestions {
4
+ constructor() {
5
+ this.allowPostToFeed = false;
6
+ this.feedStartingText = 'My suggestions are:';
7
+ this.isTeacherMode = false;
8
+ this.questions = [];
9
+ this.error = '';
10
+ this.modelChange = '';
11
+ this.responses = [];
12
+ this.tempResponses = [];
13
+ this.suggestionList = [];
14
+ this.postToFeedTextValue = '';
15
+ }
16
+ componentDidLoad() { }
17
+ resetPollData() {
18
+ SignalRService.getInstance().callSignalR('ResetPollData', {});
19
+ }
20
+ selectOption(evt, question, option) {
21
+ evt.target.parentElement.childNodes.forEach(e => e.classList.remove('selected'));
22
+ evt.target.classList.add('selected');
23
+ //console.log(question, option);
24
+ SignalRService.getInstance().callSignalR('PollSubmission', {
25
+ questionId: question.questionId,
26
+ question: question.question,
27
+ answer: option.option,
28
+ responseType: question.responseType,
29
+ });
30
+ }
31
+ addSuggestion(evt, question) {
32
+ var inputVal = evt.target.parentElement.parentElement.querySelector('input[type=text]');
33
+ if (inputVal.value == '' || !inputVal.value) {
34
+ this.error = 'Please enter the value';
35
+ }
36
+ else {
37
+ SignalRService.getInstance().callSignalR('PollSubmission', {
38
+ questionId: question.questionId,
39
+ question: question.questionText,
40
+ answer: inputVal.value,
41
+ responseType: question.questionType,
42
+ });
43
+ // this.dataSvc.callSignalR(
44
+ // {
45
+ // questionId: question.questionId,
46
+ // question: question.question,
47
+ // answer: inputVal.value,
48
+ // responseType: question.responseType,
49
+ // },
50
+ // 'PollSubmission',
51
+ // true,
52
+ // );
53
+ //&& question.updateFeedText
54
+ if (this.allowPostToFeed) {
55
+ this.suggestionList.push({ questionId: question.questionId, question: question.questionText, answer: inputVal.value, responseType: question.questionType });
56
+ let value = this.suggestionList
57
+ .map(x => x.answer)
58
+ .join(', ')
59
+ .toString();
60
+ this.postToFeedTextValue = this.feedStartingText + ' ' + value;
61
+ }
62
+ }
63
+ }
64
+ // async presentToast(message: string) {
65
+ // const toast = await this.toastCtrl.create({
66
+ // message: message,
67
+ // duration: 2000
68
+ // });
69
+ // await toast.present();
70
+ // }
71
+ toggleMode() {
72
+ this.isTeacherMode = !this.isTeacherMode;
73
+ }
74
+ renderOptions(question) {
75
+ if (question.questionType == 'MULTIPLE-CHOICE') {
76
+ return (h("ul", null, question.options.map(opt => (h("li", { onClick: evt => this.selectOption(evt, question, opt) }, opt.option)))));
77
+ }
78
+ else if (question.questionType == 'FEEDBACK') {
79
+ let options = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10];
80
+ return (h("ion-item", null,
81
+ h("ion-label", null,
82
+ "Choose Option ",
83
+ h("ion-icon", { name: "arrow-back", mode: "ios" })),
84
+ h("ion-select", { id: "customAlertSelect", interface: "alert" },
85
+ h("ion-select-option", { value: "bacon" }, "Bacon"),
86
+ h("ion-select-option", { value: "olives" }, "Black Olives"),
87
+ h("ion-select-option", { value: "xcheese" }, "Extra Cheese"),
88
+ h("ion-select-option", { value: "peppers" }, "Green Peppers"),
89
+ h("ion-select-option", { value: "mushrooms" }, "Mushrooms"),
90
+ h("ion-select-option", { value: "onions" }, "Onions"),
91
+ h("ion-select-option", { value: "pepperoni" }, "Pepperoni"),
92
+ h("ion-select-option", { value: "pineapple" }, "Pineapple"),
93
+ h("ion-select-option", { value: "sausage" }, "Sausage"),
94
+ h("ion-select-option", { value: "Spinach" }, "Spinach"))));
95
+ }
96
+ else {
97
+ return (h("div", null,
98
+ h("input", { slot: "start", type: "text", placeholder: "Type suggestion" }),
99
+ h("div", null, this.error),
100
+ h("ion-item", null,
101
+ h("ion-button", { class: "suggetion-btn", size: "default", slot: "end", color: "primary", onClick: evt => this.addSuggestion(evt, question) }, "ADD SUGGESTION"))));
102
+ }
103
+ }
104
+ renderQuestions() {
105
+ return [
106
+ this.questions.map(q => (h("div", { class: 'question' },
107
+ h("h3", null,
108
+ q.questionText,
109
+ ' ',
110
+ h("span", { class: "toggle-mode", onClick: () => this.toggleMode() }, ".")),
111
+ this.renderOptions(q)))),
112
+ this.allowPostToFeed ? h("sparkle-feed-post", { assignmentName: this.postToFeedAssignmentName, textValue: this.postToFeedTextValue }) : '',
113
+ ];
114
+ }
115
+ render() {
116
+ return this.renderQuestions();
117
+ }
118
+ static get is() { return "sparkle-discussion-questions"; }
119
+ static get originalStyleUrls() { return {
120
+ "$": ["sparkle-discussion-questions.css"]
121
+ }; }
122
+ static get styleUrls() { return {
123
+ "$": ["sparkle-discussion-questions.css"]
124
+ }; }
125
+ static get properties() { return {
126
+ "allowPostToFeed": {
127
+ "type": "boolean",
128
+ "mutable": false,
129
+ "complexType": {
130
+ "original": "boolean",
131
+ "resolved": "boolean",
132
+ "references": {}
133
+ },
134
+ "required": false,
135
+ "optional": false,
136
+ "docs": {
137
+ "tags": [],
138
+ "text": ""
139
+ },
140
+ "attribute": "allow-post-to-feed",
141
+ "reflect": false,
142
+ "defaultValue": "false"
143
+ },
144
+ "postToFeedAssignmentName": {
145
+ "type": "string",
146
+ "mutable": false,
147
+ "complexType": {
148
+ "original": "string",
149
+ "resolved": "string",
150
+ "references": {}
151
+ },
152
+ "required": false,
153
+ "optional": false,
154
+ "docs": {
155
+ "tags": [],
156
+ "text": ""
157
+ },
158
+ "attribute": "post-to-feed-assignment-name",
159
+ "reflect": false
160
+ },
161
+ "feedStartingText": {
162
+ "type": "string",
163
+ "mutable": false,
164
+ "complexType": {
165
+ "original": "string",
166
+ "resolved": "string",
167
+ "references": {}
168
+ },
169
+ "required": false,
170
+ "optional": false,
171
+ "docs": {
172
+ "tags": [],
173
+ "text": ""
174
+ },
175
+ "attribute": "feed-starting-text",
176
+ "reflect": false,
177
+ "defaultValue": "'My suggestions are:'"
178
+ },
179
+ "isTeacherMode": {
180
+ "type": "boolean",
181
+ "mutable": false,
182
+ "complexType": {
183
+ "original": "boolean",
184
+ "resolved": "boolean",
185
+ "references": {}
186
+ },
187
+ "required": false,
188
+ "optional": false,
189
+ "docs": {
190
+ "tags": [],
191
+ "text": ""
192
+ },
193
+ "attribute": "is-teacher-mode",
194
+ "reflect": false,
195
+ "defaultValue": "false"
196
+ },
197
+ "questions": {
198
+ "type": "unknown",
199
+ "mutable": false,
200
+ "complexType": {
201
+ "original": "Array<SparkleQuizQuestion>",
202
+ "resolved": "SparkleQuizQuestion[]",
203
+ "references": {
204
+ "Array": {
205
+ "location": "global"
206
+ },
207
+ "SparkleQuizQuestion": {
208
+ "location": "import",
209
+ "path": "../../../models/quiz.model"
210
+ }
211
+ }
212
+ },
213
+ "required": false,
214
+ "optional": false,
215
+ "docs": {
216
+ "tags": [],
217
+ "text": ""
218
+ },
219
+ "defaultValue": "[]"
220
+ }
221
+ }; }
222
+ static get states() { return {
223
+ "error": {},
224
+ "modelChange": {},
225
+ "responses": {},
226
+ "suggestionList": {},
227
+ "postToFeedTextValue": {}
228
+ }; }
229
+ static get elementRef() { return "el"; }
230
+ }
@@ -0,0 +1,158 @@
1
+ div.question {
2
+ margin-bottom: 5px;
3
+ }
4
+ div.question ul {
5
+ padding-left: 5px;
6
+ }
7
+ div.question li {
8
+ list-style-type: none;
9
+ cursor: pointer;
10
+ background: #e5053a;
11
+ border-radius: 4px;
12
+ vertical-align: middle;
13
+ line-height: 40px;
14
+ padding-left: 20px;
15
+ color: #fff;
16
+ margin-bottom: 5px;
17
+ }
18
+ .question h3 {
19
+ color: #333;
20
+ padding-top: 14px;
21
+ margin-bottom: 4px;
22
+ font-size: 16px;
23
+ }
24
+ div.question li.selected {
25
+ font-weight: bold;
26
+ background: #9e0428;
27
+ }
28
+ input[type='text'] {
29
+ width: 100%;
30
+ padding: 12px 20px;
31
+ margin: 8px 0;
32
+ box-sizing: border-box;
33
+ border: 2px solid #ccc;
34
+ -webkit-transition: 0.5s;
35
+ transition: 0.5s;
36
+ outline: none;
37
+ }
38
+
39
+ input[type='text']:focus {
40
+ border: 2px solid var(--ion-color-primary);
41
+ }
42
+ ion-item .item-native {
43
+ padding-left: 0px !important;
44
+ }
45
+ ion-button.suggetion-btn {
46
+ margin-left: 0px !important;
47
+ }
48
+
49
+ /* ion-alert {
50
+ .alert-wrapper {
51
+ --min-width: 320px;
52
+ border: 1px solid #e5053a !important;
53
+ }
54
+ .alert-button {
55
+ background-color: var(--ion-color-primary);
56
+ color: #fff;
57
+ }
58
+ .alert-button-group button {
59
+ background-color: var(--ion-color-primary) !important;
60
+ color: #fff !important;
61
+ }
62
+ .alert-button-group {
63
+ justify-content: space-between !important;
64
+ padding: 10px 12px 10px 24px !important;
65
+ }
66
+ .alert-radio-icon {
67
+ display: none !important;
68
+ }
69
+ .alert-head {
70
+ display: none;
71
+ }
72
+ .alert-radio-label {
73
+ padding: 13px 26px 13px 34px !important;
74
+ }
75
+ .alert-radio-group {
76
+ padding: 20px 0px !important;
77
+ border-bottom: none !important;
78
+ }
79
+ .alert-radio-button {
80
+ &[aria-checked="true"] {
81
+ border-top: 1px solid #e5053a !important;
82
+ border-bottom: 1px solid #e5053a !important;
83
+ .alert-radio-label {
84
+ color: #e5053a !important;
85
+ }
86
+ }
87
+ }
88
+ ion-backdrop {
89
+ opacity: 0.1 !important;
90
+ }
91
+ }
92
+ ion-item {
93
+ ion-label {
94
+ color: var(--ion-color-primary) !important;
95
+ ion-icon {
96
+ transform: rotate(-90deg) !important;
97
+ }
98
+ }
99
+ }
100
+ */
101
+ .graph-container {
102
+ display: flex;
103
+ flex-direction: row;
104
+ flex-wrap: wrap;
105
+ flex-direction: column;
106
+ }
107
+ .graph-container .question-title {
108
+ width: 100%;
109
+ }
110
+ .graph-container div.question {
111
+ display: flex;
112
+ flex-direction: column;
113
+ justify-content: flex-end;
114
+ flex-basis: 100px;
115
+ }
116
+ .graph-container div.question p {
117
+ text-align: center;
118
+ }
119
+ .answer-column {
120
+ background-color: rgba(var(--ion-color-sparkle-rgb), var(--bg-alpha, 0.06));
121
+ flex: 0 0 auto;
122
+ text-align: center;
123
+ color: #c0873c;
124
+ flex-basis: 100px;
125
+ margin-bottom: 14px;
126
+ }
127
+ .toggle-mode {
128
+ color: #888;
129
+ }
130
+
131
+ .cloud {
132
+ display: inline;
133
+ list-style-type: none;
134
+ width: 400px;
135
+ }
136
+ .cloud > div {
137
+ list-style: none;
138
+ display: inline;
139
+ padding: 20px;
140
+ }
141
+ .cloud > div:nth-of-type(3n + 1) {
142
+ font-size: 1.25em;
143
+ }
144
+ .cloud > div:nth-of-type(4n + 3) {
145
+ font-size: 1.5em;
146
+ }
147
+ .cloud > div:nth-of-type(5n - 3) {
148
+ font-size: 1em;
149
+ }
150
+
151
+ .bar-graph-column {
152
+ display: flex;
153
+ align-items: flex-end;
154
+ }
155
+ .bar-graph-questions {
156
+ display: flex;
157
+ align-items: flex-start;
158
+ }